// For now he just fires his rifle. void Update() { cRifle.FAttemptFire(rPC, gShotPoint.transform.position); cRifle.mData = cRifle.FRunUpdate(cRifle.mData); mShields = RUN_UpdateShieldsData(mShields); gUI.FUpdateShieldHealthBars(mHealth, _maxHealth, mShields.mStrength, mShields._max, true); }
// Try to move towards the player, try to fire at the player. void RUN_LongRange() { Vector3 vDif = rPC.transform.position - transform.position; cRigid.velocity = vDif.normalized * spdLong; cRifle.FAttemptFire(rPC, gShotPoint.transform.position); cRifle.mData = cRifle.FRunUpdate(cRifle.mData); // Enter chase mode. if (Vector3.Distance(rPC.transform.position, transform.position) < _enterChaseDis) { Debug.Log("Enter chase state"); mState = STATE.CHASE; } }