Exemple #1
0
        /// <summary>
        /// 加载和场景匹配的游戏主UI
        /// 从网络初始化玩家数据,只在登陆进入游戏的时候需要,后续都是增量更新
        /// </summary>
        void CreateLevelInit()
        {
            Log.GUI("Push Main UI ");
            var uiName = Util.GetUI();

            WindowMng.windowMng.PushView(uiName, false, false);
            MyEventSystem.myEventSystem.PushEvent(MyEvent.EventType.UpdateMainUI);


            Log.Sys("Init SaveGame And Data");
            if (SaveGame.saveGame == null)
            {
                //var saveGame = Instantiate (Resources.Load<GameObject> ("levelPublic/saveGame")) as GameObject;
                var g        = new GameObject();
                var saveGame = g.AddComponent <SaveGame>();
                saveGame.GetComponent <SaveGame> ().InitData();
            }
            else
            {
            }

            StartCoroutine(SaveGame.saveGame.InitDataFromNetwork());
        }