Klak.Wiring.Patcher.Patch.Rescan C# (CSharp) Method

Rescan() public method

public Rescan ( ) : void
return void
        public void Rescan()
        {
            _nodeList.Clear();
            _instanceIDToNodeMap.Clear();

            // Enumerate all the node instances.
            foreach (var i in _instance.GetComponentsInChildren<Wiring.NodeBase>())
            {
                var node = new Node(i);
                _nodeList.Add(node);
                _instanceIDToNodeMap.Add(i.GetInstanceID(), node);
            }
        }

Usage Example

        void OnUndo()
        {
            // We have to rescan patches and nodes,
            // because there may be an unknown ones.
            _patchManager.Reset();
            if (_patch != null && _patch.isValid)
            {
                _patch.Rescan();
            }

            // Manually update the GUI.
            Repaint();
        }
All Usage Examples Of Klak.Wiring.Patcher.Patch::Rescan