예제 #1
0
 void FireMissile(GameObject target)
 {
     missile               = (GameObject)Instantiate(weaponSystem.currentSlot.weapon, weaponSystem.weaponBay.position, weaponSystem.weaponBay.rotation);
     missileControl        = missile.GetComponent <MissileControl> ();
     missileControl.host   = this.gameObject;
     missileControl.target = target;
 }
예제 #2
0
 //Collects the specs of the currently loaded missile
 void UpdateCurrentWeapon()
 {
     if (weaponLoadout.Count() > 0)
     {
         currentSlot    = weaponLoadout.GetAt(slotIndex);
         missileControl = currentSlot.weapon.GetComponent <MissileControl> ();
         weaponRange    = missileControl.effectiveRange;
         weaponAngle    = missileControl.effectiveAngle;
     }
 }
예제 #3
0
        void FireWeapon()
        {
            int count = targetSystemUI.lockedTargets.Count > 1 ? targetSystemUI.lockedTargets.Count : 1;

            for (int i = 0; i < count; i++)
            {
                GameObject missileClone = (GameObject)Instantiate(currentSlot.weapon, weaponBay.position, weaponBay.rotation);

                MissileControl mc = missileClone.GetComponent <MissileControl> ();
                mc.host   = gameObject;
                mc.target = targetSystemUI.lockedTargets.Count > 0 ? targetSystemUI.lockedTargets [i].targetObject : null;
                currentSlot.capacity--;
            }
        }