Exemplo n.º 1
0
        public static EditorCache SaveCanvas(string filePath, bool createCopy, EditorCache cache)
        {
            if (!ValidPath(ref filePath))
            {
                Debug.LogError("the file path: " + filePath + ", does not exist");
                return(cache);
            }
            Reset();

            if (createCopy)
            {
                CopyRefs(cache);
                cache = ReplaceSO(cache) as EditorCache;
                ReplaceRefs(cache);
            }
            SaveAsset(cache, filePath);

            foreach (ScriptableObject objRef in cache.GetAllReferences(true))
            {
                if (!objRef)
                {
                    throw new UnityException("' " + objRef.GetType() + "' Database is missing reference. Cannot save the dialogue canvas.");
                }
                SaveRefs(objRef, cache, false);
            }
            DialogueEditorGUI.Save();
            return(cache);
        }
Exemplo n.º 2
0
        public static void SaveObjects(ScriptableObject subObj, ScriptableObject mainObj)
        {
            if (!subObj || !mainObj)
            {
                throw new UnityException("The " + (!subObj ? "sub" : "main") + " object is missing reference. Cannot save the object's references.");
            }

            if (!AssetDatabase.Contains(mainObj) || AssetDatabase.Contains(subObj))
            {
                return;
            }
            Reset();
            SaveRefs(subObj, mainObj, false);
            DialogueEditorGUI.Save();
        }