Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class InitableMonoBehaviour
- {
- private bool isInited;
- public void Init()
- {
- if (isInited)
- {
- Debug.LogWarning($"Trying to init already inited {GetType().Name}");
- }
- else
- {
- OnInit();
- }
- }
- protected abstract void OnInit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement