/** * <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); }
public override string SaveData() { ActionList actionList = GetComponent <ActionList>(); if (actionList == null) { return(string.Empty); } ActionListParamData data = new ActionListParamData(); data.objectID = constantID; data.savePrevented = savePrevented; data.paramData = actionList.GetParameterData(); return(Serializer.SaveScriptData <ActionListParamData> (data)); }
/** Updates the internal record of the ActionList's current parameter data **/ public void UpdateParameterData() { parameterData = actionList.GetParameterData(); }