Init.cs 691 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Threading;
  2. using UnityEngine;
  3. namespace ET
  4. {
  5. public class Init: MonoBehaviour
  6. {
  7. private CodeLoader codeLoader;
  8. private void Awake()
  9. {
  10. SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
  11. DontDestroyOnLoad(gameObject);
  12. Log.ILog = new UnityLogger();
  13. Options.Instance = new Options();
  14. this.codeLoader = CodeLoader.Instance;
  15. }
  16. private void Start()
  17. {
  18. this.codeLoader.Start();
  19. }
  20. private void Update()
  21. {
  22. this.codeLoader.Update();
  23. }
  24. private void LateUpdate()
  25. {
  26. this.codeLoader.LateUpdate();
  27. }
  28. private void OnApplicationQuit()
  29. {
  30. this.codeLoader.OnApplicationQuit();
  31. }
  32. }
  33. }