示例#1
0
 public virtual void InitializeCanvas()
 {
     this.m_canvas           = CacheGameObject.GetComponent <Canvas>();
     this.m_canvasScaler     = CacheGameObject.GetComponent <CanvasScaler>();
     this.m_graphicRaycaster = CacheGameObject.GetComponent <GraphicRaycaster>();
     this.MatchScreen();
 }
示例#2
0
    private void showResult(string text0, string text1, string text2, string text3, string text4, string text6,
                            PhotonMessageInfo info)
    {
        if (info != null && !info.Sender.IsMasterClient)
        {
            Log.AddLine("RPCerror", MsgType.Error, info.Sender.ID.ToString(), nameof(showResult));
            AntisManager.Response(info.Sender.ID, true, string.Empty);
            return;
        }

        if (gameTimesUp)
        {
            return;
        }

        gameTimesUp = true;
        NGUITools.SetActive(UIRefer.panels[0], false);
        NGUITools.SetActive(UIRefer.panels[1], false);
        NGUITools.SetActive(UIRefer.panels[2], true);
        NGUITools.SetActive(UIRefer.panels[3], false);
        CacheGameObject.Find <UILabel>("LabelName").text        = text0;
        CacheGameObject.Find <UILabel>("LabelKill").text        = text1;
        CacheGameObject.Find <UILabel>("LabelDead").text        = text2;
        CacheGameObject.Find <UILabel>("LabelMaxDmg").text      = text3;
        CacheGameObject.Find <UILabel>("LabelTotalDmg").text    = text4;
        CacheGameObject.Find <UILabel>("LabelResultTitle").text = text6;
        Screen.lockCursor            = false;
        Screen.showCursor            = true;
        IN_GAME_MAIN_CAMERA.GameType = GameType.Stop;
        gameStart = false;
    }
示例#3
0
    public void netShowDamage(int speed, PhotonMessageInfo info = null)
    {
        if (info != null && !info.Sender.IsMasterClient && !info.Sender.IsTitan)
        {
            Log.AddLine("RPCerror", MsgType.Error, info.Sender.ID.ToString(), nameof(netShowDamage));
            AntisManager.Response(info.Sender.ID, true, string.Empty);
            return;
        }

        if (Stylish != null)
        {
            Stylish.Style(speed);
        }
        //CacheGameObject.Find<StylishComponent>("Stylish").Style(speed);
        var target = CacheGameObject.Find <UILabel>("LabelScore");

        if (target != null)
        {
            target.text = speed.ToString();
            target.transform.localScale = Vectors.zero;
            speed = (int)(speed * 0.1f);
            speed = Mathf.Max(40, speed);
            speed = Mathf.Min(150, speed);
            iTween.Stop(target.cachedGameObject);
            iTween.ScaleTo(target.cachedGameObject,
                           new System.Collections.Hashtable
            {
                { "x", speed }, { "y", speed }, { "z", speed }, { "easetype", iTween.EaseType.easeOutElastic }, { "time", 1f }
            });
            iTween.ScaleTo(target.cachedGameObject, itweenHash);
        }
    }
示例#4
0
    private void OnSelectionChange()
    {
        LevelInfo info = LevelInfo.GetInfo(base.GetComponent <UIPopupList>().selection);

        if (info != null)
        {
            CacheGameObject.Find("LabelLevelInfo").GetComponent <UILabel>().text = info.Description;
        }
    }
示例#5
0
 private void OnClick()
 {
     if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_AHSS)
     {
         string text = "AHSS";
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[0], true);
         FengGameManagerMKII.FGM.NeedChooseSide = false;
         if (!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.Logic.RoundTime > 60f)
         {
             FengGameManagerMKII.FGM.NOTSpawnPlayer(text);
             FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
         }
         else
         {
             FengGameManagerMKII.FGM.SpawnPlayerAt(text, "playerRespawn2");
         }
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], false);
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], false);
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], false);
         IN_GAME_MAIN_CAMERA.usingTitan = false;
         IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
         Hashtable customProperties = new Hashtable
         {
             {
                 PhotonPlayerProperty.character,
                 text
             }
         };
         PhotonNetwork.player.SetCustomProperties(customProperties);
     }
     else
     {
         if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
         {
             FengGameManagerMKII.FGM.checkpoint = CacheGameObject.Find("PVPchkPtT");
         }
         string selection = CacheGameObject.Find("PopupListCharacterTITAN").GetComponent <UIPopupList>().selection;
         NGUITools.SetActive(base.transform.parent.gameObject, false);
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[0], true);
         if ((!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.Logic.RoundTime > 60f) || FengGameManagerMKII.FGM.JustSuicide)
         {
             FengGameManagerMKII.FGM.JustSuicide = false;
             FengGameManagerMKII.FGM.NOTSpawnNonAITitan(selection);
         }
         else
         {
             FengGameManagerMKII.FGM.SpawnNonAITitan(selection, "titanRespawn");
         }
         FengGameManagerMKII.FGM.NeedChooseSide = false;
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], false);
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], false);
         NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], false);
         IN_GAME_MAIN_CAMERA.usingTitan = true;
         IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
     }
 }
示例#6
0
    public void Start()
    {
        GameObject gameObject = CacheGameObject.Find("PunSupportLogger");

        if (gameObject == null)
        {
            gameObject = new GameObject("PunSupportLogger");
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            SupportLogging supportLogging = gameObject.AddComponent <SupportLogging>();
            supportLogging.LogTrafficStats = this.LogTrafficStats;
        }
    }
示例#7
0
    private void OnClick()
    {
        string selection = CacheGameObject.Find("PopupListCharacterHUMAN").GetComponent <UIPopupList>().selection;

        NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[0], true);
        FengGameManagerMKII.FGM.needChooseSide = false;
        if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
        {
            FengGameManagerMKII.FGM.checkpoint = CacheGameObject.Find("PVPchkPtH");
        }
        if (!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.logic.RoundTime > 60f)
        {
            if (!this.isPlayerAllDead())
            {
                FengGameManagerMKII.FGM.NotSpawnPlayer(selection);
            }
            else
            {
                FengGameManagerMKII.FGM.NotSpawnPlayer(selection);
                FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
            }
        }
        else if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.BossFightCT || IN_GAME_MAIN_CAMERA.GameMode == GameMode.Trost || IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
        {
            if (this.isPlayerAllDead())
            {
                FengGameManagerMKII.FGM.NotSpawnPlayer(selection);
                FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
            }
            else
            {
                FengGameManagerMKII.FGM.SpawnPlayer(selection);
            }
        }
        else
        {
            FengGameManagerMKII.FGM.SpawnPlayer(selection);
        }
        NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], false);
        NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], false);
        NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], false);
        IN_GAME_MAIN_CAMERA.usingTitan = false;
        IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
        Hashtable customProperties = new Hashtable
        {
            {
                PhotonPlayerProperty.character,
                selection
            }
        };

        PhotonNetwork.player.SetCustomProperties(customProperties);
    }
示例#8
0
 private void OnClick()
 {
     NGUITools.SetActive(base.transform.parent.gameObject, false);
     NGUITools.SetActive(UIMainReferences.Main.PanelMultiJoinPrivate, true);
     CacheGameObject.Find("LabelJoinInfo").GetComponent <UILabel>().text = string.Empty;
     if (PlayerPrefs.HasKey("lastIP"))
     {
         CacheGameObject.Find("InputIP").GetComponent <UIInput>().label.text = PlayerPrefs.GetString("lastIP");
     }
     if (PlayerPrefs.HasKey("lastPort"))
     {
         CacheGameObject.Find("InputPort").GetComponent <UIInput>().label.text = PlayerPrefs.GetString("lastPort");
     }
 }
    private void OnClick()
    {
        string text       = CacheGameObject.Find("InputServerName").GetComponent <UIInput>().label.text;
        int    maxPlayers = int.Parse(CacheGameObject.Find("InputMaxPlayer").GetComponent <UIInput>().label.text);
        int    num        = int.Parse(CacheGameObject.Find("InputMaxTime").GetComponent <UIInput>().label.text);
        string selection  = CacheGameObject.Find("PopupListMap").GetComponent <UIPopupList>().selection;
        string text2      = (!CacheGameObject.Find("CheckboxHard").GetComponent <UICheckbox>().isChecked) ? ((!CacheGameObject.Find("CheckboxAbnormal").GetComponent <UICheckbox>().isChecked) ? "normal" : "abnormal") : "hard";
        string text3      = string.Empty;

        if (IN_GAME_MAIN_CAMERA.DayLight == DayLight.Day)
        {
            text3 = "day";
        }
        if (IN_GAME_MAIN_CAMERA.DayLight == DayLight.Dawn)
        {
            text3 = "dawn";
        }
        if (IN_GAME_MAIN_CAMERA.DayLight == DayLight.Night)
        {
            text3 = "night";
        }
        string text4 = CacheGameObject.Find("InputStartServerPWD").GetComponent <UIInput>().label.text;

        if (text4.Length > 0)
        {
            SimpleAES simpleAES = new SimpleAES();
            text4 = simpleAES.Encrypt(text4);
        }
        text = string.Concat(new object[]
        {
            text,
            "`",
            selection,
            "`",
            text2,
            "`",
            num,
            "`",
            text3,
            "`",
            text4,
            "`",
            UnityEngine.Random.Range(0, 50000)
        });
        PhotonNetwork.CreateRoom(text, new RoomOptions()
        {
            isOpen = true, isVisible = true, maxPlayers = maxPlayers
        }, null);
    }
示例#10
0
 public void OnConnectionFail(AOTEventArgs args)
 {
     print("OnConnectionFail : " + args.DisconnectCause);
     Screen.lockCursor            = false;
     Screen.showCursor            = true;
     IN_GAME_MAIN_CAMERA.GameType = GameType.Stop;
     gameStart = false;
     NGUITools.SetActive(UIRefer.panels[0], false);
     NGUITools.SetActive(UIRefer.panels[1], false);
     NGUITools.SetActive(UIRefer.panels[2], false);
     NGUITools.SetActive(UIRefer.panels[3], false);
     NGUITools.SetActive(UIRefer.panels[4], true);
     CacheGameObject.Find("LabelDisconnectInfo").GetComponent <UILabel>().text =
         "OnConnectionFail : " + args.DisconnectCause;
 }
示例#11
0
        private void SpawnHero()
        {
            CheckBoxCostume.costumeSet             = costumeSelection.ToValue() + 1;
            FengGameManagerMKII.FGM.NeedChooseSide = false;
            if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
            {
                FengGameManagerMKII.FGM.checkpoint = CacheGameObject.Find("PVPchkPtH");
            }
            if (!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.Logic.RoundTime > 60f)
            {
                if (!FengGameManagerMKII.FGM.IsPlayerAllDead())
                {
                    FengGameManagerMKII.FGM.NOTSpawnPlayer(character);
                }
                else
                {
                    FengGameManagerMKII.FGM.NOTSpawnPlayer(character);
                    FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
                }
            }
            else if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.BOSS_FIGHT_CT || IN_GAME_MAIN_CAMERA.GameMode == GameMode.TROST || IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
            {
                if (FengGameManagerMKII.FGM.IsPlayerAllDead())
                {
                    FengGameManagerMKII.FGM.NOTSpawnPlayer(character);
                    FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
                }
                else
                {
                    FengGameManagerMKII.FGM.SpawnPlayer(character);
                }
            }
            else
            {
                FengGameManagerMKII.FGM.SpawnPlayer(character);
            }
            IN_GAME_MAIN_CAMERA.usingTitan = false;
            IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
            Hashtable customProperties = new Hashtable
            {
                {
                    PhotonPlayerProperty.character,
                    character
                }
            };

            PhotonNetwork.player.SetCustomProperties(customProperties);
        }
示例#12
0
    void DoChangeFrame()
    {
        string evtName = "OnImageAnimationFrame";

#if UNITY_EDITOR
        if (Application.isPlaying)
        {
            CacheGameObject.SendMessage(evtName, this, SendMessageOptions.DontRequireReceiver);
        }
        else
        {
        }
#else
        CacheGameObject.SendMessage(evtName, this, SendMessageOptions.DontRequireReceiver);
#endif
    }
示例#13
0
    private void OnClick()
    {
        string    text      = CacheGameObject.Find("InputEnterPWD").GetComponent <UIInput>().label.text;
        SimpleAES simpleAES = new SimpleAES();

        if (text == simpleAES.Decrypt(PanelMultiJoinPWD.Password))
        {
            PhotonNetwork.JoinRoom(PanelMultiJoinPWD.roomName);
        }
        else
        {
            NGUITools.SetActive(UIMainReferences.Main.PanelMultiPWD, false);
            NGUITools.SetActive(UIMainReferences.Main.panelMultiROOM, true);
            CacheGameObject.Find("PanelMultiROOM").GetComponent <PanelMultiJoin>().refresh();
        }
    }
示例#14
0
    private void showHitDamage()
    {
        var go = CacheGameObject.Find("LabelScore");

        if (!go)
        {
            return;
        }
        speed = Mathf.Max(10f, speed);
        go.GetComponent <UILabel>().text = speed.ToString(CultureInfo.CurrentCulture); //maybe Invariant
        go.transform.localScale          = Vectors.zero;
        speed = (int)(speed * 0.1f);
        speed = Mathf.Clamp(speed, 40f, 150f);
        iTween.Stop(go);
        iTween.ScaleTo(go,
                       iTween.Hash("x", speed, "y", speed, "z", speed, "easetype", iTween.EaseType.easeOutElastic, "time", 1f));
        iTween.ScaleTo(go,
                       iTween.Hash("x", 0, "y", 0, "z", 0, "easetype", iTween.EaseType.easeInBounce, "time", 0.5f, "delay", 2f));
    }
示例#15
0
 private void SpawnTitan()
 {
     if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
     {
         FengGameManagerMKII.FGM.checkpoint = CacheGameObject.Find("PVPchkPtT");
     }
     if ((!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.Logic.RoundTime > 60f) || FengGameManagerMKII.FGM.JustSuicide)
     {
         FengGameManagerMKII.FGM.JustSuicide = false;
         FengGameManagerMKII.FGM.NOTSpawnNonAITitan(character);
     }
     else
     {
         FengGameManagerMKII.FGM.SpawnNonAITitan(character, "titanRespawn");
     }
     FengGameManagerMKII.FGM.NeedChooseSide = false;
     IN_GAME_MAIN_CAMERA.usingTitan         = true;
     IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
 }
示例#16
0
 private void showServerList()
 {
     if (PhotonNetwork.GetRoomList().Length == 0)
     {
         return;
     }
     if (this.filter == string.Empty)
     {
         for (int i = 0; i < 10; i++)
         {
             int num = 10 * (this.currentPage - 1) + i;
             if (num < PhotonNetwork.GetRoomList().Length)
             {
                 this.items[i].SetActive(true);
                 this.items[i].GetComponentInChildren <UILabel>().text = this.getServerDataString(PhotonNetwork.GetRoomList()[num]);
                 this.items[i].GetComponentInChildren <BTN_Connect_To_Server_On_List>().roomName = PhotonNetwork.GetRoomList()[num].Name;
             }
             else
             {
                 this.items[i].SetActive(false);
             }
         }
     }
     else
     {
         for (int i = 0; i < 10; i++)
         {
             int num2 = 10 * (this.currentPage - 1) + i;
             if (num2 < this.filterRoom.Count)
             {
                 RoomInfo roomInfo = (RoomInfo)this.filterRoom[num2];
                 this.items[i].SetActive(true);
                 this.items[i].GetComponentInChildren <UILabel>().text = this.getServerDataString(roomInfo);
                 this.items[i].GetComponentInChildren <BTN_Connect_To_Server_On_List>().roomName = roomInfo.Name;
             }
             else
             {
                 this.items[i].SetActive(false);
             }
         }
     }
     CacheGameObject.Find("LabelServerListPage").GetComponent <UILabel>().text = this.currentPage + "/" + this.totalPage;
 }
示例#17
0
    // Token: 0x06001644 RID: 5700 RVA: 0x000F8D60 File Offset: 0x000F6F60
    private void OnClick()
    {
        //if (!(bool)FengGameManagerMKII.settings[82])
        //{
        string text       = CacheGameObject.Find <UIInput>("InputServerName").label.text;
        int    maxPlayers = int.Parse(CacheGameObject.Find <UIInput>("InputMaxPlayer").label.text);
        int    num        = int.Parse(CacheGameObject.Find <UIInput>("InputMaxTime").label.text);
        string selection  = CacheGameObject.Find <UIPopupList>("PopupListMap").selection;
        string text2      = (!CacheGameObject.Find <UICheckbox>("CheckboxHard").isChecked) ? ((!CacheGameObject.Find <UICheckbox>("CheckboxAbnormal").isChecked) ? "normal" : "abnormal") : "hard";
        string text3      = IN_GAME_MAIN_CAMERA.dayLight.ToString().ToLower();
        string text4      = CacheGameObject.Find <UIInput>("InputStartServerPWD").label.text;

        //FengGameManagerMKII.settings[77] = ((text4 == string.Empty) ? string.Empty : ("PWD:" + text4 + "\r\n"));
        if (text4.Length > 0)
        {
            text4 = new SimpleAES().Encrypt(text4);
        }
        string roomName = string.Concat(new object[]
        {
            text,
            "`",
            selection,
            "`",
            text2,
            "`",
            num,
            "`",
            text3,
            "`",
            text4,
            "`",
            UnityEngine.Random.Range(0, 50000)
        });
        RoomOptions roomOptions = new RoomOptions
        {
            isVisible  = true,
            isOpen     = true,
            maxPlayers = maxPlayers
        };

        PhotonNetwork.CreateRoom(roomName, roomOptions, null);
        //}
    }
示例#18
0
    private void OnClick()
    {
        string selection  = CacheGameObject.Find("PopupListMap").GetComponent <UIPopupList>().selection;
        string selection2 = CacheGameObject.Find("PopupListCharacter").GetComponent <UIPopupList>().selection;
        int    difficulty = (!CacheGameObject.Find("CheckboxHard").GetComponent <UICheckbox>().isChecked) ? ((!CacheGameObject.Find("CheckboxAbnormal").GetComponent <UICheckbox>().isChecked) ? 0 : 2) : 1;

        IN_GAME_MAIN_CAMERA.Difficulty      = difficulty;
        IN_GAME_MAIN_CAMERA.GameType        = GameType.Single;
        IN_GAME_MAIN_CAMERA.singleCharacter = selection2.ToUpper();
        if (IN_GAME_MAIN_CAMERA.CameraMode == CameraType.TPS)
        {
            Screen.lockCursor = true;
        }
        Screen.showCursor = false;
        if (selection == "trainning_0")
        {
            IN_GAME_MAIN_CAMERA.Difficulty = -1;
        }
        FengGameManagerMKII.Level = LevelInfo.GetInfo(selection);
        Application.LoadLevel(LevelInfo.GetInfo(selection).MapName);
    }
示例#19
0
 private void SpawnHero()
 {
     CheckBoxCostume.costumeSet             = costumeSelection.ToValue() + 1;
     FengGameManagerMKII.FGM.needChooseSide = false;
     if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
     {
         FengGameManagerMKII.FGM.checkpoint = CacheGameObject.Find("PVPchkPtH");
     }
     if (!PhotonNetwork.IsMasterClient && FengGameManagerMKII.FGM.logic.RoundTime > 60f)
     {
         if (!FengGameManagerMKII.IsPlayerAllDead())
         {
             FengGameManagerMKII.FGM.NotSpawnPlayer(character);
         }
         else
         {
             FengGameManagerMKII.FGM.NotSpawnPlayer(character);
             FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
         }
     }
     else if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.BossFightCT || IN_GAME_MAIN_CAMERA.GameMode == GameMode.Trost || IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
     {
         if (FengGameManagerMKII.IsPlayerAllDead())
         {
             FengGameManagerMKII.FGM.NotSpawnPlayer(character);
             FengGameManagerMKII.FGM.BasePV.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]);
         }
         else
         {
             FengGameManagerMKII.FGM.SpawnPlayer(character);
         }
     }
     else
     {
         FengGameManagerMKII.FGM.SpawnPlayer(character);
     }
     IN_GAME_MAIN_CAMERA.usingTitan = false;
     IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
     PhotonNetwork.player.Character = character;
 }
示例#20
0
    public void Show(bool force = true)
    {
        CacheGameObject.SetActive(true);

        if (force)
        {
            Transform parent = CacheGameObject.transform.parent;
            do
            {
                if (parent == null)
                {
                    break;
                }
                parent.gameObject.SetActive(true);
                parent = parent.parent;
            } while (CacheGameObject.activeInHierarchy == false);
        }

        // 다른 UI들보다 먼저 보이도록 하이어라키 가장 아래로 내리자.
        CacheGameObject.transform.SetAsLastSibling();

        OnShow();
    }
示例#21
0
 /// <summary>
 /// 顺序播放动画 延迟
 /// </summary>
 public override void PlayForwardDelay()
 {
     CacheGameObject.SetActive(true);
     Play(from, to);
 }
示例#22
0
文件: BaseUI.cs 项目: RSNDM/TestUnity
 /// <summary>
 /// 显示当前UI
 /// </summary>
 /// <param name="param">附加参数</param>
 public void Show(object param=null)
 {
     CacheGameObject.SetActive(true);
 }
示例#23
0
    private void OnLevelWasLoaded(int level)
    {
        if (level == 0)
        {
            return;
        }

        if (Application.loadedLevelName == "characterCreation" || Application.loadedLevelName == "SnapShot")
        {
            return;
        }

        var array = GameObject.FindGameObjectsWithTag("titan");

        foreach (var go in array)
        {
            if (go.GetPhotonView() == null || !go.GetPhotonView().owner.IsMasterClient)
            {
                Destroy(go);
            }
        }

        gameStart = true;
        Pool.Clear();
        RespawnPositions.Dispose();
        ShowHUDInfoCenter(string.Empty);
        var gameObject2 = (GameObject)Instantiate(CacheResources.Load("MainCamera_mono"),
                                                  CacheGameObject.Find("cameraDefaultPosition").transform.position,
                                                  CacheGameObject.Find("cameraDefaultPosition").transform.rotation);

        Destroy(CacheGameObject.Find("cameraDefaultPosition"));
        gameObject2.name  = "MainCamera";
        Screen.lockCursor = true;
        Screen.showCursor = true;
        var ui = (GameObject)Instantiate(CacheResources.Load("UI_IN_GAME"));

        ui.name = "UI_IN_GAME";
        ui.SetActive(true);
        UIRefer = ui.GetComponent <UIReferArray>();
        NGUITools.SetActive(UIRefer.panels[0], true);
        NGUITools.SetActive(UIRefer.panels[1], false);
        NGUITools.SetActive(UIRefer.panels[2], false);
        NGUITools.SetActive(UIRefer.panels[3], false);
        IN_GAME_MAIN_CAMERA.MainCamera.setHUDposition();
        IN_GAME_MAIN_CAMERA.MainCamera.setDayLight(IN_GAME_MAIN_CAMERA.DayLight);
        var info = Level;

        ClothFactory.ClearClothCache();
        logic.OnGameRestart();
        PlayerList = new PlayerList();
        if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
        {
            LoadSkinCheck();
            CustomLevel.OnLoadLevel();
            singleKills = 0;
            singleMax   = 0;
            singleTotal = 0;
            IN_GAME_MAIN_CAMERA.MainCamera.enabled = true;
            IN_GAME_MAIN_CAMERA.SpecMov.disable    = true;
            IN_GAME_MAIN_CAMERA.Look.disable       = true;
            IN_GAME_MAIN_CAMERA.GameMode           = Level.Mode;
            SpawnPlayer(IN_GAME_MAIN_CAMERA.singleCharacter.ToUpper());
            Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
            Screen.showCursor = false;
            var rate = 90;
            if (difficulty == 1)
            {
                rate = 70;
            }

            SpawnTitansCustom(rate, info.EnemyNumber);
            return;
        }

        PVPcheckPoint.chkPts = new ArrayList();
        IN_GAME_MAIN_CAMERA.MainCamera.enabled = false;
        IN_GAME_MAIN_CAMERA.BaseCamera.GetComponent <CameraShake>().enabled = false;
        IN_GAME_MAIN_CAMERA.GameType = GameType.MultiPlayer;
        LoadSkinCheck();
        CustomLevel.OnLoadLevel();
        switch (info.Mode)
        {
        case GameMode.Trost:
        {
            CacheGameObject.Find("playerRespawn").SetActive(false);
            Destroy(CacheGameObject.Find("playerRespawn"));
            var gameObject3 = CacheGameObject.Find("rock");
            gameObject3.animation["lift"].speed = 0f;
            CacheGameObject.Find("door_fine").SetActive(false);
            CacheGameObject.Find("door_broke").SetActive(true);
            Destroy(CacheGameObject.Find("ppl"));
            break;
        }

        case GameMode.BossFightCT:
            CacheGameObject.Find("playerRespawnTrost").SetActive(false);
            Destroy(CacheGameObject.Find("playerRespawnTrost"));
            break;
        }

        if (needChooseSide)
        {
            ShowHUDInfoTopCenterADD("\n\nPRESS 1 TO ENTER GAME");
        }
        else
        {
            Screen.lockCursor = IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS;
            if (IN_GAME_MAIN_CAMERA.GameMode == GameMode.PVP_CAPTURE)
            {
                if ((int)PhotonNetwork.player.Properties[PhotonPlayerProperty.isTitan] == 2)
                {
                    checkpoint = CacheGameObject.Find("PVPchkPtT");
                }
                else
                {
                    checkpoint = CacheGameObject.Find("PVPchkPtH");
                }
            }

            if ((int)PhotonNetwork.player.Properties[PhotonPlayerProperty.isTitan] == 2)
            {
                SpawnNonAiTitan(myLastHero);
            }
            else
            {
                SpawnPlayer(myLastHero);
            }
        }

        if (info.Mode == GameMode.BossFightCT)
        {
            Destroy(CacheGameObject.Find("rock"));
        }

        if (PhotonNetwork.IsMasterClient)
        {
            switch (info.Mode)
            {
            case GameMode.Trost:
            {
                if (!IsPlayerAllDead())
                {
                    var gameObject4 = Pool.NetworkEnable("TITAN_EREN_trost", new Vector3(-200f, 0f, -194f),
                                                         Quaternion.Euler(0f, 180f, 0f));
                    gameObject4.GetComponent <TITAN_EREN>().rockLift = true;
                    var rate2 = 90;
                    if (difficulty == 1)
                    {
                        rate2 = 70;
                    }

                    var array3      = GameObject.FindGameObjectsWithTag("titanRespawn");
                    var gameObject5 = CacheGameObject.Find("titanRespawnTrost");
                    if (gameObject5 != null)
                    {
                        foreach (var gameObject6 in array3)
                        {
                            if (gameObject6.transform.parent.gameObject == gameObject5)
                            {
                                SpawnTitan(rate2, gameObject6.transform.position, gameObject6.transform.rotation);
                            }
                        }
                    }
                }

                break;
            }

            case GameMode.BossFightCT:
            {
                if (!IsPlayerAllDead())
                {
                    Pool.NetworkEnable("COLOSSAL_TITAN", -Vectors.up * 10000f, Quaternion.Euler(0f, 180f, 0f));
                }

                break;
            }

            case GameMode.KillTitan:
            case GameMode.EndlessTitan:
            case GameMode.SurviveMode:
            {
                if (info.Name == "Annie" || info.Name == "Annie II")
                {
                    Pool.NetworkEnable("FEMALE_TITAN", CacheGameObject.Find("titanRespawn").transform.position,
                                       CacheGameObject.Find("titanRespawn").transform.rotation);
                }
                else
                {
                    var rate3 = 90;
                    if (difficulty == 1)
                    {
                        rate3 = 70;
                    }

                    SpawnTitansCustom(rate3, info.EnemyNumber);
                }

                break;
            }

            default:
            {
                if (info.Mode != GameMode.Trost)
                {
                    if (info.Mode == GameMode.PVP_CAPTURE && Level.MapName == "OutSide")
                    {
                        var array5 = GameObject.FindGameObjectsWithTag("titanRespawn");
                        if (array5.Length <= 0)
                        {
                            return;
                        }

                        for (var k = 0; k < array5.Length; k++)
                        {
                            SpawnTitanRaw(array5[k].transform.position, array5[k].transform.rotation)
                            .SetAbnormalType(AbnormalType.Crawler, true);
                        }
                    }
                }

                break;
            }
            }
        }

        if (!info.Supply)
        {
            Destroy(CacheGameObject.Find("aot_supply"));
        }

        if (!PhotonNetwork.IsMasterClient)
        {
            BasePV.RPC("RequireStatus", PhotonTargets.MasterClient);
        }

        if (Stylish != null)
        {
            Stylish.enabled = true;
        }

        if (Level.LavaMode)
        {
            Instantiate(CacheResources.Load("levelBottom"), new Vector3(0f, -29.5f, 0f), Quaternion.Euler(0f, 0f, 0f));
            CacheGameObject.Find("aot_supply").transform.position =
                CacheGameObject.Find("aot_supply_lava_position").transform.position;
            CacheGameObject.Find("aot_supply").transform.rotation =
                CacheGameObject.Find("aot_supply_lava_position").transform.rotation;
        }

        if (GameModes.BombMode.Enabled)
        {
            if (Level.Name.StartsWith("The Forest"))
            {
                // Added the creation of an empty gameobject with MapCeilingObject as a component - Thyme 02/28/21
                GameObject mapCeiling = new GameObject("MapCeilingPrefab");
                mapCeiling.AddComponent <TLW.MapCeiling>();
                mapCeiling.transform.position   = new Vector3(0f, 280f, 0f);
                mapCeiling.transform.rotation   = Quaternion.identity;
                mapCeiling.transform.localScale = new Vector3(1320f, 20f, 1320f);
            }
            else if (Level.Name.StartsWith("The City"))
            {
                GameObject mapCeiling = new GameObject("MapCeilingPrefab");
                mapCeiling.AddComponent <TLW.MapCeiling>();
                mapCeiling.transform.position   = new Vector3(0f, 210f, 0f);
                mapCeiling.transform.rotation   = Quaternion.identity;
                mapCeiling.transform.localScale = new Vector3(1400f, 20f, 1400f);
            }
        }

        roomInformation.UpdateLabels();
        Resources.UnloadUnusedAssets();
    }
示例#24
0
    override protected void OnDisable()
    {
        base.OnDisable();

        UIStackManager.PopUiStack(CacheGameObject.GetInstanceID());
    }
示例#25
0
文件: Entry.cs 项目: onelei/LemonTS
 private void Awake()
 {
     CacheGameObject.AddComponent <DontDestroyOnLoad>();
 }
示例#26
0
文件: BaseUI.cs 项目: RSNDM/TestUnity
 /// <summary>
 /// 隐藏当前界面
 /// </summary>
 public void Hide()
 {
     CacheGameObject.SetActive(false);
 }
示例#27
0
 /// <summary>
 /// 倒序播放动画 延迟
 /// </summary>
 public override void PlayReverseDelay()
 {
     CacheGameObject.SetActive(true);
     Play(to, from);
 }
示例#28
0
    // Token: 0x06001643 RID: 5699 RVA: 0x0000FDC4 File Offset: 0x0000DFC4

    void Start()
    {
        CacheGameObject.Find <UIInput>("InputMaxTime").label.text = "9999";
    }
示例#29
0
    private void Start()
    {
        FengGameManagerMKII.FGM.AddCT(this);
        if (this.myHero == null)
        {
            this.findNearestHero();
        }
        size           = 20f;
        base.name      = "COLOSSAL_TITAN";
        this.NapeArmor = 1000;
        bool flag = false;

        if (FengGameManagerMKII.Level.RespawnMode == RespawnMode.NEVER)
        {
            flag = true;
        }
        if (IN_GAME_MAIN_CAMERA.Difficulty == 0)
        {
            this.NapeArmor = ((!flag) ? 5000 : 2000);
        }
        else if (IN_GAME_MAIN_CAMERA.Difficulty == 1)
        {
            this.NapeArmor = ((!flag) ? 8000 : 3500);
            foreach (object obj in base.animation)
            {
                AnimationState animationState = (AnimationState)obj;
                animationState.speed = 1.02f;
            }
        }
        else if (IN_GAME_MAIN_CAMERA.Difficulty == 2)
        {
            this.NapeArmor = ((!flag) ? 12000 : 5000);
            foreach (object obj2 in base.animation)
            {
                AnimationState animationState2 = (AnimationState)obj2;
                animationState2.speed = 1.05f;
            }
        }
        this.NapeArmorTotal = this.NapeArmor;
        this.state          = "wait";
        baseT.position     += -Vectors.up * 10000f;
        if (FengGameManagerMKII.LAN)
        {
            base.GetComponent <PhotonView>().enabled = false;
        }
        else
        {
            base.GetComponent <NetworkView>().enabled = false;
        }
        this.door_broken = CacheGameObject.Find("door_broke");
        this.door_closed = CacheGameObject.Find("door_fine");
        this.door_broken.SetActive(false);
        this.door_closed.SetActive(true);
        Minimap.TrackGameObjectOnMinimap(gameObject, Color.black, false, true, Minimap.IconStyle.Circle);
        if (BasePV.IsMine)
        {
            if (GameModes.SizeMode.Enabled)
            {
                size = UnityEngine.Random.Range(GameModes.SizeMode.GetFloat(0), GameModes.SizeMode.GetFloat(1));
                BasePV.RPC("setSize", PhotonTargets.AllBuffered, new object[] { size });
            }
            if (GameModes.HealthMode.Enabled)
            {
                int healthLower = GameModes.HealthMode.GetInt(0);
                int healthUpper = GameModes.HealthMode.GetInt(1) + 1;
                if (GameModes.HealthMode.Selection == 1)
                {
                    maxHealth = (NapeArmor = UnityEngine.Random.Range(healthLower, healthUpper));
                }
                else if (GameModes.HealthMode.Selection == 2)
                {
                    maxHealth = (NapeArmor = Mathf.Clamp(Mathf.RoundToInt(size / 4f * (float)UnityEngine.Random.Range(healthLower, healthUpper)), healthLower, healthUpper));
                }
            }
            else
            {
                maxHealth = NapeArmor;
            }
            this.lagMax     = 150f + size * 3f;
            this.healthTime = 0f;
            if (NapeArmor > 0 && IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
            {
                BasePV.RPC("labelRPC", PhotonTargets.AllBuffered, new object[] { NapeArmor, Mathf.RoundToInt(maxHealth) });
            }
            LoadSkin();
        }
        spawned = true;
    }
示例#30
0
 private void OnClick()
 {
     CacheGameObject.Find("PanelMultiROOM").GetComponent <PanelMultiJoin>().pageDown();
 }