static void CreateStateTable() { string outpath = GetCreatePath(); //Debug.Log("setpath=" + path); FB.FFSM.StateTable config = ScriptableObject.CreateInstance <FB.FFSM.StateTable>(); AssetDatabase.CreateAsset(config, outpath); }
public FightFSM(IGraphChar player, ILogicCharDriver charLogic, StateTable table, AI_StateTable aiStateTable, TreeStateConfig stateTree, IJoyInput joy) { this.aniPlayer = player; this.charLogic = charLogic; this.stateTable = table; this.aiStateTable = aiStateTable; InitBlockParserMap(); //StateItem 存储指令 mapState = new Dictionary <string, StateItem>(); foreach (var s in stateTable.allStates) { mapState[s.name] = s; } this.joy = joy; this.fps = aniPlayer.fps; ChangeBlock("stand", 0); mapBackState = new Dictionary <string, string>(); if (stateTree == null) { return; } foreach (var state in stateTree.states) { if (mapState.ContainsKey(state.name)) { mapBackState[state.name] = state.name;//自己就有 continue; } else { var node = stateTree.GetNode(state.name); while (node != null) { if (mapState.ContainsKey(node.name)) { break; } node = node.parent; } if (node == null) { throw new Exception("无效状态:" + state.name); } mapBackState[state.name] = node.name;//找到上层 } } //player.set }