protected virtual void Awake() { Match = this.SafeGetComponent <Match>(); #if !UNITY_EDITOR if (Prefs.Exists(_playerPrefCheck)) { _isActive = Prefs.GetBool(_playerPrefCheck); } #endif }
private void Awake() { Advertisement.Initialize("123", true); Prefs.SetBool(PrefTypeBool.LevelUnlocked, 0, true); highScoreText.text = Prefs.GetInt(PrefTypeInt.LevelBestScore, 0).ToString(); PlayLevel(0); if (!Prefs.GetBool(PrefTypeBool.TutorialWasShown, 0)) { ShowHideTutorial(true); } }
/// <summary> /// Unity Callback. Called on object instantiation. /// </summary> protected virtual void Awake() { if (Match == null) { Match = FindObjectOfType <Match>(); } #if !UNITY_EDITOR if (Prefs.HasKey(_playerPrefCheck)) { enabled = Prefs.GetBool(_playerPrefCheck); } #endif }
public void ConfigureDefaults() { if (Prefs.GetBool($"{Key}_configured")) { return; } _unsafe = true; if (InitialGrant) { Acquired = true; } if (InitialEquip && Equippable) { Equipped = true; } _unsafe = false; Prefs.SetBool($"{Key}_configured", true); Prefs.Save(); }
void CreateLastResultLine() { if (Prefs.GetBool(PrefTypeBool.LevelCompleted, currentLevelNumber)) { return; } var bestDistance = Prefs.GetFloat(PrefTypeFloat.LevelBestDistance, currentLevelNumber); if (bestDistance < 1) { return; } GameObject go = Instantiate( Storage.instance.lastResultPrefab, Vector3.up * bestDistance, Quaternion.identity, currentLevelObject.transform); go.GetComponentInChildren <Text>().text = Math.Round(bestDistance, 0).ToString() + "m"; }