using System.Collections; using System.Collections.Generic; using UnityEngine; public class Setup : MonoBehaviour { // Start is called before the first frame update void Start() { Material newMat = Resources.Load("GroundSurface", typeof(Material)) as Material; GameObject wallWest = GameObject.CreatePrimitive(PrimitiveType.Cube); wallWest.name = "wallWest"; wallWest.transform.position = new Vector3(-10, 0.5f, 0); wallWest.transform.localScale= new Vector3(1, 1, 20); wallWest.GetComponent().material = newMat; wallWest.transform.parent = this.gameObject.transform; GameObject wallEast = GameObject.CreatePrimitive(PrimitiveType.Cube); wallEast.name = "wallEast"; wallEast.transform.parent = this.gameObject.transform; wallEast.transform.position = new Vector3(10, 0.5f, 0); wallEast.transform.localScale = new Vector3(1, 1, 20); wallEast.GetComponent().material = newMat; } // Update is called once per frame void Update() { } }