public EntryComponent AddObserver() { //var instance = (EntryComponent)TemplateInstance.Clone(); //ObserversList.Add(instance); //return instance; var instance = (EntryComponent)TemplateInstance.Clone(); AssetsPath.CreateAsset(instance, AssetsPath.AssetName_ComponentsObservers); ObserversList.Add(instance); return(instance); }
public new static EntryComponent CreateInstance(Type t) { if (t.IsAbstract || t.IsNotPublic) { return(null); } var value = (EntryComponent)ScriptableObject.CreateInstance(t); AssetsPath.CreateAsset(value, AssetsPath.AssetName_Components); value.Initialize(); return(value); }
public Entry_Components AddObserver() { Entry_Components componentEntry = ScriptableObject.CreateInstance <Entry_Components>(); AssetsPath.CreateAsset(componentEntry, AssetsPath.AssetName_TemplateEntryObserver); //add observer components ComponentTemplatesList.ForEach(x => componentEntry.Componets.Add(x.AddObserver())); //set observer settings componentEntry.ShowAddButton = componentEntry.ShowRemoveButton = componentEntry.ShowDraggableButton = componentEntry.ShowEditModeOption = false; //add observer to list ObserversList.Add(componentEntry); return(componentEntry); }
protected override void OnCreateInstance() { AssetsPath.CreateAsset(this, AssetsPath.AssetName_Entries); }