UnityFacade.cs 579 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections;
  2. using PureMVC.Patterns.Facade;
  3. using PureMVC.Interfaces;
  4. using James.Base;
  5. using James.Command;
  6. namespace JamesCore
  7. {
  8. /// <summary>
  9. /// Global Entry Logically.
  10. /// </summary>
  11. public class UnityFacade : Facade
  12. {
  13. //实例化函数,保证单例模式(Singleton)运行该函数
  14. public static IFacade Instance
  15. {
  16. get
  17. {
  18. return Singleton<UnityFacade>.Instance;
  19. }
  20. }
  21. private UnityFacade() { }
  22. public void Initialize()
  23. {
  24. Core.Initialize();
  25. RegisterCommand(EventsEnum.STARTUP, () => new StartupCommand());
  26. }
  27. }
  28. }