在场景中新建一个FSMSystem脚本,并复制以下的原生脚本!!!
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**
A Finite State Machine System based on Chapter 3.1 of Game Programming Gems 1 by Eric Dybsand
Written by Roberto Cezar Bianchini, July 2010
How to use:
1. Place the labels for the transitions and the states of the Finite State System
in the corresponding enums.
2. Write new class(es) inheriting from FSMState and fill each one with pairs (transition-state).