working on multiplayer
This commit is contained in:
45
Runtime/Engine/Code/Simulation/Actor.cs
Normal file
45
Runtime/Engine/Code/Simulation/Actor.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user