private void FieldOfView() //Detecta si el enemigo esta en su rango de vista { Collider[] targetsInRadius = Physics.OverlapSphere(transform.position, viewRadius); found = false; for (int i = 0; i < targetsInRadius.Length; i++) { if (targetsInRadius[i].tag == "Player") { dirToTarget = (targetsInRadius[i].transform.position - transform.position).normalized; if (Vector3.Angle(transform.forward, dirToTarget) < viewAngle / 2) { if (!Physics.Raycast(transform.position, dirToTarget, distToTarget, stageMask)) { UpdateEnemy = AttackMode; found = true; } } } else if (i == targetsInRadius.Length - 1 && !found) { curDestination = points[pointNum].transform.position; DestinationSet(); UpdateEnemy = Patrol; } } }
public override void SetUp(EnemyDelegate enemyDelegate) { _maxArousal = 4.0f; _curArousal = 4.0f; _maxClimax = 8.0f; //set stats before base setup base.SetUp(enemyDelegate); }
public override void Start() { base.Start(); UpdateEnemy = Patrol; EnemyAI = GetComponent <NavMeshAgent>(); EnemyAI.speed = speed; target = GameObject.FindGameObjectWithTag("Player"); curDestination = points[0].transform.position; DestinationSet(); }
public virtual void SetUp(EnemyDelegate enemyDelegate) { _delegate = enemyDelegate; _card = GetComponentInChildren <ICard>(); _card.SetCardDelegate(this); _card.SetName(GetName()); //set up the climax bar _card.SetUpClimax(this, _maxClimax); _card.SetClimax(_curClimax); //set up the arousal bar _card.SetUpArousal(this, _maxArousal); _card.SetArousal(_curArousal); _state = SelectState.Norm; }
public override void SetUp(EnemyDelegate enemyDelegate) { _maxClimax = 12.0f; //set stats before base setup base.SetUp(enemyDelegate); }
public void setPlayerAttackedFunction(EnemyDelegate onPlayerAttacked) { _onPlayerAttacked = onPlayerAttacked; }
public void addClickHandler(EnemyDelegate onClicked) { _onEnemyClicked = onClicked; }