public void Reset() { PlayerPrefs.DeleteAll(); SetCameraSensitivity(5); SetTickSpeed(0.25f, UIStore.GetUI <Text>("TickSpeedValue")); SetViewRange(200); }
private void Awake() { sensitivitySlider = UIStore.GetUI <Slider>("CamSensitivitySlider"); sensitivityText = UIStore.GetUI <Text>("CamSensValue"); viewRangeText = UIStore.GetUI <Text>("ViewRangeValue"); SetCameraSensitivity(PlayerPrefs.HasKey("CameraSensitivity") ? PlayerPrefs.GetInt("CameraSensitivity") : 5); SetViewRange(PlayerPrefs.HasKey("ViewRange") ? PlayerPrefs.GetInt("ViewRange") : 200); SetTickSpeed(PlayerPrefs.HasKey("TickSpeed") ? PlayerPrefs.GetFloat("TickSpeed") : 0.25f, UIStore.GetUI <Text>("TickSpeedValue")); }
private void Awake() { Updater.Register(this); command = UIStore.GetUI <InputField>("CommandInput"); error = UIStore.GetUI <Text>("CommandError"); UIStore.GetUI <Button>("CommandReadyButton").onClick.AddListener(ProcessCommand); UIStore.GetUI <Button>("CancelCommandButton").onClick.AddListener(EndCommand); Events.OnCommand += (input, args) => { EndCommand(); }; AddFunctions(); }
public void ChangeTickSpeed() { Text speedText = UIStore.GetUI <Text>("TickSpeedValue"); switch (speedText.text) { case "Fast": SetTickSpeed(0.50f, speedText); break; case "Medium": SetTickSpeed(1.0f, speedText); break; case "Slow": SetTickSpeed(0.25f, speedText); break; } }
private void Awake() { Updater.Register(this); selectedPanel = UIStore.GetUI <Image>("SelectedBlockPanel"); selectedText = UIStore.GetUI <Text>("SelectedBlockText"); reticle = new Prefab("Prefabs/Reticle").Instantiate().transform; reticleRenderer = reticle.GetComponent <Renderer>(); currentAdd = AddBlock; Events.OnCommand += (command, args) => { if (command == CommandType.ToggleReticle) { reticleEnabled = !reticleEnabled; } }; }
private void Awake() { cursor = UIStore.GetUI <Image>("Cursor").transform; Events.OnStateChange += (state) => { if (state == GameState.Paused) { Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); Cursor.lockState = CursorLockMode.None; Cursor.visible = true; } if (state == GameState.Playing) { Cursor.lockState = CursorLockMode.Locked; } }; Updater.Register(this); }
private void Start() { MapData.Load(); percentText = UIStore.GetUI <Text>("GenerationPercent"); Engine.ChangeState(GameState.MainMenu); }