Files
Syntriax.Engine/Engine.Core/Behaviour2D.cs
Syntriax 988a6f67f2 BREAKING CHANGE: renamed original Behaviour class to BehaviourInternal, and replaced it with BehaviourBase
Original Behaviour was using old methods for detecting entering/exiting universe,
they are now all under the same hood and the original is kept for UniverseEntranceManager
because it needs to enter the universe without itself. The internal behaviour kept under
a subnamespace of "Core.Internal" for the purpose that it might come in handy for other use cases.
2025-10-22 16:50:19 +03:00

11 lines
486 B
C#

namespace Engine.Core;
// TODO this should not use independent behaviour, the OnInitialize usage for getting the transform can cause very unexpected issues
public abstract class Behaviour2D : Internal.BehaviourIndependent, IBehaviour2D
{
public ITransform2D Transform { get; private set; } = null!;
protected override void OnInitialize() => Transform = BehaviourController.GetRequiredBehaviour<ITransform2D>();
protected override void OnFinalize() => Transform = null!;
}