initial commit
This commit is contained in:
27
Shared/Behaviours/ExampleBehaviour.cs
Normal file
27
Shared/Behaviours/ExampleBehaviour.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user