Init.cs 598 B

123456789101112131415161718192021222324252627282930
  1. using System.Reflection;
  2. using Base;
  3. using UnityEngine;
  4. using Object = Base.Object;
  5. namespace Model
  6. {
  7. public class Init: MonoBehaviour
  8. {
  9. private void Start()
  10. {
  11. Object.ObjectManager.Register("Base", typeof(Game).Assembly);
  12. Object.ObjectManager.Register("Model", typeof(Init).Assembly);
  13. Object.ObjectManager.Register("Controller", DllHelper.GetController());
  14. Game.Scene.AddComponent<EventComponent>().Run(EventIdType.InitSceneStart);
  15. }
  16. private void Update()
  17. {
  18. Base.Object.ObjectManager.Update();
  19. }
  20. private void OnApplicationQuit()
  21. {
  22. Game.Close();
  23. }
  24. }
  25. }