Пример #1
0
 protected virtual void ShootAtPlayer()
 {
     if (PlayerPosUtil.GetAngleToPlayer(transform) <= shootAngle && hasPlayerInSight)
     {
         weapon.Fire();
     }
 }
    private float?GetAngleToTarget()
    {
        if (weapon == null || weapon is MeleeWeapon)
        {
            return(PlayerPosUtil.GetAngleToPlayer(transform));
        }
        Vector2?targetDirection = GetTargetDirection();

        return(Vector2.Angle(targetDirection.Value, transform.right));
    }