예제 #1
0
 private void Awake()
 {
     // if the singleton has't been initialized yet
     if (first)
     {
         Destroy(this.gameObject);
     }
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     instance = this;
     first    = true;
     DontDestroyOnLoad(this.gameObject);
     Application.targetFrameRate = 60;
 }
예제 #2
0
    public void difficultyChange()
    {
        float f = slider.value;

        GameSingelton.changeDifficulty(f);
        GameSingelton.difficulty = f;
        if (f == 0)
        {
            difficultyText.text = "Schwierigkeitsgrad: Einfach";
        }
        else if (f == 1)
        {
            difficultyText.text = "Schwierigkeitsgrad: Normal";
        }

        else
        {
            difficultyText.text = "Schwierigkeitsgrad: Schwer";
        }

        Debug.Log(difficultyText.text);
    }