Пример #1
0
    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);
    }
Пример #2
0
    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);
    }
Пример #4
0
 protected override void OnCreateInstance()
 {
     AssetsPath.CreateAsset(this, AssetsPath.AssetName_Entries);
 }