public List <Link> GetLinksFrom() { List <Link> fromLinks = new List <Link>(); foreach (int linkID in linkIDs) { Link link = model.GetLinkFromID(linkID); if (link._from == this.ID) { fromLinks.Add(link); } } return(fromLinks); }
void OnEnable() { windowIcon = EditorGUIUtility.Load("Assets/NodeMachine/Editor/Editor Resources/State Machine Icon.png") as Texture2D; titlePlain.image = windowIcon; titleUnsaved.image = windowIcon; titleContent = titlePlain; NodeMachineGUIUtils.Init(); _propertyMenu = new PropertyMenu(this); _errorPanel = new ErrorPanel(this); Undo.undoRedoPerformed += OnUndoRedo; if (_model == null) { _model = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(_modelInstanceID), typeof(NodeMachineModel)) as NodeMachineModel; } if (_model != null) { LoadModel(_model); if (_selectedLink != null) { _selectedLink = _model.GetLinkFromID(_selectedLink.ID); } if (_selectedNode != null) { _selectedNode = _model.GetNodeFromID(_selectedNode.ID); } } else { _selectedLink = null; _selectedNode = null; } FindNodeMenuHandlers(); }