FiE-Game/Assets/Scripts/Fie/Manager/FieManagerBase.cs

30 lines
563 B
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
using Photon;
using UnityEngine;
2023-06-11 13:39:49 +02:00
namespace Fie.Manager {
2018-11-20 20:10:49 +01:00
[FieManagerExists(FieManagerExistSceneFlag.ANYTIME_DESTROY)]
2023-06-11 13:39:49 +02:00
public abstract class FieManagerBase : Photon.MonoBehaviour {
2018-11-20 20:10:49 +01:00
private bool _isEndStartup;
private bool _isDestroyed;
public bool isDestroyed => _isDestroyed;
2023-06-11 13:39:49 +02:00
protected virtual void StartUpEntity() {
2018-11-20 20:10:49 +01:00
}
2023-06-11 13:39:49 +02:00
public void StartUp() {
if (!_isEndStartup) {
2018-11-20 20:10:49 +01:00
StartUpEntity();
_isEndStartup = true;
}
}
public void Destroy()
{
UnityEngine.Object.Destroy(base.transform.gameObject);
_isDestroyed = true;
}
}
}