示例#1
0
 //Load the game
 IEnumerator LoadGame()
 {
     //Set io to true so we don't start until it's done and turn on the indicator
     saveFile.io = true;
     loadIndicator.SetActive(true);
     //tell save file to load
     saveFile.Load();
     while (saveFile.io)
     {
         //Debug.Log("...");
         //we're loading, just wait
         yield return(null);
     }
     //Done loading, pass out values and start
     loadIndicator.SetActive(false);
     rawFlowPlayer.startOn = saveFile.currentFlow;
     flowPlayerHandler.GetComponent <ArticyDebugFlowPlayer>().chapterIndex = saveFile.chapterIndex;
     StartGame();
 }
示例#2
0
    /**
     * In order to use the SaveObject, we need to initialize it.
     * It will create a SaveObject instance, make sure you link
     * correctly to the save object either with a string with the
     * Resources folder as root or a direct link to the prefab.
     **/
    void Start()
    {
        /**
         * You need to call SaveObject.Initialize before doing anything with SaveObject.
         **/
        if (PlayerPrefs.GetInt("usouSave") != 1)
        {
            SaveObject.Initialize(saveObject);
        }
        PlayerPrefs.SetInt("usouSave", 0);

        /**
         * Set a callback for when you load a game like this, used to do complex updates
         * when needed.
         **/
        SaveObject.SetRefreshCallback(OnRefresh);

        /**
         * It is recommended that you Load right after initialization, it makes sure that
         * you always have a game ready to be used.
         **/
        SaveObject.Load("Saved Game No1");
    }
示例#3
0
 /**
  * Load your game like this
  **/
 public void Load()
 {
     SaveObject.Load(saveName);
 }
示例#4
0
 private void Load()
 {
     SaveObject.Load(nextLoad);
     GUIUtility.keyboardControl = 0;
     Selection.activeObject     = ((SaveObject)typeof(SaveObject).GetField("instance", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null)).gameObject;
 }
 /**
  * Load your game like this
  * */
 public void Load()
 {
     SaveObject.Load();
 }