mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-07-18 19:41:54 +08:00
StateMachine Component
This commit is contained in:
@ -15,30 +15,19 @@ namespace Strawberry
|
||||
Visible = visible;
|
||||
}
|
||||
|
||||
public void Added(Entity entity)
|
||||
private void Added(Entity entity)
|
||||
{
|
||||
Entity = entity;
|
||||
}
|
||||
|
||||
public void Removed()
|
||||
private void Removed()
|
||||
{
|
||||
Entity = null;
|
||||
}
|
||||
|
||||
public virtual void Started()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Draw()
|
||||
{
|
||||
|
||||
}
|
||||
public abstract void Started();
|
||||
public abstract void Update();
|
||||
public abstract void Draw();
|
||||
|
||||
[Inline]
|
||||
public void RemoveSelf()
|
||||
|
@ -89,7 +89,7 @@ namespace Strawberry
|
||||
{
|
||||
components.Remove(c);
|
||||
Scene.[Friend]UntrackComponent(c);
|
||||
c.Removed();
|
||||
c.[Friend]Removed();
|
||||
delete c;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ namespace Strawberry
|
||||
{
|
||||
components.Add(c);
|
||||
Scene.[Friend]TrackComponent(c);
|
||||
c.Added(this);
|
||||
c.[Friend]Added(this);
|
||||
}
|
||||
|
||||
toAdd.Clear();
|
||||
|
Reference in New Issue
Block a user