Example #1
0
 private void OnJumpToDemo(GameObject go, PointerEventData eventData)
 {
     if (_rootPrefab == null)
     {
         return;
     }
     JResource.LoadSceneAsync("UIDemo.unity", () =>
     {
         GameObject root = GameObject.Instantiate(_rootPrefab);
         var uiroot      = JBehaviour.CreateOn <UIRootView>(root);
         UIMgr.Instance.ShowUI(JTestViewPath);
     });
 }
Example #2
0
 public static void InitUIRoot()
 {
     if (_instance != null)
     {
         Log.PrintError("UI Root已存在");
         return;
     }
     JPrefab UIRootPrefab = new JPrefab("UI Root.prefab",
                                        (success, prefab) =>
     {
         if (!success)
         {
             Log.PrintError("UI Root预制体加载失败");
             return;
         }
         GameObject root = prefab.Instantiate("UI Root");
         JBehaviour.CreateOn <UIRootView>(root);
     });
 }
Example #3
0
 /// <summary>
 /// Create JUI on a gameObject
 /// 在游戏对象上创建JUI
 /// </summary>
 /// <param name="gameObject"></param>
 /// <returns></returns>
 public static JUI CreateOn(GameObject gameObject)
 {
     return(JBehaviour.CreateOn <JUI>(gameObject, false));
 }