Пример #1
0
 public void Reset()
 {
     PlayerPrefs.DeleteAll();
     SetCameraSensitivity(5);
     SetTickSpeed(0.25f, UIStore.GetUI <Text>("TickSpeedValue"));
     SetViewRange(200);
 }
Пример #2
0
    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"));
    }
Пример #3
0
    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();
    }
Пример #4
0
    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;
        }
    }
Пример #5
0
    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;
            }
        };
    }
Пример #6
0
    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);
    }
Пример #7
0
 private void Start()
 {
     MapData.Load();
     percentText = UIStore.GetUI <Text>("GenerationPercent");
     Engine.ChangeState(GameState.MainMenu);
 }