Пример #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 Setup()
 {
     Script_SaveGameControl.SetPath();
     if (Control == null)
     {
         Control = this;
     }
     else if (Control != this)
     {
         Destroy(this.gameObject);
     }
 }
    public void Setup()
    {
        if (control == null)
        {
            control = this;
        }
        else if (control != this)
        {
            Destroy(this.gameObject);
        }

        SetPath();
    }
    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();
    }
    public void CopyGame(int targetSlotId)
    {
        Debug.Log("Trying to Copy");

        Script_SaveGameControl.saveSlotId = copiedSlotId;

        if (Script_SaveGameControl.Copy(copiedSlotId, targetSlotId))
        {
            // update that slot
            savedGameController
            .GetSlotTransform(targetSlotId)
            .GetComponent <Script_SavedGameTitle>()
            .InitializeState();
        }

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