예제 #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
파일: Activity.cs 프로젝트: vinipc/Projeto4
 protected virtual void Awake()
 {
     generatedResource = ResourcesMaster.GetResourceData(generatedResourceName);
     requiredResource  = ResourcesMaster.GetResourceData(generatedResource.requiredResourceName);
 }