AddTransition() public method

public AddTransition ( string stateLabel, AState, state ) : void
stateLabel string
state AState,
return void
Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        number = 0;
        anim   = GetComponent <Animator>();

        AState running = new AState("running", typeof(Running));
        AState hurt    = new AState("hurt", typeof(Hurt));
        AState dead    = new AState("dead", typeof(Dead));

        r = new ASymbol("run man");
        o = new ASymbol("ouch man");
        d = new ASymbol("dead man");

        running.AddTransition(o, hurt);
        running.AddTransition(d, dead);

        hurt.AddTransition(r, running);
        hurt.AddTransition(d, dead);

        current = running;

        currentBehaviour = gameObject.AddComponent(current.Behaviour) as MonoBehaviour;
    }