コード例 #1
0
 /// <summary>
 /// Fires the weapon's primary feature
 /// </summary>
 void IWeapon.BeginFiringPrimary(WeaponFiringDirection firingDirection)
 {
     float lifeTime = 2.0f;
     float launchForceMagnitude = 8.0f;
     LaunchProjectile(bulletPrefabName, muzzleTip.position, transform.parent.parent.localRotation,
         lifeTime, transform.right * launchForceMagnitude);
 }
コード例 #2
0
ファイル: EnemyDynamite.cs プロジェクト: Gamieon/PaperCowboys
 /// <summary>
 /// Fires the weapon's primary feature
 /// </summary>
 void IWeapon.BeginFiringPrimary(WeaponFiringDirection firingDirection, Color color)
 {
     float lifeTime = 1.0f;
     float launchForceMagnitude = 5.0f;
     LaunchProjectile(bulletPrefabName, muzzleTip.position, transform.parent.parent.localRotation,
         lifeTime, Vector3.up * 10.0f + transform.right * launchForceMagnitude, color);
 }
コード例 #3
0
ファイル: PlayerPistol.cs プロジェクト: Gamieon/PaperCowboys
 /// <summary>
 /// Fires the weapon's primary feature
 /// </summary>
 void IWeapon.BeginFiringPrimary(WeaponFiringDirection firingDirection)
 {
     float lifeTime = 0.75f;
     float launchForceMagnitude = 10.0f;
     Vector3 v = (firingDirection == WeaponFiringDirection.LocalAxis) ? transform.right : new Vector3(transform.right.x,0,0).normalized;
     LaunchProjectile(bulletPrefabName, muzzleTip.position, transform.parent.parent.localRotation,
         lifeTime, v * launchForceMagnitude);
 }
コード例 #4
0
ファイル: PlayerShotgun.cs プロジェクト: Gamieon/PaperCowboys
 /// <summary>
 /// Fires the weapon's primary feature
 /// </summary>
 void IWeapon.BeginFiringPrimary(WeaponFiringDirection firingDirection)
 {
     if (CanFire)
     {
         float lifeTime = 0.6f;
         float launchForceMagnitude = 10.0f;
         for (int i=0; i < shellsPerShot; i++)
         {
             Vector3 v = (firingDirection == WeaponFiringDirection.LocalAxis) ? transform.right : new Vector3(transform.right.x,0,0).normalized;
             Vector3 f = v * launchForceMagnitude;
             f = Quaternion.AngleAxis(Mathf.Lerp(-30.0f,30.0f,(float)i / (shellsPerShot-1)),Vector3.forward) * f;
             LaunchProjectile(bulletPrefabName, muzzleTip.position, transform.parent.parent.localRotation,
                 lifeTime, f);
             // If this isn't the final shot, we have to reset the timer
             if (i < shellsPerShot - 1) {
                 ResetTimeLastFired();
             }
         }
     }
 }
コード例 #5
0
ファイル: EnemyKnife.cs プロジェクト: Gamieon/PaperCowboys
 /// <summary>
 /// Fires the weapon's primary feature
 /// </summary>
 void IWeapon.BeginFiringPrimary(WeaponFiringDirection firingDirection)
 {
     // Knives do not have projectiles
 }