Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public abstract class InitableMonoBehaviour
  2. {
  3. private bool isInited;
  4.  
  5. public void Init()
  6. {
  7. if (isInited)
  8. {
  9. Debug.LogWarning($"Trying to init already inited {GetType().Name}");
  10. }
  11. else
  12. {
  13. OnInit();
  14. }
  15. }
  16.  
  17. protected abstract void OnInit();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement