Create() static public méthode

static public Create ( Wiring runtimeInstance ) : Node
runtimeInstance Wiring
Résultat Node
Exemple #1
0
        // Synchronize with the source patch immediately.
        void ForceSyncNow()
        {
            // Operations on this graph are not reflected to the patch from now.
            _isEditing = false;

            // Reset the state.
            Clear(true);
            _patch = null;

            // Retrieve the patch object based on the instance ID.
            foreach (var obj in GameObject.FindObjectsOfType <Wiring.Patch>())
            {
                if (obj.GetInstanceID() == _patchInstanceID)
                {
                    _patch = obj;
                    break;
                }
            }

            // Scan the patch if available.
            if (_patch != null)
            {
                // Enumerate all the node instances.
                foreach (var i in _patch.GetComponentsInChildren <Wiring.NodeBase>())
                {
                    AddNode(Node.Create(i));
                }

                // Enumerate all the edges.
                foreach (Node node in nodes)
                {
                    node.PopulateEdges();
                }
            }

            // Operations will be reflected to the patch again.
            _isEditing = true;
        }