Beispiel #1
0
    public static void AddOrbitalGun(OrbitalGunsControllerGeneric self, WeaponRotator rotator, OrbitalWeaponGeneric gunPrefab)
    {
        OrbitalWeaponGeneric ow = Instantiate(gunPrefab, self.transform.position, Quaternion.identity) as OrbitalWeaponGeneric;

        ow.transform.parent     = self.transform;
        ow.OrbitBase            = self.transform;
        ow.Rotator              = rotator;
        ow.parentTowerComponent = self;
        ow.name = gunPrefab.name + UnityEngine.Random.Range(10, 100000);
        self.OrbitalGuns.Add(ow);
        rotator.AddOrbital(ow);
    }
 // Use this for initialization
 void Start()
 {
     rotator = GetComponent <WeaponRotator>();
 }