public virtual void Start() { if (Application.platform == RuntimePlatform.Switch) { this.runningOnConsole = true; } if (this.runningOnConsole) { Cursor.visible = false; } this.disablePedroHints = SavedData.GetInt("DisablePedroHints") == 1; this.showUITimer = SavedData.GetInt("ShowUITimer") == 1; this.disableRumble = SavedData.GetInt("DisableRumble") == 1; if (SavedData.HasKey("gamepadAimSens")) { this.gamepadAimSens = SavedData.GetFloat("gamepadAimSens"); } this.aimAssistMode = !SavedData.HasKey("AimAssistMode") ? 1 : SavedData.GetInt("AimAssistMode"); if (SavedData.HasKey("cursorMode")) { this.simulateMousePos = SavedData.GetInt("cursorMode") == 1; } if (SavedData.HasKey("mouseAimSens")) { this.simulateMousePosSensitivity = SavedData.GetFloat("mouseAimSens"); } if (SavedData.HasKey("language")) { LocalizationManager.CurrentLanguageCode = SavedData.GetString("language"); } this.modAllWeapons = SavedData.GetInt("modAllWeapons") == 1; this.modInfiniteAmmo = SavedData.GetInt("modInfiniteAmmo") == 1; this.modOneShotEnemies = SavedData.GetInt("modOneShotEnemies") == 1; this.modOneShotPlayer = SavedData.GetInt("modOneShotPlayer") == 1; this.modDisableCheckpoints = SavedData.GetInt("modDisableCheckpoints") == 1; this.modIncreaseAccuracy = SavedData.GetInt("modIncreaseAccuracy") == 1; this.modFocusSlowdownScale = !SavedData.HasKey("modFocusSlowdownScale") ? 25f : (float)SavedData.GetInt("modFocusSlowdownScale"); this.modPlayerSpeed = !SavedData.HasKey("modPlayerSpeed") ? 30f : (float)SavedData.GetInt("modPlayerSpeed"); this.modInfiniteFocus = SavedData.GetInt("modInfiniteFocus") == 1; this.modSideOnCamera = SavedData.GetInt("modSideOnCamera") == 1; this.modBigHead = SavedData.GetInt("modBigHead") == 1; this.modPlayerSize = !SavedData.HasKey("modPlayerSize") ? 100f : (float)SavedData.GetInt("modPlayerSize"); this.modEnemyBulletSpeed = !SavedData.HasKey("modEnemyBulletSpeed") ? 50f : (float)SavedData.GetInt("modEnemyBulletSpeed"); this.modPlayerBulletSpeed = !SavedData.HasKey("modPlayerBulletSpeed") ? 50f : (float)SavedData.GetInt("modPlayerBulletSpeed"); this.modCinematicCamera = SavedData.GetInt("modCinematicCamera") == 1; this.hideHUD = SavedData.HasKey("ShowHUD") && SavedData.GetInt("ShowHUD") == 0; this.CheckForBrokenScores(); this.DoVersionCheck(); GameObject gameObject = GameObject.Find("Rewired Input Manager"); if ((UnityEngine.Object)gameObject != (UnityEngine.Object)null) { this.inputHelperScript = (InputHelperScript)gameObject.GetComponent(typeof(InputHelperScript)); } this.uiTimer = UnityEngine.Object.Instantiate <GameObject>(UnityEngine.Resources.Load("HUD/UITimer") as GameObject); UnityEngine.Object.DontDestroyOnLoad((UnityEngine.Object) this.gameObject); }
public virtual GameObject createHintText( string txt, string holderName, Transform theParent, bool useGamepadIcons, bool setWidth) { if (!(txt != string.Empty)) { return((GameObject)null); } GameObject gameObject1 = new GameObject(); RectTransform rectTransform = (RectTransform)gameObject1.AddComponent(typeof(RectTransform)); rectTransform.sizeDelta = new Vector2(0.0f, 0.0f); rectTransform.SetParent(theParent, false); gameObject1.name = holderName; string[] strArray1 = txt.Split(">"[0]); float num1 = new float(); for (int index = new int(); index < strArray1.Length; ++index) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(UnityEngine.Resources.Load("HUD/HintText") as GameObject); Text component1 = (Text)gameObject2.GetComponent(typeof(Text)); string[] strArray2 = strArray1[index].Split("<"[0]); component1.text = strArray2.Length <= 1 ? strArray1[index] : strArray2[0]; gameObject2.transform.SetParent((Transform)rectTransform, false); RectTransform component2 = (RectTransform)gameObject2.GetComponent(typeof(RectTransform)); if (index > 0) { if (setWidth) { component2.anchorMin = component2.anchorMax = new Vector2(0.5f, 0.5f); } float num2 = num1; Vector2 anchoredPosition = component2.anchoredPosition; double num3 = (double)(anchoredPosition.x = num2); Vector2 vector2 = component2.anchoredPosition = anchoredPosition; } num1 += component1.preferredWidth; if (strArray2.Length > 1) { if ((UnityEngine.Object) this.inputHelperScript == (UnityEngine.Object)null) { this.inputHelperScript = (InputHelperScript)GameObject.Find("Rewired Input Manager").GetComponent(typeof(InputHelperScript)); } GameObject inputSymbol = this.inputHelperScript.GetInputSymbol(strArray2[1], !useGamepadIcons); if ((UnityEngine.Object)inputSymbol != (UnityEngine.Object)null) { RectTransform component3 = (RectTransform)inputSymbol.GetComponent(typeof(RectTransform)); component3.SetParent((Transform)rectTransform, false); if (setWidth) { component3.anchorMin = component3.anchorMax = new Vector2(0.5f, 0.5f); } float num2 = num1 + component3.sizeDelta.x / 2f - 5f; Vector2 anchoredPosition = component3.anchoredPosition; double num3 = (double)(anchoredPosition.x = num2); Vector2 vector2 = component3.anchoredPosition = anchoredPosition; num1 += component3.sizeDelta.x; } } } float num4 = rectTransform.anchoredPosition.x - num1 / 2f; Vector2 anchoredPosition1 = rectTransform.anchoredPosition; double num5 = (double)(anchoredPosition1.x = num4); Vector2 vector2_1 = rectTransform.anchoredPosition = anchoredPosition1; int num6 = -80; Vector2 anchoredPosition2 = rectTransform.anchoredPosition; double num7 = (double)(anchoredPosition2.y = (float)num6); Vector2 vector2_2 = rectTransform.anchoredPosition = anchoredPosition2; if (setWidth) { float num2 = num1; Vector2 sizeDelta = rectTransform.sizeDelta; double num3 = (double)(sizeDelta.x = num2); Vector2 vector2_3 = rectTransform.sizeDelta = sizeDelta; } return(gameObject1); }