private void Update() { var colors = button.colors; colors.colorMultiplier = PlayerPrefsExt.GetStringArray("mods", new string[0]).Contains(Mod) ? 1f : 0.5f; button.colors = colors; }
private void OnClick() { var array = PlayerPrefsExt.GetStringArray("mods", new string[0]); var list = array.ToList(); if (list.Contains(Mod)) { list.Remove(Mod); } else { list.Add(Mod); IncompatiableMods.ForEach(it => list.Remove(it)); } PlayerPrefsExt.SetStringArray("mods", list.ToArray()); }
protected override void Awake() { base.Awake(); Application.targetFrameRate = 120; IsLoaded = false; IsPlaying = false; IsCompleted = false; IsFailed = false; UnpauseCountdown = -1; PauseTime = -1; PauseDuration = 0; PauseAt = -1; // Play data var isRanked = PlayerPrefsExt.GetBool("ranked") && OnlinePlayer.Authenticated; Play = new Play(isRanked); Play.Mods = new HashSet <Mod>(PlayerPrefsExt.GetStringArray("mods", new string[0]).ToList() .ConvertAll(mod => (Mod)Enum.Parse(typeof(Mod), mod))); CytoidApplication.CurrentPlay = Play; View = new GameView(this); // Enable/disable FPS counter var fpsCounter = GameObject.FindGameObjectWithTag("FpsCounter"); if (fpsCounter != null) { fpsCounter.SetActive(PlayerPrefsExt.GetBool("fps counter")); } boundaryTopAnimator = BoundaryTop.GetComponentInChildren <Animator>(); boundaryBottomAnimator = BoundaryBottom.GetComponentInChildren <Animator>(); if (!PlayerPrefsExt.GetBool("boundaries")) { BoundaryTop.GetComponentInChildren <SpriteRenderer>().enabled = false; BoundaryBottom.GetComponentInChildren <SpriteRenderer>().enabled = false; } BackgroundCanvasHelper.SetupBackgroundCanvas(gameObject.scene); }
private void Update() { text.text = PlayerPrefsExt.GetStringArray("mods", new string[0]).Length > 0 ? "On" : "Off"; }