/** * <summary>Converts the class's data into a string that can be saved.</summary> * <returns>The class's data, converted to a string</returns> */ public string GetSaveData() { string ID = ""; string convID = ""; if (isRunning) { // Unless ActionLists can be saved mid-stream, don't save info about those currently-running return(""); } string parameterData = ""; if (actionListAsset != null) { ID = AdvGame.PrepareStringForSaving(actionListAsset.name); } else if (actionList != null) { if (actionList.GetComponent <ConstantID>()) { ID = actionList.GetComponent <ConstantID>().constantID.ToString(); } else { ACDebug.LogWarning("Data for the ActionList '" + actionList.gameObject.name + "' was not saved because it has no Constant ID.", actionList.gameObject); return(""); } } if (actionList != null) { parameterData = actionList.GetParameterData(); } if (conversationOnEnd != null && conversationOnEnd.GetComponent <ConstantID>()) { convID = conversationOnEnd.GetComponent <ConstantID>().ToString(); } return(ID + SaveSystem.colon + ConvertIndicesToString() + SaveSystem.colon + startIndex + SaveSystem.colon + ((inSkipQueue) ? 1 : 0) + SaveSystem.colon + ((isRunning) ? 1 : 0) + SaveSystem.colon + convID + SaveSystem.colon + parameterData); }
/** * <summary>Converts the class's data into a string that can be saved.</summary> * <param name = "subScene">If set, only data for a given subscene will be saved. If null, only data for the active scene will be saved</param> * <returns>The class's data, converted to a string</returns> */ public string GetSaveData(SubScene subScene) { string ID = string.Empty; string convID = string.Empty; if (IsRunning()) { // Unless ActionLists can be saved mid-stream, don't save info about those currently-running return(string.Empty); } string parameterData = string.Empty; if (actionListAsset != null) { ID = AdvGame.PrepareStringForSaving(actionListAsset.name); } else if (actionList != null) { if (actionList.GetComponent <ConstantID>()) { ID = actionList.GetComponent <ConstantID>().constantID.ToString(); if (subScene == null && UnityVersionHandler.ObjectIsInActiveScene(actionList.gameObject)) { // OK } else if (subScene && UnityVersionHandler.GetSceneIndexFromGameObject(actionList.gameObject) == subScene.SceneIndex) { // OK } else { return(string.Empty); } } else { ACDebug.LogWarning("Data for the ActionList '" + actionList.gameObject.name + "' was not saved because it has no Constant ID.", actionList.gameObject); return(""); } } if (actionList != null) { parameterData = actionList.GetParameterData(); } if (conversationOnEnd && conversationOnEnd.GetComponent <ConstantID>()) { convID = conversationOnEnd.GetComponent <ConstantID>().ToString(); } return(ID + SaveSystem.colon + ConvertIndicesToString() + SaveSystem.colon + startIndex + SaveSystem.colon + ((inSkipQueue) ? 1 : 0) + SaveSystem.colon + ((isRunning) ? 1 : 0) + SaveSystem.colon + convID + SaveSystem.colon + parameterData); }