Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
 public virtual void OnShootStart()
 {
     //robotModel.
     //Debug.Log ("OnShootAnimationEvent called from attackModuleIK");
     currentFireArm.FireWeapon(activeNearbyThreatTarget.position - transform.position);
 }