Exemple #1
0
    // Use this for initialization of variables that rely on other objects
    void Start()
    {
        //Initializing components
        anim           = animators[0];
        selfBody       = this.GetComponent <Rigidbody2D>();
        hitboxManager  = this.GetComponent <CollisionboxManager>();
        spriteRenderer = this.GetComponent <SpriteRenderer>();

        ActionFsm = new StateMachine <Player>(this);
        State <Player> startState = new IdleState(this, this.ActionFsm);

        ActionFsm.InitialState(startState);
    }
Exemple #2
0
    // Use this for initialization of variables that rely on other objects
	void Start () {
        //Initializing components
        anim = this.GetComponent<Animator>();
        selfBody = this.GetComponent<Rigidbody2D>();
        hitboxManager = this.GetComponent<CollisionboxManager>();

        ActionFsm = new StateMachine<Player>(this);
        State<Player> startState = new IdleState(this, this.ActionFsm);
        ActionFsm.InitialState(startState);
	}