Exemple #1
0
    private void OnClick()
    {
        string selection = GameObject.Find("PopupListCharacterHUMAN").GetComponent <UIPopupList>().selection;

        NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[0], state: true);
        fgmkii.needChooseSide = false;
        if (FengGameManagerMKII.Level.Mode == GameMode.PVP_CAPTURE)
        {
            fgmkii.checkpoint = GameObject.Find("PVPchkPtH");
        }
        if (!PhotonNetwork.isMasterClient && fgmkii.roundTime > 60f)
        {
            if (!AreAllPlayersDead())
            {
                fgmkii.NOTSpawnPlayer(selection);
            }
            else
            {
                fgmkii.NOTSpawnPlayer(selection);
                fgmkii.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient);
            }
        }
        else if (FengGameManagerMKII.Level.Mode == GameMode.BOSS_FIGHT_CT || FengGameManagerMKII.Level.Mode == GameMode.TROST || FengGameManagerMKII.Level.Mode == GameMode.PVP_CAPTURE)
        {
            if (AreAllPlayersDead())
            {
                fgmkii.NOTSpawnPlayer(selection);
                fgmkii.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient);
            }
            else
            {
                fgmkii.SpawnPlayer(selection);
            }
        }
        else
        {
            fgmkii.SpawnPlayer(selection);
        }
        NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[1], state: false);
        NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[2], state: false);
        NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[3], state: false);
        IN_GAME_MAIN_CAMERA.UsingTitan = false;
        GameObject.Find("MainCamera").GetComponent <IN_GAME_MAIN_CAMERA>().setHUDposition();
        PhotonNetwork.player.SetCustomProperties(new Hashtable
        {
            { PhotonPlayerProperty.Character, selection }
        });
    }
    private void OnClick()
    {
        if (IN_GAME_MAIN_CAMERA.Gamemode == GameMode.TeamDeathmatch)
        {
            string text = "AHSS";
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[0], state: true);
            fgmkii.needChooseSide = false;
            if (!PhotonNetwork.isMasterClient && fgmkii.roundTime > 60f)
            {
                fgmkii.NOTSpawnPlayer(text);
                fgmkii.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient);
            }
            else
            {
                fgmkii.SpawnPlayer(text, "playerRespawn2");
            }
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[1], state: false);
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[2], state: false);
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[3], state: false);
            IN_GAME_MAIN_CAMERA.UsingTitan = false;
            GameObject.Find("MainCamera").GetComponent <IN_GAME_MAIN_CAMERA>().SetHUDPosition();

            PhotonNetwork.player.SetCustomProperties(new Hashtable
            {
                { PhotonPlayerProperty.Character, text }
            });
        }
        else
        {
            if (IN_GAME_MAIN_CAMERA.Gamemode == GameMode.PvPCapture)
            {
                fgmkii.checkpoint = GameObject.Find("PVPchkPtT");
            }
            string selection = GameObject.Find("PopupListCharacterTITAN").GetComponent <UIPopupList>().selection;
            NGUITools.SetActive(base.transform.parent.gameObject, state: false);
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[0], state: true);
            if ((!PhotonNetwork.isMasterClient && fgmkii.roundTime > 60f) || fgmkii.justSuicide)
            {
                fgmkii.justSuicide = false;
                fgmkii.NOTSpawnNonAITitan(selection);
            }
            else
            {
                fgmkii.SpawnNonAITitan2(selection);
            }
            fgmkii.needChooseSide = false;
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[1], state: false);
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[2], state: false);
            NGUITools.SetActive(GameObject.Find("UI_IN_GAME").GetComponent <UIReferArray>().panels[3], state: false);
            IN_GAME_MAIN_CAMERA.UsingTitan = true;
            GameObject.Find("MainCamera").GetComponent <IN_GAME_MAIN_CAMERA>().SetHUDPosition();
        }
    }