UnityEngine.GameObject.SetActive(bool)

Here are the examples of the csharp api UnityEngine.GameObject.SetActive(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

901 Examples 7

19 View Source File : PanelMultiJoin.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void connectToIndex(int index, string roomName)
    {
        int i;
        for (i = 0; i < 10; i++)
        {
            this.items[i].SetActive(false);
        }
        i = 10 * (this.currentPage - 1) + index;
        string[] array = roomName.Split(new char[]
        {
            "`"[0]
        });
        if (array[5] != string.Empty)
        {
            PanelMultiJoinPWD.Preplacedword = array[5];
            PanelMultiJoinPWD.roomName = roomName;
            NGUITools.SetActive(UIMainReferences.Main.PanelMultiPWD, true);
            NGUITools.SetActive(UIMainReferences.Main.panelMultiROOM, false);
        }
        else
        {
            PhotonNetwork.JoinRoom(roomName);
        }
    }

19 View Source File : ModeSelectionViewController.cs
License : MIT License
Project Creator : andruzzzhka

private void ModelSaberAPI_hashesCalculated()
        {
            _missingFilesRect.gameObject.SetActive(_filesMising);
            _buttonsRect.gameObject.SetActive(!_filesMising);
            _avatarsLoadingRect.gameObject.SetActive(false);
            
            AvatarController.LoadAvatars();
        }

19 View Source File : PanelGroupManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void ActivePanel(int index)
    {
        foreach (GameObject gameObject in this.panelGroup)
        {
            gameObject.SetActive(false);
        }
        this.panelGroup[index].SetActive(true);
    }

19 View Source File : Xffect.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void DeActive()
    {
        foreach (object obj in base.transform)
        {
            Transform transform = (Transform)obj;
            transform.gameObject.SetActive(false);
        }
        base.gameObject.SetActive(false);
    }

19 View Source File : PoolObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private GameObject CreateObject(string name)
        {
            Object resource = name.StartsWith("RCreplacedet/") ? CacheResources.RCLoad(name) : CacheResources.Load(name);
            if (resource == null)
            {
                throw new System.Exception($"PoolObject.CreateObject(): Cannot find Resource with name \"{name}\". Please check Keys for values.");
            }
            GameObject res = (GameObject)Object.Instantiate(resource);
            res.AddComponent<PoolableObject>();
            //Object.DontDestroyOnLoad(res);
            res.SetActive(false);
            return res;
        }

19 View Source File : KillInfoComponent.cs
License : GNU General Public License v3.0
Project Creator : aelariane

protected internal void Show(bool isreplacedan1, string name1, bool isreplacedan2, string name2, int dmg = 0)
    {
        this.groupBig.SetActive(true);
        this.groupSmall.SetActive(true);
        if (!isreplacedan1)
        {
            this.leftreplacedan.SetActive(false);
            this.spriteSkeleton.SetActive(false);
            this.sleftreplacedan.SetActive(false);
            this.sspriteSkeleton.SetActive(false);
            this.labelNameLeft.transform.position += new Vector3(18f, 0f, 0f);
            this.slabelNameLeft.transform.position += new Vector3(16f, 0f, 0f);
        }
        else
        {
            this.spriteSword.SetActive(false);
            this.sspriteSword.SetActive(false);
            this.labelNameRight.transform.position -= new Vector3(18f, 0f, 0f);
            this.slabelNameRight.transform.position -= new Vector3(16f, 0f, 0f);
        }
        if (!isreplacedan2)
        {
            this.rightreplacedan.SetActive(false);
            this.srightreplacedan.SetActive(false);
        }
        this.NameLeftUILabel.text = name1;
        this.NameRightUILabel.text = name2;
        this.sNameLeftUILabel.text = name1;
        this.sNameRightUILabel.text = name2;
        if (dmg == 0)
        {
            this.ScoreUILabel.text = string.Empty;
            this.sScoreUILabel.text = string.Empty;
        }
        else
        {
            this.ScoreUILabel.text = dmg.ToString();
            this.sScoreUILabel.text = dmg.ToString();
            if (dmg > 1000)
            {
                this.ScoreUILabel.color = Color.red;
                this.sScoreUILabel.color = Color.red;
            }
        }
        this.groupSmall.SetActive(false);
    }

19 View Source File : UI.cs
License : GNU General Public License v3.0
Project Creator : AndrasMumm

public static void Prefix(ref UIDate __instance, ref string monthStr)
        {
            monthStr = monthStr + ".";

            //Getting child 0, which is the RectTransform
            RectTransform UI_Date_rectTransform = __instance.gameObject.transform.GetChild(0) as RectTransform;

            //Getting the Date_BG which is the first child again (Index 0)
            RectTransform dateBG_rectTransform = UI_Date_rectTransform.gameObject.transform.GetChild(0) as RectTransform;

            //Here now we can get the Unit(child 0),Year (child 1), YearUnit(child 2) Month(child 3) and monthUnit(child 4)
            RectTransform unit = dateBG_rectTransform.gameObject.transform.GetChild(0) as RectTransform;
            RectTransform year = dateBG_rectTransform.gameObject.transform.GetChild(1) as RectTransform;
            RectTransform yearUnit = dateBG_rectTransform.gameObject.transform.GetChild(2) as RectTransform;
            RectTransform month = dateBG_rectTransform.gameObject.transform.GetChild(3) as RectTransform;
            RectTransform monthUnit = dateBG_rectTransform.gameObject.transform.GetChild(4) as RectTransform;

            //Disabling "Unit" since we do not need it in English
            unit.localPosition = new Vector3(0, 0, 0);
            unit.gameObject.SetActive(false);
            //Moving the Unit/Year/YearUnit/Month/monthUnit to hardcoded positions that look good
            year.localPosition = new Vector3(-60f, 41.5f, 0f);
            yearUnit.localPosition = new Vector3(-20f, 41.5f, 0);
            yearUnit.sizeDelta = new Vector2(70f, 50f);
            month.localPosition = new Vector3(35f, 41.5f, 0f);
            monthUnit.localPosition = new Vector3(86f, 41.5f, 0);
            monthUnit.sizeDelta = new Vector2(70f, 50f);

            //Lastly we overwrite the text they contain
            unit.gameObject.GetComponent<UnityEngine.UI.Text>().text = "";
            UnityEngine.UI.Text YearUnitText = yearUnit.gameObject.GetComponent<UnityEngine.UI.Text>();
            YearUnitText.text = "Year";
            YearUnitText.fontSize = 28;
            UnityEngine.UI.Text monthUnitText = monthUnit.gameObject.GetComponent<UnityEngine.UI.Text>();
            monthUnitText.text = "Month";
            monthUnitText.fontSize = 28;
        }

19 View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218

public void ClearIcon()
		{
			// Check if the icon graphic valid
			if (this.iconGraphic == null)
				return;
			
			// In case of image
			if (this.iconGraphic is Image)
				(this.iconGraphic as Image).sprite = null;
			
			// In case of raw image
			if (this.iconGraphic is RawImage)
				(this.iconGraphic as RawImage).texture = null;
			
			// Disable the game object
			this.iconGraphic.gameObject.SetActive(false);
		}

19 View Source File : PlayerInfoDisplay.cs
License : MIT License
Project Creator : andruzzzhka

public void UpdatePlayerInfo(PlayerScore _info, int _index)
        {
            _playerScore = _info;

            if (_playerScore != default && _info.valid)
            {
                playerPlaceText.text = (_index + 1).ToString();
                playerNameText.text = _playerScore.name;
                playerNameText.color = _playerScore.color;
                _previousScore = _currentScore;
                _currentScore = _playerScore.score;
                playerSpeakerIcon.gameObject.SetActive(InGameOnlineController.Instance.VoiceChatIsTalking(_playerScore.id));
                _progress = 0;
                playerNameText.color = _info.color;
            }
            else
            {
                playerPlaceText.text = "";
                playerNameText.text = "";
                playerScoreText.text = "";
                playerSpeakerIcon.gameObject.SetActive(false);
            }
        }

19 View Source File : ModifyGameItem.cs
License : GNU General Public License v3.0
Project Creator : a2659802

private void OnTriggerEnter2D(Collider2D collider)
            {
                if(collider.gameObject.GetComponent<HazardRespawnTrigger>() == null)
                {
                    //Logger.LogDebug("not respawn box");
                    return;
                }
                collider.gameObject.SetActive(false);
                Logger.LogDebug($"Disable respawn Trigger {collider.gameObject.name}");
                col.enabled = false;
            }

19 View Source File : ShowInfoOfPlayer.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Update()
    {
        if (this.DisableOnOwnObjects)
        {
            base.enabled = false;
            if (this.textGo != null)
            {
                this.textGo.SetActive(false);
            }
            return;
        }
        PhotonPlayer owner = BasePV.owner;
        if (owner != null)
        {
            this.tm.text = ((!string.IsNullOrEmpty(owner.FriendName)) ? owner.FriendName : "n/a");
        }
        else if (BasePV.isSceneView)
        {
            if (!this.DisableOnOwnObjects && BasePV.IsMine)
            {
                base.enabled = false;
                this.textGo.SetActive(false);
                return;
            }
            this.tm.text = "scn";
        }
        else
        {
            this.tm.text = "n/a";
        }
    }

19 View Source File : PoolObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public T Enable<T>(string name, Vector3 position, Quaternion rotation) where T : Component
        {
            GameObject go = PickObject(name);
            T result = go.GetComponent<T>();
            if (result == null)
            {
                throw new System.Exception($"PoolObject.Enable<{typeof(T).Name}>(): Required Component does not exists on template with name \"{name}\"");
            }
            if (go.transform != null)
            {
                go.transform.position = position;
                go.transform.rotation = rotation;
            }
            go.SetActive(true);
            return result;
        }

19 View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane

[RPC]
    private void changeDoor()
    {
        this.door_broken.SetActive(true);
        this.door_closed.SetActive(false);
    }

19 View Source File : XffectCache.cs
License : GNU General Public License v3.0
Project Creator : aelariane

protected Transform AddObject(string name)
    {
        Transform transform = base.transform.Find(name);
        if (transform == null)
        {
            Debug.Log("object:" + name + "doesn't exist!");
            return null;
        }
        Transform transform2 = UnityEngine.Object.Instantiate(transform, Vectors.zero, Quaternion.idenreplacedy) as Transform;
        this.ObjectDic[name].Add(transform2);
        transform2.gameObject.SetActive(false);
        Xffect component = transform2.GetComponent<Xffect>();
        if (component != null)
        {
            component.Initialize();
        }
        return transform2;
    }

19 View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218

public void SetIcon(Sprite iconSprite)
		{
			// Check if the icon graphic valid image
			if (this.iconGraphic == null || !(this.iconGraphic is Image))
				return;
			
			// Set the sprite
			(this.iconGraphic as Image).sprite = iconSprite;
			
			// Enable or disabled the icon graphic game object
			if (iconSprite != null && !this.iconGraphic.gameObject.activeSelf) this.iconGraphic.gameObject.SetActive(true);
			if (iconSprite == null && this.iconGraphic.gameObject.activeSelf) this.iconGraphic.gameObject.SetActive(false);
		}

19 View Source File : XWeaponTrail.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void Deactivate()
        {
            gameObject.SetActive(false);
            if (mMeshObj != null)
            {
                mMeshObj.SetActive(false);
            }
        }

19 View Source File : RacingLogic.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void TryDestroyDoors()
        {
            GameObject obj = GameObject.Find("door");
            if (obj != null)
            {
                obj.SetActive(false);
            }
            if (CustomLevel.racingDoors != null && CustomLevel.customLevelLoaded)
            {
                foreach (GameObject gameObject in CustomLevel.racingDoors)
                {
                    gameObject.SetActive(false);
                }
                CustomLevel.racingDoors = null;
            }
        }

19 View Source File : BeatSaverVotingInterop.cs
License : MIT License
Project Creator : andruzzzhka

public static void Hide()
        {
            if(votingUIHost != null)
                votingUIHost.gameObject.SetActive(false);
        }

19 View Source File : UIFunCtrl.cs
License : Apache License 2.0
Project Creator : 365082218

public void SetClicked(bool act)
    {
        NewButton.gameObject.SetActive(!act);
    }

19 View Source File : PlayerInfoDisplay.cs
License : MIT License
Project Creator : andruzzzhka

public void UpdatePlayerInfo(PlayerScore _info, int _index)
        {
            _playerScore = _info;

            if (_playerScore != default && _info.valid)
            {
                playerPlaceText.text = (_index + 1).ToString();
                playerNameText.text = _playerScore.name;
                playerNameText.color = _playerScore.color;
                _previousScore = _currentScore;
                _currentScore = _playerScore.score;
                playerSpeakerIcon.gameObject.SetActive(InGameOnlineController.Instance.VoiceChatIsTalking(_playerScore.id));
                _progress = 0;
                playerNameText.color = _info.color;
            }
            else
            {
                playerPlaceText.text = "";
                playerNameText.text = "";
                playerScoreText.text = "";
                playerSpeakerIcon.gameObject.SetActive(false);
            }
        }

19 View Source File : PanelMultiJoin.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        for (int i = 0; i < 10; i++)
        {
            this.items[i].SetActive(true);
            this.items[i].GetComponentInChildren<UILabel>().text = string.Empty;
            this.items[i].SetActive(false);
        }
    }

19 View Source File : NGUITools.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void SetActiveSelf(GameObject go, bool state)
    {
        go.SetActive(state);
    }

19 View Source File : UILoadingBar_OverlayFinish.cs
License : Apache License 2.0
Project Creator : 365082218

public void OnBarFillChange(float amount)
		{
			// Calculate the bar fill based on it's width and value
			float fillWidth = ((float)this.bar.imageComponent.rectTransform.rect.width * this.bar.imageComponent.fillAmount);
			
			// Check if the fill width is too small to bother with the ending
			if (fillWidth <= (1f + (float)this.offset))
			{
				this.targetImage.gameObject.SetActive(false);
				return;
			}
			else if (!this.targetImage.gameObject.activeSelf)
			{
				// Re-enable
				this.targetImage.gameObject.SetActive(true);
			}
			
			// Position the ending at the end of the fill
			this.targetImage.rectTransform.ancreplaceddPosition = new Vector2(
				(this.offset + fillWidth), 
				this.targetImage.rectTransform.ancreplaceddPosition.y
			);
			
			// Check if the fill width is too great to handle the ending width
			if (fillWidth < this.defaultFinishWidth)
			{
				// Change the width to the fill width
				this.targetImage.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Mathf.Round(fillWidth));
			}
			else if (this.targetImage.rectTransform.rect.width != this.defaultFinishWidth)
			{
				// Restore default width
				this.targetImage.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, this.defaultFinishWidth);
			}
			
			// Show / Hide the finish
			if (this.autoVisibility)
			{
				// Check if the finish needs the be shown
				if (this.bar.imageComponent.fillAmount >= this.showAfterPct && this.bar.imageComponent.fillAmount < this.hideAfterPct)
				{
					// Fade in if not 100%
					if (this.fading)
					{
						FloatTween floatTween = new FloatTween { duration = this.fadeDuration, startFloat = this.canvasGroup.alpha, targetFloat = this.defaultFinishAlpha };
						floatTween.AddOnChangedCallback(SetFinishAlpha);
						floatTween.ignoreTimeScale = true;
						this.m_FloatTweenRunner.StartTween(floatTween);
					}
					else
						this.SetFinishAlpha(this.defaultFinishAlpha);
				}
				else if (this.bar.imageComponent.fillAmount >= this.hideAfterPct || this.bar.imageComponent.fillAmount < this.showAfterPct)
				{
					// Fade out at 100%
					if (this.fading)
					{
						FloatTween floatTween = new FloatTween { duration = this.fadeDuration, startFloat = this.canvasGroup.alpha, targetFloat = 0f };
						floatTween.AddOnChangedCallback(SetFinishAlpha);
						floatTween.ignoreTimeScale = true;
						this.m_FloatTweenRunner.StartTween(floatTween);
					}
					else
						this.SetFinishAlpha(0f);
				}
			}
		}

19 View Source File : PoolObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public GameObject Enable(string name, Vector3 position, Quaternion rotation)
        {
            GameObject res = PickObject(name);
            if (res.transform != null)
            {
                res.transform.position = position;
                res.transform.rotation = rotation;
            }
            res.SetActive(true);
            return res;
        }

19 View Source File : SpectateCommand.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void EnterSpecMode(bool enter)
        {
            if (enter)
            {
                spectateSprites = new List<GameObject>();
                UnityEngine.Object[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject));
                for (int i = 0; i < array.Length; i++)
                {
                    GameObject gameObject = (GameObject)array[i];
                    if (!(gameObject.GetComponent<UISprite>() != null) || !gameObject.activeInHierarchy)
                    {
                        continue;
                    }
                    string text = gameObject.name;
                    if (text.Contains("blade") || text.Contains("bullet") || text.Contains("gas") || text.Contains("flare") || text.Contains("skill_cd"))
                    {
                        if (!spectateSprites.Contains(gameObject))
                        {
                            spectateSprites.Add(gameObject);
                        }
                        gameObject.SetActive(value: false);
                    }
                }
                string[] array2 = new string[2]
                {
                "Flare",
                "LabelInfoBottomRight"
                };
                string[] array3 = array2;
                foreach (string text2 in array3)
                {
                    GameObject gameObject2 = GameObject.Find(text2);
                    if (gameObject2 != null)
                    {
                        if (!spectateSprites.Contains(gameObject2))
                        {
                            spectateSprites.Add(gameObject2);
                        }
                        gameObject2.SetActive(value: false);
                    }
                }
                foreach (HERO player in FengGameManagerMKII.Heroes)
                {
                    if (player.BasePV.IsMine)
                    {
                        PhotonNetwork.Destroy(player.BasePV);
                    }
                }
                if (PhotonNetwork.player.Isreplacedan && !PhotonNetwork.player.Dead)
                {
                    foreach (replacedAN replacedan in FengGameManagerMKII.replacedans)
                    {
                        if (replacedan.BasePV.IsMine)
                        {
                            PhotonNetwork.Destroy(replacedan.BasePV);
                        }
                    }
                }
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], state: false);
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], state: false);
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], state: false);
                FengGameManagerMKII.FGM.needChooseSide = false;
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().enabled = true;
                if (IN_GAME_MAIN_CAMERA.CameraMode == CameraType.ORIGINAL)
                {
                    Screen.lockCursor = false;
                    Screen.showCursor = false;
                }
                GameObject gameObject3 = GameObject.FindGameObjectWithTag("Player");
                if (gameObject3 != null && gameObject3.GetComponent<HERO>() != null)
                {
                    Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(gameObject3.GetComponent<HERO>());
                }
                else
                {
                    Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(null);
                }
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().setSpectorMode(val: false);
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().gameOver = true;
            }
            else
            {
                if (GameObject.Find("cross1") != null)
                {
                    GameObject.Find("cross1").transform.localPosition = Vector3.up * 5000f;
                }
                if (spectateSprites != null)
                {
                    foreach (GameObject spectateSprite in spectateSprites)
                    {
                        if (spectateSprite != null)
                        {
                            spectateSprite.SetActive(value: true);
                        }
                    }
                }
                spectateSprites = new List<GameObject>();
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], state: false);
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], state: false);
                NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], state: false);
                FengGameManagerMKII.FGM.needChooseSide = true;
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(null);
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().setSpectorMode(val: true);
                Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().gameOver = true;
            }
        }

19 View Source File : ShowInfoOfPlayer.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnEnable()
    {
        if (this.textGo != null)
        {
            this.textGo.SetActive(true);
        }
    }

19 View Source File : PoolObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public GameObject NetworkInstantiate(string name, Vector3 position, Quaternion rotation, int instantioationId, int[] viewIDs, short prefix = 0, int group = 0, object[] data = null)
        {
            GameObject go = PickObject(name);
            if (!go.GetComponent<PhotonView>())
            {
                Debug.LogError($"PoolObject.NetworkInstantiate(): Prefab with name \"{name}\" has not PhotonView component!");
                return null;
            }
            PhotonView[] views = go.GetPhotonViewsInChildren();
            for (int i = 0; i < views.Length; i++)
            {
                views[i].didAwake = false;
                views[i].viewID = 0;
                views[i].prefix = prefix;
                views[i].instantiationId = instantioationId;
                views[i].instantiationData = data;
                views[i].didAwake = true;
                views[i].viewID = viewIDs[i];
            }
            if (go.transform)
            {
                go.transform.position = position;
                go.transform.rotation = rotation;
            }
            go.SetActive(true);
            PhotonNetwork.networkingPeer.RemoveInstantiationData(instantioationId);
            if (PhotonNetwork.networkingPeer.instantiatedObjects.ContainsKey(instantioationId))
            {
                GameObject gameobj = PhotonNetwork.networkingPeer.instantiatedObjects[instantioationId];
                string str2 = string.Empty;
                if (gameobj != null)
                {
                    foreach (PhotonView view in gameobj.GetPhotonViewsInChildren())
                    {
                        if (view != null)
                        {
                            str2 = str2 + view.ToString() + ", ";
                        }
                    }
                }
                object[] args = new object[] { gameobj, instantioationId, PhotonNetwork.networkingPeer.instantiatedObjects.Count, go, str2, PhotonNetwork.lastUsedViewSubId, PhotonNetwork.lastUsedViewSubIdStatic, NetworkingPeer.photonViewList.Count };
                Debug.LogError(string.Format("DoInstantiate re-defines a GameObject. Destroying old entry! New: '{0}' (instantiationID: {1}) Old: {3}. PhotonViews on old: {4}. instantiatedObjects.Count: {2}. PhotonNetwork.lastUsedViewSubId: {5} PhotonNetwork.lastUsedViewSubIdStatic: {6} photonViewList.Count {7}.)", args));
                PhotonNetwork.networkingPeer.RemoveInstantiatedGO(go, true);
            }
            PhotonNetwork.networkingPeer.instantiatedObjects.Add(instantioationId, go);
            return go;
        }

19 View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void Update()
    {
        this.healthTime -= Time.deltaTime;
        UpdateLabel();
        if (this.state == "null")
        {
            return;
        }
        if (this.state == "wait")
        {
            this.waitTime -= Time.deltaTime;
            if (this.waitTime <= 0f)
            {
                baseT.position = new Vector3(30f, 0f, 784f);
                //UnityEngine.Object.Instantiate(CacheResources.Load("FX/ThunderCT"), baseT.position + Vectors.up * 350f, Quaternion.Euler(270f, 0f, 0f));
                Pool.Enable("FX/ThunderCT", baseT.position + Vectors.up * 350f, Quaternion.Euler(270f, 0f, 0f));
                IN_GAME_MAIN_CAMERA.MainCamera.flashBlind();
                if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
                {
                    this.idle();
                }
                else if ((!FengGameManagerMKII.LAN) ? BasePV.IsMine : base.networkView.isMine)
                {
                    this.idle();
                }
                else
                {
                    this.state = "null";
                }
            }
        }
        else
        {
            if (this.state == "idle")
            {
                if (this.attackPattern == -1)
                {
                    this.slap("r1");
                    this.attackPattern++;
                }
                else if (this.attackPattern == 0)
                {
                    this.attack_sweep(string.Empty);
                    this.attackPattern++;
                }
                else if (this.attackPattern == 1)
                {
                    this.steam();
                    this.attackPattern++;
                }
                else if (this.attackPattern == 2)
                {
                    this.kick();
                    this.attackPattern++;
                }
                else
                {
                    if (this.isSteamNeed || this.hasDie)
                    {
                        this.steam();
                        this.isSteamNeed = false;
                        return;
                    }
                    if (this.myHero == null)
                    {
                        this.findNearestHero();
                    }
                    else
                    {
                        Vector3 vector = this.myHero.transform.position - baseT.position;
                        float current = -Mathf.Atan2(vector.z, vector.x) * 57.29578f;
                        float f = -Mathf.DeltaAngle(current, baseGT.rotation.eulerAngles.y - 90f);
                        this.myDistance = Mathf.Sqrt((this.myHero.transform.position.x - baseT.position.x) * (this.myHero.transform.position.x - baseT.position.x) + (this.myHero.transform.position.z - baseT.position.z) * (this.myHero.transform.position.z - baseT.position.z));
                        float num = this.myHero.transform.position.y - baseT.position.y;
                        if (this.myDistance < 85f && UnityEngine.Random.Range(0, 100) < 5)
                        {
                            this.steam();
                            return;
                        }
                        if (num > 310f && num < 350f)
                        {
                            if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APL1").position) < 40f)
                            {
                                this.slap("l1");
                                return;
                            }
                            if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APL2").position) < 40f)
                            {
                                this.slap("l2");
                                return;
                            }
                            if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APR1").position) < 40f)
                            {
                                this.slap("r1");
                                return;
                            }
                            if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APR2").position) < 40f)
                            {
                                this.slap("r2");
                                return;
                            }
                            if (this.myDistance < 150f && Mathf.Abs(f) < 80f)
                            {
                                this.attack_sweep(string.Empty);
                                return;
                            }
                        }
                        if (num < 300f && Mathf.Abs(f) < 80f && this.myDistance < 85f)
                        {
                            this.attack_sweep("_vertical");
                            return;
                        }
                        int num2 = UnityEngine.Random.Range(0, 7);
                        if (num2 == 0)
                        {
                            this.slap("l1");
                        }
                        else if (num2 == 1)
                        {
                            this.slap("l2");
                        }
                        else if (num2 == 2)
                        {
                            this.slap("r1");
                        }
                        else if (num2 == 3)
                        {
                            this.slap("r2");
                        }
                        else if (num2 == 4)
                        {
                            this.attack_sweep(string.Empty);
                        }
                        else if (num2 == 5)
                        {
                            this.attack_sweep("_vertical");
                        }
                        else if (num2 == 6)
                        {
                            this.steam();
                        }
                    }
                }
                return;
            }
            if (this.state == "attack_sweep")
            {
                if (this.attackCheckTimeA != 0f && ((base.animation["attack_" + this.attackAnimation].normalizedTime >= this.attackCheckTimeA && base.animation["attack_" + this.attackAnimation].normalizedTime <= this.attackCheckTimeB) || (!this.attackChkOnce && base.animation["attack_" + this.attackAnimation].normalizedTime >= this.attackCheckTimeA)))
                {
                    if (!this.attackChkOnce)
                    {
                        this.attackChkOnce = true;
                    }
                    foreach (RaycastHit raycastHit in this.checkHitCapsule(this.checkHitCapsuleStart.position, this.checkHitCapsuleEnd.position, this.checkHitCapsuleR))
                    {
                        GameObject gameObject = raycastHit.collider.gameObject;
                        if (gameObject.CompareTag("Player"))
                        {
                            this.killPlayer(gameObject);
                        }
                        if (gameObject.CompareTag("erenHitbox") && this.attackAnimation == "combo_3" && IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && ((!FengGameManagerMKII.LAN) ? PhotonNetwork.IsMasterClient : Network.isServer))
                        {
                            gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().hitByFTByServer(3);
                        }
                    }
                    foreach (RaycastHit raycastHit2 in this.checkHitCapsule(this.checkHitCapsuleEndOld, this.checkHitCapsuleEnd.position, this.checkHitCapsuleR))
                    {
                        GameObject gameObject2 = raycastHit2.collider.gameObject;
                        if (gameObject2.CompareTag("Player"))
                        {
                            this.killPlayer(gameObject2);
                        }
                    }
                    this.checkHitCapsuleEndOld = this.checkHitCapsuleEnd.position;
                }
                if (base.animation["attack_" + this.attackAnimation].normalizedTime >= 1f)
                {
                    this.sweepSmokeObject.GetComponent<ParticleSystem>().enableEmission = false;
                    this.sweepSmokeObject.GetComponent<ParticleSystem>().Stop();
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (!FengGameManagerMKII.LAN)
                        {
                            BasePV.RPC("stopSweepSmoke", PhotonTargets.Others, new object[0]);
                        }
                    }
                    this.findNearestHero();
                    this.idle();
                    this.playAnimation("idle");
                }
            }
            else if (this.state == "kick")
            {
                if (!this.attackChkOnce && base.animation[this.actionName].normalizedTime >= this.attackCheckTime)
                {
                    this.attackChkOnce = true;
                    this.door_broken.SetActive(true);
                    this.door_closed.SetActive(false);
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (!FengGameManagerMKII.LAN)
                        {
                            BasePV.RPC("changeDoor", PhotonTargets.OthersBuffered, new object[0]);
                        }
                    }
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (FengGameManagerMKII.LAN)
                        {
                            Network.Instantiate(CacheResources.Load("FX/boom1_CT_KICK"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Network.Instantiate(CacheResources.Load("rock"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f), 0);
                        }
                        else
                        {
                            Optimization.Caching.Pool.NetworkEnable("FX/boom1_CT_KICK", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Optimization.Caching.Pool.NetworkEnable("rock", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f), 0);
                        }
                    }
                    else
                    {
                        Pool.Enable("FX/boom1_CT_KICK", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/boom1_CT_KICK"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f));
                        Pool.Enable("rock", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f));
                    }
                }
                if (base.animation[this.actionName].normalizedTime >= 1f)
                {
                    this.findNearestHero();
                    this.idle();
                    this.playAnimation("idle");
                }
            }
            else if (this.state == "slap")
            {
                if (!this.attackChkOnce && base.animation["attack_slap_" + this.attackAnimation].normalizedTime >= this.attackCheckTime)
                {
                    this.attackChkOnce = true;
                    GameObject gameObject3;
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (FengGameManagerMKII.LAN)
                        {
                            gameObject3 = (GameObject)Network.Instantiate(CacheResources.Load("FX/boom1"), this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f), 0);
                        }
                        else
                        {
                            gameObject3 = Optimization.Caching.Pool.NetworkEnable("FX/boom1", this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f), 0);
                        }
                        if (gameObject3.GetComponent<EnemyfxIDcontainer>())
                        {
                            gameObject3.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
                        }
                    }
                    else
                    {
                        gameObject3 = Pool.Enable("FX/boom1", this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f));//(GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("FX/boom1"), this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f));
                    }
                    gameObject3.transform.localScale = new Vector3(5f, 5f, 5f);
                }
                if (base.animation["attack_slap_" + this.attackAnimation].normalizedTime >= 1f)
                {
                    this.findNearestHero();
                    this.idle();
                    this.playAnimation("idle");
                }
            }
            else if (this.state == "steam")
            {
                if (!this.attackChkOnce && base.animation[this.actionName].normalizedTime >= this.attackCheckTime)
                {
                    this.attackChkOnce = true;
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (FengGameManagerMKII.LAN)
                        {
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
                        }
                        else
                        {
                            Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
                        }
                    }
                    else
                    {
                        Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
                        Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
                        Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
                    }
                }
                if (base.animation[this.actionName].normalizedTime >= 1f)
                {
                    if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
                    {
                        if (FengGameManagerMKII.LAN)
                        {
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
                            Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
                        }
                        else
                        {
                            GameObject gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
                            if (gameObject4.GetComponent<EnemyfxIDcontainer>())
                            {
                                gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
                            }
                            gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
                            if (gameObject4.GetComponent<EnemyfxIDcontainer>())
                            {
                                gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
                            }
                            gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
                            if (gameObject4.GetComponent<EnemyfxIDcontainer>())
                            {
                                gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
                            }
                        }
                    }
                    else
                    {
                        Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
                        Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
                        Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
                        //UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
                    }
                    if (this.hasDie)
                    {
                        if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
                        {
                            UnityEngine.Object.Destroy(baseG);
                        }
                        else if (FengGameManagerMKII.LAN)
                        {
                            if (base.networkView.isMine)
                            {
                            }
                        }
                        else if (PhotonNetwork.IsMasterClient)
                        {
                            PhotonNetwork.Destroy(BasePV);
                        }
                        FengGameManagerMKII.FGM.GameWin();
                    }
                    this.findNearestHero();
                    this.idle();
                    this.playAnimation("idle");
                }
            }
            else if (this.state == string.Empty)
            {
            }
        }
    }

19 View Source File : Xffect.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void Active()
    {
        foreach (object obj in base.transform)
        {
            Transform transform = (Transform)obj;
            transform.gameObject.SetActive(true);
        }
        base.gameObject.SetActive(true);
        this.ElapsedTime = 0f;
    }

19 View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218

protected override void Start()
		{
			// Check if the slot is not replacedigned but the icon graphic is active
			if (!this.Isreplacedigned() && this.iconGraphic != null && this.iconGraphic.gameObject.activeSelf)
			{
				// Disable the icon graphic object
				this.iconGraphic.gameObject.SetActive(false);
			}
		}

19 View Source File : XffectCache.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        foreach (object obj in base.transform)
        {
            Transform transform = (Transform)obj;
            this.ObjectDic[transform.name] = new ArrayList();
            this.ObjectDic[transform.name].Add(transform);
            Xffect component = transform.GetComponent<Xffect>();
            if (component != null)
            {
                component.Initialize();
            }
            transform.gameObject.SetActive(false);
        }
    }

19 View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        FengGameManagerMKII.FGM.AddCT(this);
        if (this.myHero == null)
        {
            this.findNearestHero();
        }
        size = 20f;
        base.name = "COLOSSAL_replacedAN";
        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;
    }

19 View Source File : XffectCache.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public Transform GetObject(string name)
    {
        ArrayList arrayList = this.ObjectDic[name];
        if (arrayList == null)
        {
            Debug.LogError(name + ": cache doesnt exist!");
            return null;
        }
        foreach (object obj in arrayList)
        {
            Transform transform = (Transform)obj;
            if (!transform.gameObject.activeInHierarchy)
            {
                transform.gameObject.SetActive(false);
                return transform;
            }
        }
        return this.AddObject(name);
    }

19 View Source File : UnitTopUI.cs
License : Apache License 2.0
Project Creator : 365082218

public void Init(MonsterEx attr, Transform attach, EUnitCamp camp)
    {
        owner = attach.GetComponent<MeteorUnit>();
        //Transform mainCanvas = GameObject.Find("Canvas").transform;
        //transform.SetParent(mainCanvas);
        transform.localScale = Vector3.one;
        transform.localRotation = Quaternion.idenreplacedy;
        transform.localPosition = Vector3.zero;
        transform.SetAsLastSibling();
        //rect.ancreplaceddPosition3D = new Vector3(0, 40.0f, 0);
        //transform.localScale = Vector3.one * 0.1f;//0.07-0.03 0.07是主角与敌人距离最近时,0.03是摄像机与敌人最近时,摄像机与敌人最近时,要看得到敌人,必须距离 44左右
        MonsterName.text = attr == null ? "" : attr.Name;
        if (camp == EUnitCamp.EUC_ENEMY)
            MonsterName.color = Color.red;
        else if (camp == EUnitCamp.EUC_NONE)
            MonsterName.color = Color.white;
        target = attach;
        if (owner == Main.Ins.LocalPlayer)
            MonsterName.gameObject.SetActive(false);
     }

19 View Source File : XWeaponTrail.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void Activate()
        {
            FadeTime = VideoSettings.InfiniteTrail.Value ? -1f : 0.3f;
            MaxFrame = Mathf.RoundToInt(VideoSettings.TrailFPS.Value);
            Init();
            if (mMeshObj == null)
            {
                InitMeshObj();
            }
            else
            {
                gameObject.SetActive(true);
                if (mMeshObj != null)
                {
                    mMeshObj.SetActive(true);
                }

                mFadeT = 1f;
                mIsFading = false;
                mFadeTime = 1f;
                mFadeElapsedime = 0f;
                mElapsedTime = 0f;
                for (var i = 0; i < mSnapshotList.Count; i++)
                {
                    mSnapshotList[i].PointStart = PointStart.position;
                    mSnapshotList[i].PointEnd = PointEnd.position;
                    mSpline.ControlPoints[i].Position = mSnapshotList[i].Pos;
                    mSpline.ControlPoints[i].Normal = mSnapshotList[i].PointEnd - mSnapshotList[i].PointStart;
                }

                RefreshSpline();
                UpdateVertex();
            }
        }

19 View Source File : KillInfoComponent.cs
License : GNU General Public License v3.0
Project Creator : aelariane

protected internal void moveOn()
    {
        this.col++;
        if (this.col > 4)
        {
            this.timeElapsed = this.lifeTime;
        }
        if (groupBig != null)
        {
            this.groupBig.SetActive(false);
        }

        if (groupSmall != null)
        {
            this.groupSmall.SetActive(true);
        }
    }

19 View Source File : XWeaponTrail.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void InitMeshObj()
        {
            mMeshObj = new GameObject("_XWeaponTrailMesh: " + gameObject.name);
            mMeshObj.layer = gameObject.layer;
            mMeshObj.SetActive(true);
            var filter = mMeshObj.AddComponent<MeshFilter>();
            var renderer = mMeshObj.AddComponent<MeshRenderer>();
            renderer.castShadows = false;
            renderer.receiveShadows = false;
            renderer.renderer.sharedMaterial = MyMaterial;
            filter.sharedMesh = new Mesh();
            mVertexPool = new VertexPool(filter.sharedMesh, MyMaterial);
            mVertexSegment = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);
            UpdateIndices();
        }

19 View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218

public void SetIcon(Texture iconTex)
		{
			// Check if the icon graphic valid raw image
			if (this.iconGraphic == null || !(this.iconGraphic is RawImage))
				return;
			
			// Set the sprite
			(this.iconGraphic as RawImage).texture = iconTex;
			
			// Enable or disabled the icon graphic game object
			if (iconTex != null && !this.iconGraphic.gameObject.activeSelf) this.iconGraphic.gameObject.SetActive(true);
			if (iconTex == null && this.iconGraphic.gameObject.activeSelf) this.iconGraphic.gameObject.SetActive(false);
		}

19 View Source File : BeatSaverVotingInterop.cs
License : MIT License
Project Creator : andruzzzhka

public static void Setup(MultiplayerResultsViewController resultsView, IBeatmapLevel level)
        {
            if (!resultsView) return;

            if (instance == null)
            {
                Plugin.log.Debug("Setting up BeatSaverVoting interop...");

                var modInfo = IPA.Loader.PluginManager.GetPluginFromId("BeatSaverVoting");

                Plugin.log.Debug("Found BeatSaverVoting plugin!");

                if (modInfo == null) return;

                UpButton = FieldAccessor<VotingUI, Transform>.GetAccessor("upButton");
                DownButton = FieldAccessor<VotingUI, Transform>.GetAccessor("downButton");
                LastSong = FieldAccessor<VotingUI, IBeatmapLevel>.GetAccessor("_lastSong");

                Plugin.log.Debug("Got accessors");

                replacedembly votingreplacedembly = modInfo.replacedembly;

                instance = VotingUI.instance;

                votingUIHost = new GameObject("VotingUIHost").AddComponent<RectTransform>();
                votingUIHost.SetParent(resultsView.transform, false);
                votingUIHost.anchorMin = Vector2.zero;
                votingUIHost.anchorMax = Vector2.one;
                votingUIHost.sizeDelta = Vector2.zero;
                votingUIHost.ancreplaceddPosition = new Vector2(2.25f, -6f);
                votingUIHost.SetParent(resultsView.resultsTab, true);

                BSMLParser.instance.Parse(Utilities.GetResourceContent(votingreplacedembly, "BeatSaverVoting.UI.votingUI.bsml"), votingUIHost.gameObject, instance);

                Plugin.log.Debug("Created UI");

                UnityEngine.UI.Image upArrow = UpButton(ref instance).transform.Find("Arrow")?.GetComponent<UnityEngine.UI.Image>();
                UnityEngine.UI.Image downArrow = DownButton(ref instance).transform.Find("Arrow")?.GetComponent<UnityEngine.UI.Image>();
                if (upArrow != null && downArrow != null)
                {
                    upArrow.color = new Color(0.341f, 0.839f, 0.341f);
                    downArrow.color = new Color(0.984f, 0.282f, 0.305f);
                }
            }
            else
            {
                votingUIHost.gameObject.SetActive(true);
            }

            LastSong(ref instance) = level;

            Plugin.log.Debug("Calling GetVotesForMap...");

            instance.InvokeMethod<object, VotingUI>("GetVotesForMap", new object[0]);

            Plugin.log.Debug("Called GetVotesForMap!");
        }

19 View Source File : FengPhotonCalls.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnLevelWasLoaded(int level)
    {
        if (level == 0)
        {
            return;
        }

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

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

        gameStart = true;
        Pool.Clear();
        Anarchy.Skins.SkinElement.ClearCache();
        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;
            }

            SpawnreplacedansCustom(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.isreplacedan] == 2)
                {
                    checkpoint = CacheGameObject.Find("PVPchkPtT");
                }
                else
                {
                    checkpoint = CacheGameObject.Find("PVPchkPtH");
                }
            }

            if ((int)PhotonNetwork.player.Properties[PhotonPlayerProperty.isreplacedan] == 2)
            {
                SpawnNonAireplacedan(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("replacedAN_EREN_trost", new Vector3(-200f, 0f, -194f),
                                Quaternion.Euler(0f, 180f, 0f));
                            gameObject4.GetComponent<replacedAN_EREN>().rockLift = true;
                            var rate2 = 90;
                            if (difficulty == 1)
                            {
                                rate2 = 70;
                            }

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

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

                        break;
                    }
                case GameMode.Killreplacedan:
                case GameMode.Endlessreplacedan:
                case GameMode.SurviveMode:
                    {
                        if (info.Name == "Annie" || info.Name == "Annie II")
                        {
                            Pool.NetworkEnable("FEMALE_replacedAN", CacheGameObject.Find("replacedanRespawn").transform.position,
                                CacheGameObject.Find("replacedanRespawn").transform.rotation);
                        }
                        else
                        {
                            var rate3 = 90;
                            if (difficulty == 1)
                            {
                                rate3 = 70;
                            }

                            SpawnreplacedansCustom(rate3, info.EnemyNumber);
                        }

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

                                for (var k = 0; k < array5.Length; k++)
                                {
                                    SpawnreplacedanRaw(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.idenreplacedy;
                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.idenreplacedy;
                mapCeiling.transform.localScale = new Vector3(1400f, 20f, 1400f);
            }
        }

        roomInformation.UpdateLabels();
        Resources.UnloadUnusedreplacedets();
    }

19 View Source File : ModeSelectionViewController.cs
License : MIT License
Project Creator : andruzzzhka

protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            base.DidActivate(firstActivation, activationType);
            if (firstActivation)
            {
                _radioButton.interactable = false;

                foreach (string path in _dllPaths)
                {
                    if (!File.Exists(path))
                    {
                        _filesMising = true;
                        _missingFilesString += "\n" + path;
                    }
                }

                _missingFilesText.color = Color.red;
                _missingFilesText.text = _missingFilesString;

                if (_filesMising)
                {
                    _missingFilesRect.gameObject.SetActive(true);
                    _buttonsRect.gameObject.SetActive(false);
                }
                else
                {
                    _missingFilesRect.gameObject.SetActive(false);
                    _buttonsRect.gameObject.SetActive(true);
                }

                if (ModelSaberAPI.isCalculatingHashes)
                {
                    _missingFilesRect.gameObject.SetActive(false);
                    _buttonsRect.gameObject.SetActive(false);
                    _avatarsLoadingRect.gameObject.SetActive(true);
                    ModelSaberAPI.hashesCalculated += ModelSaberAPI_hashesCalculated;

                    _progressBarBG.color = new Color(1f, 1f, 1f, 0.2f);
                    _progressBarTop.color = new Color(1f, 1f, 1f, 1f);

                }
                else
                {
                    _avatarsLoadingRect.gameObject.SetActive(false);

                    AvatarController.LoadAvatars();
                }

                var pluginVersion = IPA.Loader.PluginManager.GetPlugin("Beat Saber Multiplayer").Version.ToString();
                var pluginBuild = pluginVersion.Substring(pluginVersion.LastIndexOf('.') + 1);

                _versionText.text = $"v{pluginVersion}{(!int.TryParse(pluginBuild, out var buildNumber) ? " <color=red>(EXPERIMENTAL)</color>" : "")}";
            }
        }

19 View Source File : SettingDialog.cs
License : Apache License 2.0
Project Creator : 365082218

void Init()
    {
        Control("Return").GetComponent<Button>().onClick.AddListener(() =>
        {
            GameStateMgr.Ins.SaveState();
            Main.Ins.DialogStateManager.ChangeState(Main.Ins.DialogStateManager.MainMenuState);
        });

        Control("DeleteState").GetComponent<Button>().onClick.AddListener(() =>
        {
            GameStateMgr.Ins.ResetState();
            Init();
        });

        Control("ChangeLog").GetComponent<Text>().text = Resources.Load<Textreplacedet>("ChangeLog").text;
        Control("AuthorText").GetComponent<Text>().text = Resources.Load<Textreplacedet>("Author").text;
        Text cheat = Control("CheatCodeList").GetComponent<Text>();
        cheat.text = Resources.Load<Textreplacedet>("CheatCodeList").text;
        cheat.fontSize = 33;
        Control("AppVerText").GetComponent<Text>().text = Main.Ins.AppInfo.AppVersion();
        Control("MeteorVerText").GetComponent<Text>().text = Main.Ins.AppInfo.MeteorVersion;
        Control("DoScript").GetComponent<Button>().onClick.AddListener(()=> { U3D.DoScript(); });
        Control("Nick").GetComponentInChildren<Text>().text = GameStateMgr.Ins.gameStatus.NickName;
        Control("Nick").GetComponent<Button>().onClick.AddListener(
            () =>
            {
                NickNameDialogState.State.Open();
            }
        );

        lowPerfor = Control("LowPerformance").GetComponent<Toggle>();
        lowPerfor.isOn = GameStateMgr.Ins.gameStatus.TargetFrame == 30;
        lowPerfor.onValueChanged.AddListener(OnChangePerformance);

        LowMiddle = Control("LowMiddle").GetComponent<Toggle>();
        LowMiddle.isOn = GameStateMgr.Ins.gameStatus.TargetFrame == 60;
        LowMiddle.onValueChanged.AddListener(OnChangePerformance);

        highPerfor = Control("HighPerformance").GetComponent<Toggle>();
        highPerfor.isOn = GameStateMgr.Ins.gameStatus.TargetFrame == 90;
        highPerfor.onValueChanged.AddListener(OnChangePerformance);

        superHighPerfor = Control("SuperHighPerformance").GetComponent<Toggle>();
        superHighPerfor.isOn = GameStateMgr.Ins.gameStatus.TargetFrame == 120;
        superHighPerfor.onValueChanged.AddListener(OnChangePerformance);

        Toggle High = Control("High").GetComponent<Toggle>();
        Toggle Medium = Control("Medium").GetComponent<Toggle>();
        Toggle Low = Control("Low").GetComponent<Toggle>();
        High.isOn = GameStateMgr.Ins.gameStatus.Quality == 0;
        Medium.isOn = GameStateMgr.Ins.gameStatus.Quality == 1;
        Low.isOn = GameStateMgr.Ins.gameStatus.Quality == 2;
        High.onValueChanged.AddListener((bool selected) => { if (selected) GameStateMgr.Ins.gameStatus.Quality = 0; });
        Medium.onValueChanged.AddListener((bool selected) => { if (selected) GameStateMgr.Ins.gameStatus.Quality = 1; });
        Low.onValueChanged.AddListener((bool selected) => { if (selected) GameStateMgr.Ins.gameStatus.Quality = 2; });
        Toggle ShowTargetBlood = Control("ShowTargetBlood").GetComponent<Toggle>();
        ShowTargetBlood.isOn = GameStateMgr.Ins.gameStatus.ShowBlood;
        ShowTargetBlood.onValueChanged.AddListener((bool selected) => { GameStateMgr.Ins.gameStatus.ShowBlood = selected; });
        Toggle ShowFPS = Control("ShowFPS").GetComponent<Toggle>();
        ShowFPS.isOn = GameStateMgr.Ins.gameStatus.ShowFPS;
        ShowFPS.onValueChanged.AddListener((bool selected) => { GameStateMgr.Ins.gameStatus.ShowFPS = selected; Main.Ins.ShowFps(selected); });

        if (Main.Ins != null)
        {
            Control("BGMSlider").GetComponent<Slider>().value = GameStateMgr.Ins.gameStatus.MusicVolume;
            Control("EffectSlider").GetComponent<Slider>().value = GameStateMgr.Ins.gameStatus.SoundVolume;
        }
        Control("BGMSlider").GetComponent<Slider>().onValueChanged.AddListener(OnMusicVolumeChange);
        Control("EffectSlider").GetComponent<Slider>().onValueChanged.AddListener(OnEffectVolumeChange);
        Control("SetJoyPosition").GetComponent<Button>().onClick.AddListener(OnSetUIPosition);

        Toggle EnableGamePad = Control("EnableGamePad").GetComponent<Toggle>();
        EnableGamePad.isOn = GameStateMgr.Ins.gameStatus.UseGamePad;
        EnableGamePad.onValueChanged.AddListener((bool selected) => { GameStateMgr.Ins.gameStatus.UseGamePad = selected; Main.Ins.JoyStick.enabled = selected; });

        Toggle EnableMouse = Control("EnableMouse").GetComponent<Toggle>();
        EnableMouse.isOn = GameStateMgr.Ins.gameStatus.UseMouse;
        EnableMouse.onValueChanged.AddListener((bool selected) => { GameStateMgr.Ins.gameStatus.UseMouse = selected;});
        
        //显示战斗界面的调试按钮
        Toggle toggleDebug = Control("EnableSFX").GetComponent<Toggle>();
        toggleDebug.isOn = GameStateMgr.Ins.gameStatus.EnableDebugSFX;
        toggleDebug.onValueChanged.AddListener(OnEnableDebugSFX);
        //显示战斗界面的调试按钮
        Toggle toggleRobot = Control("EnableRobot").GetComponent<Toggle>();
        toggleRobot.isOn = GameStateMgr.Ins.gameStatus.EnableDebugRobot;
        toggleRobot.onValueChanged.AddListener(OnEnableDebugRobot);

        //显示武器挑选按钮
        Toggle toggleEnableFunc = Control("EnableWeaponChoose").GetComponent<Toggle>();
        toggleEnableFunc.isOn = GameStateMgr.Ins.gameStatus.EnableWeaponChoose;
        toggleEnableFunc.onValueChanged.AddListener(OnEnableWeaponChoose);
        //无限气
        Toggle toggleEnableInfiniteAngry = Control("EnableInfiniteAngry").GetComponent<Toggle>();
        toggleEnableInfiniteAngry.isOn = GameStateMgr.Ins.gameStatus.EnableInfiniteAngry;
        toggleEnableInfiniteAngry.onValueChanged.AddListener(OnEnableInfiniteAngry);

        //无锁定
        Toggle toggleDisableLock = Control("CameraLock").GetComponent<Toggle>();
        toggleDisableLock.isOn = GameStateMgr.Ins.gameStatus.AutoLock;
        toggleDisableLock.onValueChanged.AddListener(OnDisableLock);

        Toggle toggleEnableGodMode = Control("EnableGodMode").GetComponent<Toggle>();
        toggleEnableGodMode.isOn = GameStateMgr.Ins.gameStatus.EnableGodMode;
        toggleEnableGodMode.onValueChanged.AddListener(OnEnableGodMode);

        Toggle toggleHidePlayer = Control("HidePlayer").GetComponent<Toggle>();
        toggleHidePlayer.isOn = GameStateMgr.Ins.gameStatus.HidePlayer;
        toggleHidePlayer.onValueChanged.AddListener(OnHidePlayer);
        
        Toggle toggleEnableUndead = Control("EnableUnDead").GetComponent<Toggle>();
        toggleEnableUndead.isOn = GameStateMgr.Ins.gameStatus.Undead;
        toggleEnableUndead.onValueChanged.AddListener(OnEnableUndead);

        Toggle toggleShowWayPoint = Control("ShowWayPoint").GetComponent<Toggle>();
        toggleShowWayPoint.isOn = GameStateMgr.Ins.gameStatus.ShowWayPoint;
        toggleShowWayPoint.onValueChanged.AddListener(OnShowWayPoint);
        Control("ChangeV107").GetComponent<Button>().onClick.AddListener(() => { OnChangeVer("1.07"); });
        Control("ChangeV907").GetComponent<Button>().onClick.AddListener(() => { OnChangeVer("9.07"); });
        Control("UnlockAll").GetComponent<Button>().onClick.AddListener(() => { U3D.UnlockLevel(); });

        //粒子特效
        Toggle toggleDisableParticle = Control("Particle").GetComponent<Toggle>();
        toggleDisableParticle.isOn = GameStateMgr.Ins.gameStatus.DisableParticle;
        toggleDisableParticle.onValueChanged.AddListener(OnDisableParticle);
        OnDisableParticle(toggleDisableParticle.isOn);

        Toggle toggleJoyEnable = Control("EnableJoy").GetComponent<Toggle>();
        toggleJoyEnable.isOn = GameStateMgr.Ins.gameStatus.JoyEnable;
        toggleJoyEnable.onValueChanged.AddListener(OnJoyEnable);

        Toggle toggleJoyOnlyRotate = Control("JoyOnlyRotate").GetComponent<Toggle>();
        toggleJoyOnlyRotate.isOn = GameStateMgr.Ins.gameStatus.JoyRotateOnly;
        toggleJoyOnlyRotate.onValueChanged.AddListener(OnJoyRotateOnly);


        GameObject debugTab = Control("DebugTab", WndObject);
        Toggle debugToggle = Control("Debug", WndObject).GetComponent<Toggle>();
        Toggle cheatToggle = Control("Cheat", WndObject).GetComponent<Toggle>();

        DebugRoot = Control("Content", debugTab);

        if (Main.Ins.AppInfo.AppVersionIsSmallThan(Main.Ins.GameNotice.newVersion))
        {
            //需要更新,设置好服务器版本号,设置好下载链接
            Control("NewVersionSep", WndObject).SetActive(true);
            Control("NewVersion", WndObject).GetComponent<Text>().text = string.Format("最新版本号:{0}", Main.Ins.GameNotice.newVersion);
            Control("NewVersion", WndObject).SetActive(true);
            Control("GetNewVersion", WndObject).GetComponent<LinkLabel>().URL = Main.Ins.GameNotice.apkUrl;
            Control("GetNewVersion", WndObject).SetActive(true);
            Control("Flag", WndObject).SetActive(true);
        }

        UITab[] tabs = WndObject.GetComponentsInChildren<UITab>();
        for (int i = 0; i < tabs.Length; i++)
        {
            tabs[i].onValueChanged.AddListener(OnTabShow);
        }

        //把一些模式禁用,例如作弊之类的.
        if (GameStateMgr.Ins.gameStatus.CheatEnable) {
            debugToggle.gameObject.SetActive(true);
            cheatToggle.gameObject.SetActive(true);
        } else {
            Control("EnableRobot").SetActive(false);//屏蔽可添加电脑
            Control("EnableWeaponChoose").SetActive(false);
            Control("ShowWayPoint").SetActive(false);
            Control("EnableUnDead").SetActive(false);
            Control("EnableGodMode").SetActive(false);
            Control("EnableInfiniteAngry").SetActive(false);
            Control("EnableSFX").SetActive(false);
        }

        LoadDebugLevel();
        //起始页显示
        OnTabShow(true);

        Button JoyW = Control("JoyW").GetComponent<Button>();
        JoyW.onClick.AddListener(()=> { FlashButton(JoyW, EKeyList.KL_KeyW, "上:[{0}]"); });

        Button JoyS = Control("JoyS").GetComponent<Button>();
        JoyS.onClick.AddListener(() => { FlashButton(JoyS, EKeyList.KL_KeyS, "下:[{0}]"); });

        Button JoyA = Control("JoyA").GetComponent<Button>();
        JoyA.onClick.AddListener(() => { FlashButton(JoyA, EKeyList.KL_KeyA, "左:[{0}]"); });

        Button JoyD = Control("JoyD").GetComponent<Button>();
        JoyD.onClick.AddListener(() => { FlashButton(JoyD, EKeyList.KL_KeyD, "右:[{0}]"); });

        Button JoyCW = Control("JoyCW").GetComponent<Button>();
        JoyCW.onClick.AddListener(() => { FlashButton(JoyCW, EKeyList.KL_CameraAxisYU, "视角上:[{0}]"); });

        Button JoyCS = Control("JoyCS").GetComponent<Button>();
        JoyCS.onClick.AddListener(() => { FlashButton(JoyCS, EKeyList.KL_CameraAxisYD, "视角下:[{0}]"); });

        Button JoyCA = Control("JoyCA").GetComponent<Button>();
        JoyCA.onClick.AddListener(() => { FlashButton(JoyCA, EKeyList.KL_CameraAxisXL, "视角左:[{0}]"); });

        Button JoyCD = Control("JoyCD").GetComponent<Button>();
        JoyCD.onClick.AddListener(() => { FlashButton(JoyCD, EKeyList.KL_CameraAxisXR, "视角右:[{0}]"); });

        Button JoyAttack = Control("JoyAttack").GetComponent<Button>();
        JoyAttack.onClick.AddListener(() => { FlashButton(JoyAttack, EKeyList.KL_Attack, "攻击:[{0}]"); });

        Button JoyDefence = Control("JoyDefence").GetComponent<Button>();
        JoyDefence.onClick.AddListener(() => { FlashButton(JoyDefence, EKeyList.KL_Defence, "防守:[{0}]"); });

        Button JoyJump = Control("JoyJump").GetComponent<Button>();
        JoyJump.onClick.AddListener(() => { FlashButton(JoyJump, EKeyList.KL_Jump, "跳跃:[{0}]"); });

        Button JoyBurst = Control("JoyBurst").GetComponent<Button>();
        JoyBurst.onClick.AddListener(() => { FlashButton(JoyBurst, EKeyList.KL_BreakOut, "爆气:[{0}]"); });

        Button JoyChangeWeapon = Control("JoyChangeWeapon").GetComponent<Button>();
        JoyChangeWeapon.onClick.AddListener(() => { FlashButton(JoyChangeWeapon, EKeyList.KL_ChangeWeapon, "切换武器:[{0}]"); });

        Button JoyDrop = Control("JoyDrop").GetComponent<Button>();
        JoyDrop.onClick.AddListener(() => { FlashButton(JoyDrop, EKeyList.KL_DropWeapon, "丢弃武器:[{0}]"); });

        Button JoyCrouch = Control("JoyCrouch").GetComponent<Button>();
        JoyCrouch.onClick.AddListener(() => { FlashButton(JoyCrouch, EKeyList.KL_Crouch, "蹲下:[{0}]"); });

        Button JoyUnlock = Control("JoyUnlock").GetComponent<Button>();
        JoyUnlock.onClick.AddListener(() => { FlashButton(JoyUnlock, EKeyList.KL_KeyQ, "锁定:[{0}]"); });

        Button JoyHelp = Control("JoyHelp").GetComponent<Button>();
        JoyHelp.onClick.AddListener(() => { FlashButton(JoyHelp, EKeyList.KL_Help, "救助:[{0}]"); });
    }

19 View Source File : DifficultySelectionViewController.cs
License : MIT License
Project Creator : andruzzzhka

public void SetLoadingState(bool loading)
        {
            diffSelectionView.gameObject.SetActive(!loading);
            loadingIndicator.gameObject.SetActive(loading);
        }

19 View Source File : PanelMultiJoin.cs
License : GNU General Public License v3.0
Project Creator : aelariane

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;
    }

19 View Source File : ModifyGameItem.cs
License : GNU General Public License v3.0
Project Creator : a2659802

private void OnCollisionEnter2D(Collision2D collision)
            {
                if (collision.gameObject.name.Contains("Slash") || collision.gameObject.name.Contains("Knight") || collision.gameObject.name.Contains("Hero"))
                    return;
                if (collision.gameObject.GetComponent<CustomDecoration>() != null)
                    return;

                collision.gameObject.SetActive(false);
                Logger.LogDebug($"Disable {collision.gameObject.name}");
                col.enabled = false;
                Destroy(gameObject.GetComponent<Rigidbody2D>());
            }

19 View Source File : FightWnd.cs
License : Apache License 2.0
Project Creator : 365082218

public void ShowPosition() {
        showPosition = !showPosition;
        Position.gameObject.SetActive(showPosition);
    }

19 View Source File : UnitTopUI.cs
License : Apache License 2.0
Project Creator : 365082218

void LateUpdate () {
        if (CombatData.Ins.PauseAll)
            return;
        if (owner == null)
            return;
        if (owner == Main.Ins.LocalPlayer)
            return;
        if (Main.Ins.LocalPlayer == null)
            return;
        bool faceto = Main.Ins.LocalPlayer.IsFacetoTarget(owner);
        if (faceto)
        {
            float unitDis = Vector3.Distance(owner.transform.position, Main.Ins.LocalPlayer.transform.position);
            //UnityEngine.Debug.LogError(string.Format("主角面向{0}", owner.name));
            if ((unitDis <= ViewLimit) && !MonsterName.gameObject.activeSelf)
                MonsterName.gameObject.SetActive(true);
            else if ((unitDis > ViewLimit) && MonsterName.gameObject.activeSelf)
            {
                MonsterName.gameObject.SetActive(false);
            }
        }
        else
        {
            //UnityEngine.Debug.LogError(string.Format("主角背向{0}", owner.name));
            if (MonsterName.gameObject.activeSelf)
                MonsterName.gameObject.SetActive(false);
        }
        //1.6f 1.7666f
        if (MonsterName.gameObject.activeSelf)
        {
            Vector3 top = owner.D_top.transform.position;
            top.y += 10;
            Vector3 vec = Main.Ins.MainCamera.WorldToScreenPoint(top);
            vec = UIHelper.ScreenPointToCanvasPoint(vec);
            rect.ancreplaceddPosition3D = new Vector3(vec.x, vec.y, 1);
         }
    }

19 View Source File : UIRealmSelect_Realm.cs
License : Apache License 2.0
Project Creator : 365082218

protected void ApplyClosedState()
		{
			if (this.m_IsClosed)
			{
				// Apply replacedle text color
				if (this.m_replacedleText != null)
					this.m_replacedleText.canvasRenderer.SetColor(this.m_replacedleClosedColor);
					
				// Activate the closed text game object
				if (this.m_ClosedText != null)
					this.m_ClosedText.gameObject.SetActive(true);
				
				// Deselect
				this.isOn = false;
			}
			else
			{
				// Transition to the current state
				this.DoStateTransition(this.currentSelectionState, !Application.isPlaying);
				
				// Deactivate the closed text game object
				if (this.m_ClosedText != null)
					this.m_ClosedText.gameObject.SetActive(false);
			}
		}

19 View Source File : UIManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void SetParent(UIBase ui)
        {
            if (Instance == null)
            {
                onAwakeAdds += delegate ()
                {
                    ui.transform.SetParent(Instance.transform);
                    ui.transform.position = new Vector3(Instance.transform.position.x, Instance.transform.position.y, Instance.transform.position.z);
                };
                return;
            }
            if (!Instance.gameObject.activeInHierarchy)
            {
                Instance.gameObject.SetActive(true);
            }
            ui.transform.SetParent(Instance.transform);
            ui.transform.position = new Vector3(Instance.transform.position.x, Instance.transform.position.y, Instance.transform.position.z);
        }

19 View Source File : ShowInfoOfPlayer.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnDisable()
    {
        if (this.textGo != null)
        {
            this.textGo.SetActive(false);
        }
    }

See More Examples