UILoadingFactory.cs 727 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using UnityEngine;
  3. namespace ET
  4. {
  5. public static class UILoadingFactory
  6. {
  7. public static UI Create(Entity domain)
  8. {
  9. try
  10. {
  11. GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get<GameObject>(UIType.UILoading);
  12. GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
  13. go.layer = LayerMask.NameToLayer(LayerNames.UI);
  14. UI ui = EntityFactory.Create<UI, string, GameObject>(domain, UIType.UILoading, go);
  15. ui.AddComponent<UILoadingComponent>();
  16. return ui;
  17. }
  18. catch (Exception e)
  19. {
  20. Log.Error(e);
  21. return null;
  22. }
  23. }
  24. public static void Remove(string type)
  25. {
  26. }
  27. }
  28. }