public void init(BlasterAttributes blaster) { this.blaster = blaster; bolt.GetComponent <Mover> ().age = blaster.projectileAge; GameObject special = (GameObject)Instantiate(blaster.generateSpecial(), this.transform.position, this.transform.rotation); special.tag = "ActiveSpecial"; special.GetComponent <SpecialWeapon> ().activated = true; special.transform.parent = this.transform; // // // this.blaster = blaster; // bolt.GetComponent<Mover> ().age = blaster.projectileAge; // string str = blaster.generateSpecial (); // GameObject special = new GameObject (str); // special.AddComponent<>(this.GetType(str)) ; // // GameObject spec = (GameObject) Instantiate (special, this.transform.position, this.transform.rotation); // //special = gameObject.AddComponent (blaster.generateSpecial()); // spec.transform.parent = this.transform; }
public void initWeapon() { if (transform.FindChild("Weapon") != null) { Destroy(transform.GetChild(0)); //should only ever be one weapon } GameObject child = (GameObject)Instantiate(weapon, this.transform.position, this.transform.rotation); child.GetComponent <WeaponScript> ().weaponSlot = this.gameObject; child.AddComponent <BlasterWeapon>(); child.GetComponent <BlasterWeapon> ().bolt = bolt; BlasterAttributes startWep = new BlasterAttributes(); //startWep.rateOfFire = .5f; child.GetComponent <BlasterWeapon>().init(startWep); //child.GetComponent<BlasterWeapon> ().weaponSlot = this.gameObject; child.transform.parent = this.transform; }
public void init(BlasterAttributes blaster) { this.blaster = blaster; bolt.GetComponent<Mover> ().age = blaster.projectileAge; GameObject special = (GameObject) Instantiate (blaster.generateSpecial(), this.transform.position, this.transform.rotation); special.tag = "ActiveSpecial"; special.GetComponent<SpecialWeapon> ().activated = true; special.transform.parent = this.transform; // // // this.blaster = blaster; // bolt.GetComponent<Mover> ().age = blaster.projectileAge; // string str = blaster.generateSpecial (); // GameObject special = new GameObject (str); // special.AddComponent<>(this.GetType(str)) ; // // GameObject spec = (GameObject) Instantiate (special, this.transform.position, this.transform.rotation); // //special = gameObject.AddComponent (blaster.generateSpecial()); // spec.transform.parent = this.transform; }
public void initWeapon() { if (transform.FindChild("Weapon") != null) { Destroy (transform.GetChild (0));//should only ever be one weapon } GameObject child = (GameObject)Instantiate (weapon, this.transform.position, this.transform.rotation); child.GetComponent<WeaponScript> ().weaponSlot = this.gameObject; child.AddComponent<BlasterWeapon>(); child.GetComponent<BlasterWeapon> ().bolt = bolt; BlasterAttributes startWep = new BlasterAttributes (); //startWep.rateOfFire = .5f; child.GetComponent<BlasterWeapon>().init(startWep); //child.GetComponent<BlasterWeapon> ().weaponSlot = this.gameObject; child.transform.parent = this.transform; }
public void initWeapon(BlasterAttributes blaster) { }