コード例 #1
0
        // Fire vulcan weapon
        void Vulcan()
        {
            // Get random rotation that offset spawned projectile
            Quaternion offset = Quaternion.Euler(UnityEngine.Random.onUnitSphere);

            // Spawn muzzle flash and projectile with the rotation offset at current socket position
            F3DPoolManager.Pools["GeneratedPool"].Spawn(vulcanMuzzle, TurretSocket[curSocket].position,
                                                        TurretSocket[curSocket].rotation, TurretSocket[curSocket]);
            GameObject newGO =
                F3DPoolManager.Pools["GeneratedPool"].Spawn(vulcanProjectile,
                                                            TurretSocket[curSocket].position + TurretSocket[curSocket].forward,
                                                            offset * TurretSocket[curSocket].rotation, null).gameObject;

            F3DProjectile proj = newGO.gameObject.GetComponent <F3DProjectile>();

            if (proj)
            {
                proj.SetOffset(vulcanOffset);
            }

            // Emit one bullet shell
            if (ShellParticles.Length > 0)
            {
                ShellParticles[curSocket].Emit(1);
            }

            // Play shot sound effect
            F3DAudioController.instance.VulcanShot(TurretSocket[curSocket].position);

            // Advance to next turret socket
            AdvanceSocket();
        }
コード例 #2
0
        // Fire plasma gun weapon
        void PlasmaGun()
        {
            Quaternion offset = Quaternion.Euler(UnityEngine.Random.onUnitSphere);

            F3DPoolManager.Pools["GeneratedPool"].Spawn(plasmagunMuzzle, TurretSocket[curSocket].position,
                                                        TurretSocket[curSocket].rotation, TurretSocket[curSocket]);
            GameObject newGO =
                F3DPoolManager.Pools["GeneratedPool"].Spawn(plasmagunProjectile, TurretSocket[curSocket].position,
                                                            offset * TurretSocket[curSocket].rotation, null).gameObject as GameObject;
            F3DProjectile proj = newGO.GetComponent <F3DProjectile>();

            if (proj)
            {
                proj.SetOffset(plasmaOffset);
            }
            F3DAudioController.instance.PlasmaGunShot(TurretSocket[curSocket].position);
            AdvanceSocket();
        }
コード例 #3
0
ファイル: F3DFXController.cs プロジェクト: dstovell/DogFight
        // Fire seeker weapon
        void Seeker()
        {
            Quaternion offset = GetOffSet();

            F3DPoolManager.Pools["GeneratedPool"].Spawn(seekerMuzzle, TurretSocket[curSocket].position,
                                                        TurretSocket[curSocket].rotation, TurretSocket[curSocket]);
            GameObject newGO =
                F3DPoolManager.Pools["GeneratedPool"].Spawn(seekerProjectile, TurretSocket[curSocket].position,
                                                            offset * TurretSocket[curSocket].rotation, null).gameObject as GameObject;
            F3DProjectile proj = newGO.GetComponent <F3DProjectile>();

            if (proj)
            {
                proj.SetOffset(seekerOffset);
            }
            F3DAudioController.instance.SeekerShot(TurretSocket[curSocket].position);
            AdvanceSocket();
        }
コード例 #4
0
ファイル: F3DFXController.cs プロジェクト: dstovell/DogFight
        // Fire plasma gun weapon
        void PlasmaGun(LayerMask damageMask, float damage)
        {
            Quaternion offset = GetOffSet();

            F3DPoolManager.Pools["GeneratedPool"].Spawn(plasmagunMuzzle, TurretSocket[curSocket].position,
                                                        TurretSocket[curSocket].rotation, TurretSocket[curSocket]);
            Transform     newTrans = F3DPoolManager.Pools["GeneratedPool"].Spawn(plasmagunProjectile, TurretSocket[curSocket].position, offset * TurretSocket[curSocket].rotation, null);;
            GameObject    newGO    = newTrans.gameObject;
            F3DProjectile proj     = newGO.GetComponent <F3DProjectile>();

            if (proj)
            {
                proj.SetOffset(plasmaOffset);
                proj.damageMask = damageMask;
                proj.damage     = damage;
            }
            F3DAudioController.instance.PlasmaGunShot(TurretSocket[curSocket].position);
            AdvanceSocket();
        }
コード例 #5
0
ファイル: F3DFXController.cs プロジェクト: dstovell/DogFight
 public virtual void OnProjectileHit(F3DProjectile projectile, GameObject obj, Vector3 hitPoint)
 {
 }