예제 #1
0
    private bool jumped      = false;         /*used for detecting if jump key was pressed (also used in ai)*/

    void Awake()
    {
        _controller = GetComponent <CharacterController2D>();
        _body       = GetComponent <Rigidbody2D>();
        _anim       = transform.Find("Graphics").GetComponent <Animator>();
        _graphics   = transform.Find("Graphics").gameObject; /*useful for preventing things from flipping when character is facing left*/
        _pathAgent  = GetComponent <PathFollowingAgent>();

        /*allow movement abilities to access character script*/
        jump.setCharacter(this);

        _body.isKinematic = true;
    }
예제 #2
0
 void Awake()
 {
     agent = GetComponent <PathFollowingAgent>();
 }