public override void Add(BaseNodule item)
        {
            if (mainNode && mainNode == item.MainNode)
            {
                base.Add(item);
                ReCalcAllNodulePos(mainNode, true);
            }
            else if (mainNodule)
            {
                if (item.Nodules.Contains(mainNodule) && !Contains(item))
                {
                    base.Add(item);
                }
                else if (NoduleTypes.CheckCompatibility(mainNodule, item))
                {
                    base.Add(item);
                    item.Nodules.Add(mainNodule);
                }

                if (mainNodule is OutputNodule)
                {
                    (mainNodule as OutputNodule).UpdateConditionalValues();
                }
                ReCalcAllNodulePos(mainNodule.MainNode, true);
            }
        }
예제 #2
0
        public static T Create <T> (string _name, BaseNode _mainNode) where T : BaseNodule
        {
            T nodule = Instantiate(NoduleTypes.GetDefaultNodule <T> ()) as T;

            nodule.Construct(_name, _mainNode);
            return(nodule);
        }
예제 #3
0
        public static T Create <T> (BaseNode _mainNode) where T : BaseNodule
        {
            T nodule = Instantiate(NoduleTypes.GetDefaultNodule <T> ()) as T;

            nodule.Construct(_mainNode.Nodules.NextItemName(nodule.GetType().Name), _mainNode);
            return(nodule);
        }
예제 #4
0
        public static BaseNodule Create(string className, string _name, BaseNode _mainNode)
        {
            BaseNodule nodule = Instantiate(NoduleTypes.GetDefaultNodule(className));

            nodule.Construct(_name, _mainNode);
            return(nodule);
        }
예제 #5
0
        public static BaseNodule Create(string className, BaseNode _mainNode)
        {
            BaseNodule nodule = Instantiate(NoduleTypes.GetDefaultNodule(className));

            nodule.Construct(_mainNode.Nodules.NextItemName(nodule.GetType().Name), _mainNode);
            return(nodule);
        }
 public static void InitCanvas()
 {
     ResourceManager.SetupPaths();
     CanvasGUI.SetupGUI();
     NodeTypes.FetchAllNodes();
     NoduleTypes.FetchAllNodules();
     OverlayMenuTypes.FetchAllOverlayMenus();
     InputSystem.SetupInputHandlers();
 }
예제 #7
0
        protected virtual void Construct(string _name, BaseNode _mainNode)
        {
            name     = _name;
            mainNode = (NoduleTypes.CheckCompatibility(_mainNode, this)) ? _mainNode : null;
            nodules  = NoduleDatabase.CreateNew(this);

            if (mainNode)
            {
                DialogueEditorGUI.Cache.SaveNewObject(this, mainNode);
            }
        }
        public override void Insert(int index, BaseNodule item)
        {
            if (mainNode == item.MainNode)
            {
                base.Insert(index, item);
                ReCalcAllNodulePos(mainNode, true);
            }
            else if (mainNodule && NoduleTypes.CheckCompatibility(mainNodule, item))
            {
                base.Insert(index, item);
                item.Nodules.Add(mainNodule);

                if (mainNodule is OutputNodule)
                {
                    (mainNodule as OutputNodule).UpdateConditionalValues();
                }
                ReCalcAllNodulePos(mainNodule.MainNode, true);
            }
        }