Beispiel #1
0
    void OnGUI()
    {
        if (GUI.Button(new Rect(10, 10, 100, 30), showDebug? "Hide Debug" : "Show Debug"))
        {
            showDebug = !showDebug;
        }

        if (showDebug)
        {
            if (GUI.Button(new Rect(10, 50, 120, 30), "Clear Saved Data"))
            {
                SaveAndLoad.ClearData();
                SaveAndLoad.Load();
            }

            barrelsBeatStr = GUI.TextField(new Rect(10, 90, 70, 20), barrelsBeatStr);

            if (GUI.Button(new Rect(90, 90, 40, 30), ">>"))
            {
                barrelsBeat        = int.Parse(barrelsBeatStr);
                initialBarrelsBeat = barrelsBeat;
            }

            GUI.Label(new Rect(Screen.width - 100, 80, 500, 30), "-- Info -- ");
            GUI.Label(new Rect(Screen.width - 100, 100, 500, 30), "Curr Barrel: " + (barrels.IndexOf(barrelHolingPlayer) + 1));
            GUI.Label(new Rect(Screen.width - 100, 120, 500, 30), "Prev Barrel: " + (barrels.IndexOf(prevBarrelHoldingPlayer) + 1));
            GUI.Label(new Rect(Screen.width - 100, 140, 500, 30), "Lst N of JB: " + lastBarrelsJumped.Count);
            GUI.Label(new Rect(Screen.width - 100, 160, 500, 30), "Game TIme: " + Mathf.Floor(Time.realtimeSinceStartup));
            GUI.Label(new Rect(Screen.width - 100, 180, 500, 30), "Barrls Beat: " + barrelsBeat);
            GUI.Label(new Rect(Screen.width - 100, 200, 500, 30), "Record: " + DifficultyManager.barrelsBeatRecord);
            GUI.Label(new Rect(Screen.width - 100, 220, 500, 30), "Difficulty: " + DifficultyManager.currentDifficulty);
            GUI.Label(new Rect(Screen.width - 100, 240, 500, 30), "CurrB Diff: " + (barrelHolingPlayer ? "" + barrelHolingPlayer.GetComponent <Barrel>().difficulty : "N/A"));
        }
    }