// Use this for initialization void Start() { //Getting the plane (which i'm using as a background) to show up in the scene planeObject = (GameObject)Instantiate(planePrefab, new Vector3(0, 0, 0), Quaternion.identity); //Changing its colour planeObject.GetComponent <Renderer> ().material.color = Color.green; //Actually linking the variable 'holderScript' to the real script holderScript = staticHolder.GetComponent <staticHolderScript> (); }
// Use this for initialization void Start() { //Actually linking the variable 'holderScript' to the real script holderScript = staticHolder.GetComponent <staticHolderScript> (); //Getting the cube to show up in the scene cube = (GameObject)Instantiate(cubePrefab, new Vector3(0, 0, 0), Quaternion.identity); //Getting access to the functions inside the cubeScript.cs class cubeScript = cube.GetComponent <cubeScript> (); }