Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        GE = FindObjectOfType <GameEngine>();
        EG = FindObjectOfType <EngineGame>();
        winR.SetActive(false);
        //Reto Random
        nombre.text = name;


        int canvas = Random.Range(0, 4);

        if (canvas == 1)
        {
            current = retoStates.Semaforo; GE.startSemaforo = true;
        }
        else if (canvas == 2)
        {
            current = retoStates.Saltos; EG.startSalto = true;
        }
        else if (canvas == 3)
        {
            current = retoStates.Sentadillas; EG.startSalto = true;
        }
        else
        {
            current = retoStates.Saltos; EG.startSalto = true;
        }
    }
Beispiel #2
0
 public void OnFinish()
 {
     if (!GE.SemaforoState() || !EG.SaltosState())
     {
         Debug.Log("Save score if finished");
         PlayerPrefs.SetInt("totalScore", 200 + PlayerPrefs.GetInt("totalScore"));
         PlayerPrefs.SetInt("retosCant", PlayerPrefs.GetInt("retosCant") + 1);
         PlayerPrefs.Save();
     }
     current = retoStates.Reco;
 }