Esempio n. 1
0
        private void UpdateScriptObject()
        {
            var mainAssets = target as Document;
            var subAssets  = mainAssets.chapters.Where(x => x != null).ToArray();

            ScriptableObjUtility.SetSubAssets(subAssets, mainAssets, true);
        }
Esempio n. 2
0
        private void OnAddChapter(ReorderableList list)
        {
            var chapter = ScriptableObject.CreateInstance <Chapter>();

            ScriptableObjUtility.AddSubAsset(chapter, target as Document);
            prop_chapters.InsertArrayElementAtIndex(prop_chapters.arraySize);
            var prop = prop_chapters.GetArrayElementAtIndex(prop_chapters.arraySize - 1);

            prop.objectReferenceValue = chapter;
            serializedObject.ApplyModifiedProperties();
        }