Klak.Wiring.Patcher.PatchManager.RetrieveLastSelected C# (CSharp) Méthode

RetrieveLastSelected() public méthode

public RetrieveLastSelected ( ) : Patch
Résultat Patch
        public Patch RetrieveLastSelected()
        {
            var instance = Array.Find(
                _instances, i => i._wiringSelected
            );

            // If no instance was found, use the first entry in the array.
            if (instance == null && _instances.Length > 0)
                instance = _instances[0];

            return instance == null ? null : new Patch(instance);
        }

Usage Example

        protected virtual void OnEnable()
        {
            ResetSelection();
            _patchManager = new PatchManager();
            _nodeFactory  = new NodeFactory();
            _patchManager.Reset();
            _patch = _patchManager.RetrieveLastSelected();

            Undo.undoRedoPerformed += OnUndo;
            EditorApplication.hierarchyWindowChanged += OnHierarchyWindowChanged;
        }
All Usage Examples Of Klak.Wiring.Patcher.PatchManager::RetrieveLastSelected