Exemplo n.º 1
0
 /// <summary>
 /// 初始化所有UI
 /// </summary>
 public void InitUI(ESceneID sceneId)
 {
     maskBindUIList.Clear();
     foreach (var dic in viewDic)
     {
         var view = dic.Value;
         view.isInit = false;
         view.isShow = false;
         view.OnDestroy();
         if (view.viewRoot != null)
         {
             Object.Destroy(view.viewRoot);
         }
         view.viewRoot = null;
     }
     if (mask != null)
     {
         mask.SetActive(false);
     }
     if (viewDic.Count == 0)
     {
         viewDic = new Dictionary <UIViewID, UIView> ();
         RegisterUI(UIViewID.LOGIN_VIEW, new LoginView());
         RegisterUI(UIViewID.HALL_VIEW, new HallView());
         RegisterUI(UIViewID.TOPMENU_VIEW, new TopMenuView());
         RegisterUI(UIViewID.BATTLE_VIEW, new BattleView());
         RegisterUI(UIViewID.DIALOG_VIEW, new DialogView());
         RegisterUI(UIViewID.MATCH_RESULT_VIEW, new MatchResultView());
         RegisterUI(UIViewID.ROOM_RESULT_VIEW, new RoomResultView());
         RegisterUI(UIViewID.BOTTOMMENU_VIEW, new BottomMenuView());
         RegisterUI(UIViewID.MIDDLEMENU_VIEW, new MiddleMenuView());
         RegisterUI(UIViewID.PLATER_INFO_VIEW, new PlayerInfoView());
         RegisterUI(UIViewID.SHOPPING_VIEW, new ShoppingView());
         RegisterUI(UIViewID.SIGNIN_VIEW, new SignInView());
         RegisterUI(UIViewID.HELP_VIEW, new HelpView());
         RegisterUI(UIViewID.INVITE_VIEW, new InviteView());
         RegisterUI(UIViewID.SHARE_VIEW, new ShareView());
         RegisterUI(UIViewID.GRADE_VIEW, new GradeView());
         RegisterUI(UIViewID.ACTIVITY_VIEW, new ActivityView());
         RegisterUI(UIViewID.SETTING_VIEW, new SettingView());
         RegisterUI(UIViewID.ARENA_VIEW, new ArenaView());
         RegisterUI(UIViewID.CREATEROOM_VIEW, new CreateRoomView());
         RegisterUI(UIViewID.JOINROOM_VIEW, new JoinRoomView());
         RegisterUI(UIViewID.CHAT_VIEW, new ChatView());
         RegisterUI(UIViewID.DISLOVE_APPLY_VIEW, new DisloveApplyView());
         RegisterUI(UIViewID.DISLOVE_STATISTICS_VIEW, new DisloveStatisticsView());
         RegisterUI(UIViewID.MATCHING_VIEW, new MatchingView());
         RegisterUI(UIViewID.RANK_VIEW, new RankView());
         RegisterUI(UIViewID.HALLROOMLIST_VIEW, new HallRoomListView());
         RegisterUI(UIViewID.SHOPPINGTIPS_VIEW, new ShoppingtipsView());
         RegisterUI(UIViewID.NEWS_VIEW, new NewsView());
         RegisterUI(UIViewID.RULE_VIEW, new RuleView());
         GameMgr.Instance.StartCoroutine(LoadUI(sceneId));
     }
     else
     {
         loadUIPercent = 1;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public MyUGUIScene(ESceneID id, string prefabName, bool isInitWhenLoadUnityScene, bool isHideHUD = false, float fadeInDuration = 0.5f, float fadeOutDuration = 0.5f)
     : base(prefabName)
 {
     mID = id;
     mIsInitWhenLoadUnityScene = isInitWhenLoadUnityScene;
     mIsHideHUD       = isHideHUD;
     mFadeInDuration  = fadeInDuration;
     mFadeOutDuration = fadeOutDuration;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 加载UI
 /// </summary>
 /// <returns></returns>
 private IEnumerator LoadUI(ESceneID sceneId)
 {
     foreach (KeyValuePair <UIViewID, UIView> keyValue in viewDic)
     {
         loadUIPercent = _loadUIPercent + ((float)1) / viewDic.Count;
         //if (keyValue.Value.UISceneID == sceneId || keyValue.Value.UISceneID == ESceneID.SCENE_START)
         //{
         keyValue.Value.LoadUI();
         yield return(new WaitForEndOfFrame());
         //}
     }
     loadUIPercent = 1;
 }
Exemplo n.º 4
0
 public LoadSceneInfo(ESceneID sceneID, LoadSceneType type, LoadSceneMode mode)
 {
     this.sceneID  = sceneID;
     this.loadType = type;
     this.mode     = mode;
 }
 public MyUGUISampleScene(ESceneID id, string prefabName, bool isInitWhenLoadScene, bool isHideHUD = false, float fadeInDuration = 0.5f, float fadeOutDuration = 0.5f)
     : base(id, prefabName, isInitWhenLoadScene, isHideHUD, fadeInDuration, fadeOutDuration)
 {
 }