Пример #1
0
    private void Start()
    {
        SaveGame.Load();
        Unlocks.RefreshUnlocked();

        MusicManagerScript.Instance.SetVolume(SaveGame.Members.VolumeMusic);
        AudioManager.Instance.SetVolume(SaveGame.Members.VolumeSfx);

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Confined;
        StartCoroutine(ServerColdStart());
        ShowTitle();
        StartCoroutine(GameStateCo());
    }
Пример #2
0
    void Update()
    {
        if (Input.GetKey(Code[codeIdx]))
        {
            codeIdx++;
            if (codeIdx == Code.Length)
            {
                codeIdx = 0;
                SaveGame.ResetAll();
                SaveGame.Save();
                Unlocks.RefreshUnlocked();
                return;
            }
        }

        if (Input.GetKeyDown(KeyCode.I) && GameState != State.Intro_Sandbox)
        {
            TextFps.enabled = !TextFps.enabled;
        }

        if (TextFps.enabled)
        {
            TextFps.text = string.Format("{0} fps", Mathf.RoundToInt(1.0f / Time.unscaledDeltaTime));
        }

        if (Input.GetKeyDown(KeyCode.F) && GameState != State.Intro_Sandbox)
        {
            Screen.fullScreen = !Screen.fullScreen;
        }

        Vector3 worldPos = Input.mousePosition;

        worldPos.z               = 0;
        Crosshair.position       = worldPos;
        CrosshairWorldPosition   = Camera.main.ScreenToWorldPoint(worldPos);
        CrosshairWorldPosition.z = 0.0f;
    }