コード例 #1
0
        public FSMTransition CreateTransition(FSStateNode from, FSStateNode to)
        {
            var transition = new FSMTransition(this, from.GUID, to.GUID);

            _transitions.Add(transition);
            return(transition);
        }
コード例 #2
0
        public FSMTransition CreateTransition(FSStateNode from, FSStateNode to)
        {
            var transition = _stateMachineGraph.CreateTransition(from, to);

            EditorUtility.SetDirty(_stateMachineGraph);
            return(transition);
        }
コード例 #3
0
 public void RemoveNode(FSStateNode node)
 {
     foreach (var transition in Connections(node).ToArray())
     {
         RemoveTransition(transition);
     }
     _nodes.Remove(node);
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
 public IEnumerable <FSMTransition> Connections(FSStateNode node) => _transitions.Where(t => t.From == node || t.To == node);