示例#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 }
        });
    }
示例#2
0
    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();
        }
    }
示例#3
0
    public bool cmd(string[] args, FengGameManagerMKII gm)
    {
        if (args.Length == 0)
        {
            FieldInfo lastCharacterField = gm.GetType().GetField("myLastHero", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase);
            ModMain.instance.log("MyLastHero: " + lastCharacterField.GetValue(gm));

            gm.SpawnPlayer((string)lastCharacterField.GetValue(gm), "playerRespawn");
            return(true);
        }
        else if (args[0].Equals("*"))
        {
            ModMain.instance.getGameManager().photonView.RPC("respawnHeroInNewRound", PhotonTargets.All, new object[0]);
            return(true);
        }
        else
        {
            PhotonPlayer target = null;
            foreach (PhotonPlayer p in PhotonNetwork.playerList)
            {
                if ("" + p.ID == args[0])
                {
                    target = p;
                    break;
                }
            }

            if (target != null)
            {
                gm.photonView.RPC("respawnHeroInNewRound", target, new object[0]);
                return(true);
            }

            return(false);
        }
    }