Ejemplo n.º 1
0
        private void OnBeginFight(Packet packet)
        {
            this._root.CloseModalWait();
            _DTO_begin_fight dto = (( _PACKET_ROOM_ACMD_BEGIN_FIGHT )packet).dto;

            UIManager.EnterLoading(dto);
        }
Ejemplo n.º 2
0
        private void StartLoad(_DTO_begin_fight dto)
        {
            int count = dto.players.Length;

            string[] players = new string[count];
            for (int i = 0; i < count; i++)
            {
                players[i] = dto.players[i].cid;
            }

            BattleData battleData = ModelFactory.GetBattleData(dto.map);

            count = battleData.neutrals.Count;
            string[] neutrals = new string[count];
            int      j        = 0;

            foreach (KeyValuePair <string, BattleData.Neutral> kv in battleData.neutrals)
            {
                neutrals[j++] = kv.Value.id;
            }

            count = battleData.structures.Count;
            string[] structures = new string[count];
            j = 0;
            foreach (KeyValuePair <string, BattleData.Structure> kv in battleData.structures)
            {
                structures[j++] = kv.Value.id;
            }

            MapLoadHelper.Preload(dto.map, players, neutrals, structures, this.OnLoadComplete, this.OnLoadProgress, this.OnLoadError);
        }
Ejemplo n.º 3
0
        private IEnumerator StartLoad(_DTO_begin_fight dto)
        {
            GProgressBar   bar = this._root["bar"].asProgress;
            AsyncOperation ao  = SceneManager.LoadSceneAsync("maze", LoadSceneMode.Single);

            while (!ao.isDone)
            {
                bar.value = ao.progress;
                yield return(0);
            }
            bar.value = 1f;
            NetModule.instance.Send(ProtocolManager.PACKET_ROOM_QCMD_MAP_READY());
        }
Ejemplo n.º 4
0
        public void Enter(object param)
        {
            NetModule.instance.AddACMDListener(Module.BATTLE, Command.ACMD_ENTER_BATTLE, this.OnEnterBattle);
            NetModule.instance.AddQCMDListener(Module.ROOM, Command.QCMD_MAP_READY, this.OnMapReadyResult);

            this._root = UIPackage.CreateObject("cutscene", "Main").asCom;
            GRoot.inst.AddChild(this._root);

            GProgressBar bar = this._root["bar"].asProgress;

            bar.value    = 0;
            bar.minValue = 0;
            bar.maxValue = 1;

            _DTO_begin_fight dto = ( _DTO_begin_fight )param;

            this.StartLoad(dto);
        }
Ejemplo n.º 5
0
 public static void EnterLoading(_DTO_begin_fight dto)
 {
     EnterModule(loadLevel, dto);
 }