Init.cs 492 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.IO;
  3. using Base;
  4. using UnityEngine;
  5. namespace Model
  6. {
  7. public class Init: MonoBehaviour
  8. {
  9. private void Start()
  10. {
  11. Game.EntityEventManager.Register("Model", typeof (Game).Assembly);
  12. Game.Scene.AddComponent<ILRuntimeComponent>();
  13. }
  14. private void Update()
  15. {
  16. try
  17. {
  18. Game.EntityEventManager.Update();
  19. }
  20. catch (Exception e)
  21. {
  22. Log.Error(e.ToString());
  23. }
  24. }
  25. private void OnApplicationQuit()
  26. {
  27. Game.CloseScene();
  28. }
  29. }
  30. }