28 lines
526 B
C#
28 lines
526 B
C#
|
|
using Engine.Core;
|
|
using Engine.Core.Debug;
|
|
|
|
namespace MyUniverse.Shared.Behaviours;
|
|
|
|
public class ExampleBehaviour : Behaviour, IFirstFrameUpdate, ILastFrameUpdate, IUpdate
|
|
{
|
|
private ILogger logger = null!;
|
|
|
|
public void FirstActiveFrame()
|
|
{
|
|
logger = Universe.FindRequiredBehaviour<ILogger>();
|
|
|
|
logger.Log(this, "First Frame");
|
|
}
|
|
|
|
public void LastActiveFrame()
|
|
{
|
|
logger.Log(this, $"Last Frame");
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
logger.Log(this, "Frame");
|
|
}
|
|
}
|