void Update() { if (canMove) { Vector3 dir = CalculateVelocity(GetFeetPosition()); if (animationComponent != null) { animationComponent.NavAnimSetup(targetDirection); if (playerUnitDetected) { animationComponent.Shoot(true); if (primaryWeapon != null) { primaryWeapon.FireWeapon(targetDirection); } playerUnitDetected = false; } } //Rotate towards targetDirection (filled in by CalculateVelocity) RotateTowards(targetDirection); controller.SimpleMove(targetDirection); } }
public virtual void OnShootStart() { //robotModel. //Debug.Log ("OnShootAnimationEvent called from attackModuleIK"); currentFireArm.FireWeapon(activeNearbyThreatTarget.position - transform.position); }