Ejemplo n.º 1
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("Load From Index: ");
        indexSaveSlot = GUILayout.TextField(indexSaveSlot);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Player Name: ");
        Variables.playerName = GUILayout.TextField(Variables.playerName);

        GUILayout.EndHorizontal();
        GUILayout.Label("Player Level: " + Variables.playerLevel);
        GUILayout.Label("Player Experience: " + Variables.playerExpereience + " / " + Variables.playerExpereinceTillNextLevel);

        GUILayout.Label("");
        GUILayout.Label("Stats");
        GUILayout.Label("-------");
        GUILayout.Label("Move Speed: " + Variables.moveSpeed);
        GUILayout.Label("Attack Speed: " + Variables.attackSpeed);

        if (GUILayout.Button("Kill Monster"))
        {
            KillMonster();
        }
        if (GUILayout.Button("Save"))
        {
            SavedVariables.SaveVariables(int.Parse(indexSaveSlot)); // now just add an index and it will save multiple files
        }
        if (GUILayout.Button("Load"))
        {
            SavedVariables.Load(int.Parse(indexSaveSlot));
        }
    }
Ejemplo n.º 2
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Label("Player Name: ");
        Variables.playerName = GUILayout.TextField(Variables.playerName);

        GUILayout.EndHorizontal();
        GUILayout.Label("Player Level: " + Variables.playerLevel);
        GUILayout.Label("Player Experience: " + Variables.playerExpereience + " / " + Variables.playerExpereinceTillNextLevel);

        GUILayout.Label("");
        GUILayout.Label("Stats");
        GUILayout.Label("-------");
        GUILayout.Label("Move Speed: " + Variables.moveSpeed);
        GUILayout.Label("Attack Speed: " + Variables.attackSpeed);

        if (GUILayout.Button("Kill Monster"))
        {
            KillMonster();
        }
        if (GUILayout.Button("Load"))
        {
            SavedVariables.Load();
        }
        if (GUILayout.Button("Save"))
        {
            // save any time during the game
            SavedVariables.SaveVariables();
        }
    }
Ejemplo n.º 3
0
 void Start()
 {
     SavedVariables.Load(int.Parse(indexSaveSlot));  // same as before, but just throw a save index in to load from a specfic area
 }
Ejemplo n.º 4
0
 void Start()
 {
     SavedVariables.Load();  // quickly load up your variables
 }