public void ExportTree(DialogueTree export) { owner = export.owner; nodes = new List <SerializableNode>(); links = new List <SerializableNode>(); tempNodes = new Dictionary <Node, SerializableNode>(); ExportNode(export.root); ExportLinks(); tempNodes = null; }
public DialogueTree ImportTree() { DialogueTree imported = null; if (nodes != null && nodes.Count > 0 && links != null) { imported = new DialogueTree(); imported.owner = owner; ImportChildNodes(imported.root, nodes[0]); ImportLinks(); } return(imported); }
public SerializableTree ExportInstance(DialogueTree export) { if (instance == this) { ExportTree(export); return(this); } else { instance.ExportTree(export); SerializableTree newPrefab = this; #if UNITY_EDITOR newPrefab = UnityEditor.PrefabUtility.ReplacePrefab(instance.gameObject, this, UnityEditor.ReplacePrefabOptions.ConnectToPrefab).GetComponent <SerializableTree>(); newPrefab.instance = instance; #endif return(newPrefab); } }