private void Attack(DLC_StateController controller)
    {
        RaycastHit hit;

        Debug.DrawRay(controller.eyes.position, controller.eyes.forward.normalized * controller.enemyStats.attackRange, Color.red);

        if (Physics.SphereCast(controller.eyes.position, controller.enemyStats.lookSphereCastRadius, controller.eyes.forward, out hit, controller.enemyStats.attackRange) &&
            hit.collider.CompareTag("Player"))
        {
            if (controller.CheckIfCountDownElapsed(controller.enemyStats.attackSpeed))
            {
                //controller.[enter attack script here].Fire(controller.enemyStats.attackforce, controller.enemyStats.attackspeed);
            }
        }
    }
Example #2
0
 private bool Scan(DLC_StateController controller)
 {
     controller.navMeshAgent.isStopped = true;
     controller.transform.Rotate(0, controller.enemyStats.searchTurnSpeed * Time.deltaTime, 0);
     return(controller.CheckIfCountDownElapsed(controller.enemyStats.searchLength));
 }