Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Script_SaveGameControl control = (Script_SaveGameControl)target;

        if (GUILayout.Button("Save"))
        {
            control.Save();
        }

        if (GUILayout.Button("Delete Game Data"))
        {
            Script_SaveGameControl.Delete();
        }

        if (GUILayout.Button("ChangeSaveFileToSlot1"))
        {
            Script_SaveGameControl.saveSlotId = 1;
        }

        if (GUILayout.Button("Copy Slot 0 to 1"))
        {
            Script_SaveGameControl.Copy(0, 1);
        }
    }
    public void DeleteGame(int i)
    {
        Script_SaveGameControl.saveSlotId = i;

        if (Script_SaveGameControl.Delete())
        {
            // update that slot
            savedGameController
            .GetSlotTransform(i)
            .GetComponent <Script_SavedGameTitle>()
            .InitializeState();
        }

        // end delete mode
        State = SavedGameState.Start;
        EnterSavedGamesSelectView();
    }