void processTouch() { if (Input.GetButtonDown("Fire1")) { touch = (GameObject)Instantiate(touch_prefab, transform.position, Quaternion.identity); IgeneratorRef tc = (IgeneratorRef)touch.GetComponent(typeof(IgeneratorRef)); tc.SetGenerator(this); } }
void addAnySize(GameObject anySize) { float x = 6 * Random.value - 3; float y = 10 * Random.value - 5; Vector3 location; location.x = x; location.y = y; location.z = 0; GameObject newObject = (GameObject)Instantiate(anySize, location, Quaternion.identity); IgeneratorRef iGen = (IgeneratorRef)newObject.GetComponent(typeof(IgeneratorRef)); iGen.SetGenerator(this); }