Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     HandleMovement();
     HandleOrientation();
     //HandleAttack();
     anim_controller.HandleAnimation(idleTimerCurrent, moveTimerCurrent);
 }
    // Update is called once per frame
    void Update()
    {
        CheckAttackRange();
        if (attacking)
        {
            HandleAttack();
        }
        else
        {
            HandleMovement();
            HandleOrientation();
            anim_controller.HandleAnimation();
        }



        /*CheckAggroRange();
         * if(chasing)
         * {
         *  Debug.Log("Enemy IN Range");
         *  chaseDirection = player.transform.position - transform.position;
         *  chaseDirection.Normalize();
         *  GetComponent<Rigidbody2D>().velocity = chaseDirection;
         * }
         * else
         * {
         *  Debug.Log("Enemy OUT of Range");
         *  HandleMovement();
         *  HandleOrientation();
         *  HandleAttack();
         *  anim_controller.HandleAnimation();
         * }*/
    }