// Increases O2 Value when the slider reaches certain levels.
    public void IncreaseO2ValueOnButtonPress()
    {
        AudioManager.instance.PlayOneShot(AudioManager.EventType.ButtonSound);
        collectO2Controller.IncreaseO2Value(ref collectO2Config.o2Slider, collectO2Config);
        if (sliderManager.sliderData.structArray[2].slider.value == sliderManager.sliderData.structArray[2].slider.maxValue)
        {
            return;
        }

        if (collectO2Config.o2Slider.value >= 30 && goal1 == false)
        {
            sliderManager.IncreasResourceDirectly(2, 10);
            goal1 = true;

            Debug.Log("1");
        }
        if (collectO2Config.o2Slider.value >= 50 && goal2 == false)
        {
            sliderManager.IncreasResourceDirectly(2, 10);
            goal2 = true;

            Debug.Log("2");
        }
        if (collectO2Config.o2Slider.value >= 70 && goal3 == false)
        {
            sliderManager.IncreasResourceDirectly(2, 10);
            goal3 = true;
            Debug.Log("3");
        }
        if (collectO2Config.o2Slider.value >= 90 && goal4 == false)
        {
            sliderManager.IncreasResourceDirectly(2, 10);
            goal4 = true;
            Debug.Log("4");
        }
    }
Exemple #2
0
 // Comparing the texts from the inputfield to the required combination of characters
 public void CompareTexts(InputField inputField)
 {
     if (inputField.text.Length != collectPowerData.combination.Length)
     {
         collectPowerConfig.rightOrWrong.color = new Color(255, 0, 0);
         rightOrWrongMessageRoutine            = StartCoroutine(RightOrWrongMessageRoutine(collectPowerData.wrong, inputField));
         AudioManager.instance.PlayOneShot(AudioManager.EventType.NumberFeedbackBad);
         return;
     }
     if (inputField.text != collectPowerData.combination)
     {
         collectPowerConfig.rightOrWrong.color = new Color(255, 0, 0);
         rightOrWrongMessageRoutine            = StartCoroutine(RightOrWrongMessageRoutine(collectPowerData.wrong, inputField));
         AudioManager.instance.PlayOneShot(AudioManager.EventType.NumberFeedbackBad);
         return;
     }
     collectPowerConfig.rightOrWrong.color = new Color(0, 255, 0);
     rightOrWrongMessageRoutine            = StartCoroutine(RightOrWrongMessageRoutine(collectPowerData.right, inputField));
     sliderManager.IncreasResourceDirectly(1, 10f);
     AudioManager.instance.PlayOneShot(AudioManager.EventType.NumberFeedback);
 }