UIHelper.cs 637 B

123456789101112131415161718192021
  1. namespace ET.Client
  2. {
  3. public static class UIHelper
  4. {
  5. public static async ETTask<UI> Create(Scene scene, string uiType, UILayer uiLayer, params object[] param)
  6. {
  7. return await scene.GetComponent<UIComponent>().Create(uiType, uiLayer, param);
  8. }
  9. public static async ETTask Remove(Scene scene, string uiType)
  10. {
  11. scene.GetComponent<UIComponent>().Remove(uiType);
  12. await ETTask.CompletedTask;
  13. }
  14. public static UI Get(Scene scene, string name)
  15. {
  16. return scene.GetComponent<UIComponent>().Get(name);
  17. }
  18. }
  19. }