示例#1
0
    private void Update()
    {
        if (isCounting)
        {
            if (currentTime < 0f)
            {
                GameOver();
            }
            else
            {
                DecreaseTimer();
            }
        }

        if (!bottlingActivity.gameObject.activeSelf && ResourcesMaster.GetResourceAmount("juice") >= ResourcesMaster.GetResourceData("bottle").requiredToGeneratedRatio)
        {
            bottlingActivity.gameObject.SetActive(true);
            currentProgressionState = ActivitiesProgression.Bottling;
        }

        if (Input.GetButtonDown("Reset"))
        {
            System.GC.Collect();
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }
        else if (Input.GetButtonDown("Pause"))
        {
            if (isPaused)
            {
                ClosePauseMenu();
            }
            else
            {
                OpenPauseMenu();
            }
        }
    }
示例#2
0
 protected virtual void Awake()
 {
     generatedResource = ResourcesMaster.GetResourceData(generatedResourceName);
     requiredResource  = ResourcesMaster.GetResourceData(generatedResource.requiredResourceName);
 }