Example #1
0
 private void CopyManager(GameManager mngr)
 {
     _mFileManager = mngr._mFileManager;
     _mSaveScript  = mngr._mSaveScript;
     _mPath        = mngr._mPath;
     _loadFile     = mngr._loadFile;
 }
        void Start()
        {
            m_LastInterval   = Time.realtimeSinceStartup;
            m_Frames         = 0;
            avgfps           = 60;
            averageFramerate = 60;

            if (saveAndLoadScript == null)
            {
                saveAndLoadScript = GameObject.Find("SaveAndLoad").GetComponent <SaveAndLoadScript> ();
                saveAndLoadScript.framerateScript = this;
            }
        }
Example #3
0
 void Awake()
 {
     Instance = this;
 }
Example #4
0
 void Start()
 {
     // Find the saving script.
     saveAndLoadScript = GameObject.Find("SaveAndLoad").GetComponent <SaveAndLoadScript> ();
 }
Example #5
0
    void OnGUI()
    {
        savescript = FindObjectOfType <SaveAndLoadScript> ();
        //SaveAndLoadScript savescript = (SaveAndLoadScript)FindObjectOfType (typeof(SaveAndLoadScript));

        GUILayout.Label("Add/Remove your save files here.", EditorStyles.boldLabel);

        var style = new GUIStyle(GUI.skin.button);

        style.normal.textColor = Color.black;
        style.stretchWidth     = true;
        style.alignment        = TextAnchor.MiddleCenter;

        GUI.backgroundColor = new Color(0.75f, 0.75f, 1, 1);

        if (GUILayout.Button("Save Player Data", style))
        {
            savescript.SavePlayerData();
        }

        if (GUILayout.Button("Load Player Data", style))
        {
            savescript.LoadPlayerData();
        }

        GUI.backgroundColor = new Color(0.4f, 0.9f, 1, 1);

        if (GUILayout.Button("Save Settings Data", style))
        {
            savescript.SaveSettingsData();
        }

        if (Application.isPlaying == true)
        {
            if (GUILayout.Button("Load Settings Data", style))
            {
                savescript.LoadSettingsData();
            }
        }

        GUI.backgroundColor = new Color(0.5f, 1, 0.5f, 1);

        if (GUILayout.Button("Create Player Data", style))
        {
            savescript.SavePlayerData();
        }

        if (GUILayout.Button("Create Settings Data", style))
        {
            savescript.SaveSettingsData();
        }

        GUI.backgroundColor = new Color(1, 0.5f, 0.5f, 1);

        if (GUILayout.Button("Delete Player Data (Editor)", style))
        {
            savescript.DeletePlayerDataEditor();
        }

        if (GUILayout.Button("Delete Player Data", style))
        {
            savescript.DeletePlayerDataMain();
        }

        if (GUILayout.Button("Delete Settings Data (Editor)", style))
        {
            savescript.DeleteSettingsDataEditor();
        }

        if (GUILayout.Button("Delete Settings Data", style))
        {
            savescript.DeleteSettingsDataMain();
        }

        GUI.backgroundColor = new Color(0.75f, 0.75f, 0.75f, 1);

        if (GUILayout.Button("Reset Leaderboards", style))
        {
            savescript.ResetAllLeaderboards();
        }

        GUI.backgroundColor = Color.white;
    }
Example #6
0
 private void Start()
 {
     _mSaveScript = gameObject.AddComponent <SaveAndLoadScript>();
 }
Example #7
0
 void Awake()
 {
     Instance = this;
     // DontDestroyOnLoad (gameObject);
 }