45 lines
1020 B
C#
Executable File
45 lines
1020 B
C#
Executable File
using RebootKit.Engine.Foundation;
|
|
using UnityEngine;
|
|
|
|
namespace RebootKit.Engine.Services.Simulation {
|
|
public abstract class Actor : MonoBehaviour {
|
|
[field: SerializeField]
|
|
public SerializableGuid ActorGuid { get; private set; } = SerializableGuid.New();
|
|
|
|
bool m_IsPlaying = false;
|
|
public bool IsPlaying {
|
|
get {
|
|
return m_IsPlaying;
|
|
}
|
|
|
|
set {
|
|
if (m_IsPlaying == value) {
|
|
return;
|
|
}
|
|
|
|
m_IsPlaying = value;
|
|
|
|
if (m_IsPlaying) {
|
|
OnBeginPlay();
|
|
} else {
|
|
OnEndPlay();
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual void OnSpawned() {
|
|
}
|
|
|
|
public virtual void OnDespawned() {
|
|
}
|
|
|
|
public virtual void OnBeginPlay() {
|
|
}
|
|
|
|
public virtual void OnEndPlay() {
|
|
}
|
|
|
|
public virtual void OnTick(float deltaTime) {
|
|
}
|
|
}
|
|
} |