Ejemplo n.º 1
0
 //进入状态机
 public override void Enter()
 {
     GMInstance.UIController.updateTeamScore(GMInstance.currentScoreOfAttackerTeam, GMInstance.currentScoreOfDefenderTeam);
     GMInstance.UIController.setTargetScore(GMInstance.targetScore);
     AudioSource.PlayClipAtPoint(GMInstance.gameStartAudio, GMInstance.localPlayer.transform.position);      //播放游戏开始音效
     if (PhotonNetwork.isMasterClient)
     {
         GMInstance.InitCountDown(PhotonNetwork.time + competeDuration);
     }
 }
Ejemplo n.º 2
0
    //进入状态机
    public override void Enter()
    {
        //显示夺宝状态的相关UI
        GMInstance.UIController.enableGuardHPUI(true);
        GMInstance.UIController.enableTimeAndProcessPanel(true);
        GMInstance.UIController.enableRemainDistance(false);
        AudioSource.PlayClipAtPoint(GMInstance.gameStartAudio, GMInstance.localPlayer.transform.position);  //播放游戏开始音效
        if (PhotonNetwork.isMasterClient)
        {
            GMInstance.InitCountDown(PhotonNetwork.time + getTreasureDuration);
        }

        GuardZombie = GameObject.FindWithTag("Guard");
        //僵尸生成池开始工作
        GMInstance.zombieGenerator.generatorStartWorking();

        /*
         * 添加骷髅兵 完成并完成生成池对骷髅兵调度(模仿僵尸生成池)
         */
        //骷髅生成池开始工作
        GMInstance.skeletonGenerator.generatorStartWorking();

        GuardZombie.GetComponent <GuardAI>().Born(); //守护者开始工作
        var maxHp = GuardZombie.GetComponent <ZombieHealth>().maxHP;

        GMInstance.UIController.setGuardMaxHp(maxHp);
        var team = PhotonNetwork.player.customProperties["Team"].ToString();

        if (team == "AttackerTeam")
        {
            GMInstance.UIController.updateProcessText("击败守护者,夺得宝物车!");
        }
        else
        {
            GMInstance.UIController.updateProcessText("保护守护者,阻止盗墓者入侵!");
        }
    }