Init.cs 668 B

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