// Use this for initialization void Start () { this.transform.SetParent(GameObject.Find ("Battlefield").transform); //get movement speeds from thrusters thrusters = Instantiate(ThrusterPrefab); WeaponA.transform.parent = gameObject.transform; WeaponA.transform.localPosition = WeaponAPrefab.transform.localPosition; WeaponW.transform.parent = gameObject.transform; WeaponW.transform.localPosition = WeaponWPrefab.transform.localPosition; WeaponD.transform.parent = gameObject.transform; WeaponD.transform.localPosition = WeaponDPrefab.transform.localPosition; WeaponS.transform.parent = gameObject.transform; WeaponS.transform.localPosition = WeaponSPrefab.transform.localPosition; }
// Use this for initialization void Start () { //Assign as parent to AllyObjects transform gameObject.transform.parent = GameObject.Find("AllyObjects").transform; gameObject.transform.localPosition = new Vector3(0,0,20); //Add weapons as children WeaponA.transform.parent = gameObject.transform; WeaponA.transform.localPosition = WeaponAPrefab.transform.localPosition; WeaponW.transform.parent = gameObject.transform; WeaponW.transform.localPosition = WeaponWPrefab.transform.localPosition; WeaponD.transform.parent = gameObject.transform; WeaponD.transform.localPosition = WeaponDPrefab.transform.localPosition; WeaponS.transform.parent = gameObject.transform; WeaponS.transform.localPosition = WeaponSPrefab.transform.localPosition; //Only Katai should maintain their 4 weapons sprites holder thing //get movement speeds from thrusters thrusters = Instantiate(ThrusterPrefab); }