public FSMTransition CreateTransition(FSStateNode from, FSStateNode to) { var transition = new FSMTransition(this, from.GUID, to.GUID); _transitions.Add(transition); return(transition); }
public FSMTransition CreateTransition(FSStateNode from, FSStateNode to) { var transition = _stateMachineGraph.CreateTransition(from, to); EditorUtility.SetDirty(_stateMachineGraph); return(transition); }
public void RemoveNode(FSStateNode node) { foreach (var transition in Connections(node).ToArray()) { RemoveTransition(transition); } _nodes.Remove(node); }
public FSStateNode CreateNode(Vector2 nodePosition, Vector2 nodeSize) { var node = new FSStateNode($"{typeof( FSStateNode ).Name}_{_nodes.Count}") { Position = new Rect(nodePosition, nodeSize), Parent = this, }; _nodes.Add(node); return(node); }
public FSMNodeView(FSStateNode stateNode) { capabilities &= ~Capabilities.Deletable; capabilities |= Capabilities.Renamable; //capabilities |= Capabilities.Resizable; _titleLable = this.Q <Label>("title-label"); StateNode = stateNode; Load(); GeneratePorts(); GenerateContent(); RefreshExpandedState(); RefreshPorts(); }
public IEnumerable <FSMTransition> Connections(FSStateNode node) => _transitions.Where(t => t.From == node || t.To == node);