Пример #1
0
 public override void RuntimeInit(VisualEditorBehaviour owner)
 {
     base.RuntimeInit(owner);
     IsEntered           = false;
     IsFinished          = false;
     _calculatedNextNode = null;
 }
Пример #2
0
 public override void RuntimeInit(VisualEditorBehaviour owner)
 {
     base.RuntimeInit(owner);
     foreach (var n in Nodes.GetAll)
     {
         n.Parent = this;
     }
 }
        public override void OnInspectorGUI()
        {
            GUILayout.Label(_logo);

            VisualEditorBehaviour myTarget = (VisualEditorBehaviour)target;

            myTarget.Graph = (FunctionGraph)EditorGUILayout.ObjectField(new GUIContent(graphLabel), myTarget.Graph, typeof(FunctionGraph), false);

            myTarget.isDisabled = EditorGUILayout.Toggle("Is Disabled", myTarget.isDisabled);

            EditorGUIExtension.HorizontalLine(EditorGUIUtility.currentViewWidth);
        }
Пример #4
0
        public virtual void RuntimeInit(VisualEditorBehaviour owner)
        {
            if (Root == this)
            {
                LocalVariables.Reset();
                _owner          = owner;
                Variables.owner = _owner.gameObject;

                foreach (var node in ((FunctionGraph)this).Nodes.GetAll)
                {
                    node.RuntimeInit(owner);
                }
            }
            PinCollection.Parent = this;
        }
Пример #5
0
        void Init()
        {
            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                return;
            }

            InitGraph();
            InitControls();
            InitGrid();

            // If no graph is loaded
            if (_loadedGraph == null)
            {
                // Try to get a graph that is selected.
                var selection = Selection.activeObject;
                if (selection != null)
                {
                    if (selection.GetType().IsSubclassOf(typeof(Node)))
                    {
                        Node n = (Node)selection;
                        LoadGraph(n.Root);
                    }
                    else
                    {
                        var selectedGO = Selection.activeGameObject;
                        if (selectedGO != null)
                        {
                            VisualEditorBehaviour b = selectedGO.GetComponent <VisualEditorBehaviour>();
                            if (b != null && b.Graph != null)
                            {
                                LoadGraph(b.Graph);
                            }
                        }
                    }
                }
            }
        }