Esempio n. 1
0
    IEnumerator DelayChangeState(float t, GameStage gs)
    {
        if (gs == GameStage.Combat)
        {
            yield return(new WaitForSeconds(t));

            OnGameStageComplete();
            coroutineFlag = false;
            uIController.hideWinnerIcon();
        }
        else if (gs == GameStage.End)
        {
            currentGold += 6;
            photonView.RPC("UpdatePlayer", RpcTarget.All, playerID, currentHP, currentGold, currentRank);
            //延时t秒
            yield return(new WaitForSeconds(t));

            //设置新游戏状态
            this.currentGameStage = GameStage.Preparation;

            //显示倒计时
            uIController.SetTimerTextActive(true);

            //更新
            coroutineFlag = false;
            timer         = 0;
            cameraBehavior.SetCamera(cameraBehavior.GetCameraPoint(playerID, PointType.start));
            for (int i = 0; i < doors.Length; i++)
            {
                doors[i].resetTheDoor();
            }

            uIController.UpdateUI();

            //刷新商品
            for (int i = 0; i < championShop.availableChampionArray.Length; i++)
            {
                //随机获取
                Champion champion = championShop.GetRandomChampionInfo();
                //存入商品列表
                championShop.availableChampionArray[i] = champion;
                //加载
                uIController.LoadShopItem(champion, i);
                //显示
                uIController.ShowShopItems();
            }
        }
    }