48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using Unity.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace RebootKit.Engine.Simulation {
|
|
public abstract class Actor : MonoBehaviour {
|
|
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 Tick(float deltaTime) {
|
|
}
|
|
|
|
public virtual void SerializeNetworkState(ref DataStreamWriter writer) {
|
|
}
|
|
|
|
public virtual void DeserializeNetworkState(ref DataStreamReader reader) {
|
|
}
|
|
}
|
|
} |