public Room(int width, int height, int quadSize, int borderSize, int wallHeight, IRoomInterface data) { this._roomData = data; this.width = width; this.height = height; this.borderSize = borderSize; this.quadSize = quadSize; this.wallHeight = wallHeight; gameObject = (AssetReference.instance.GetGameObjectInstance("Room")); _ceiling = gameObject.GetComponent <RoomScript>().border; _ceiling.transform.Translate(new Vector3(0.0f, wallHeight, 0.0f)); _ceilingMesh = gameObject.GetComponent <RoomScript>().border.GetComponent <MeshFilter>().mesh; _ceilingMesh.Clear(); _wall = gameObject.GetComponent <RoomScript>().wall; _wall.transform.Translate(new Vector3(0.0f, wallHeight, 0.0f)); _wallMesh = gameObject.GetComponent <RoomScript>().wall.GetComponent <MeshFilter>().mesh; _wallMesh.Clear(); _floor = gameObject.GetComponent <RoomScript>().floor; _floorMesh = gameObject.GetComponent <RoomScript>().floor.GetComponent <MeshFilter>().mesh; _floorMesh.Clear(); gameObject.GetComponent <RoomScript>().roomData = data; }
public Room(string prefab, int width, int height, int quadSize, int borderSize, int wallHeight, IRoomInterface data) { this._roomData = data; this.width = width; this.height = height; this.borderSize = borderSize; this.quadSize = quadSize; this.wallHeight = wallHeight; gameObject = GameObject.Instantiate(Resources.Load(prefab) as GameObject); _ceiling = gameObject.GetComponent <RoomScript>().border; _ceiling.transform.Translate(new Vector3(0.0f, wallHeight, 0.0f)); _ceilingMesh = gameObject.GetComponent <RoomScript>().border.GetComponent <MeshFilter>().mesh; _ceilingMesh.Clear(); _wall = gameObject.GetComponent <RoomScript>().wall; _wall.transform.Translate(new Vector3(0.0f, wallHeight, 0.0f)); _wallMesh = gameObject.GetComponent <RoomScript>().wall.GetComponent <MeshFilter>().mesh; _wallMesh.Clear(); _floor = gameObject.GetComponent <RoomScript>().floor; _floorMesh = gameObject.GetComponent <RoomScript>().floor.GetComponent <MeshFilter>().mesh; _floorMesh.Clear(); }
public RoomBorderMesh(int width, int height, int quadSize, int borderSize, int wallHeight, IRoomInterface roomData) : base(width, height, quadSize, borderSize, wallHeight) { this._roomData = roomData; }
public RoomMesh(int width, int height, int quadSize, int borderSize, int wallHeight, IRoomInterface data) { _borderMesh = new RoomBorderMesh(width, height, quadSize, borderSize, wallHeight, data); _borderMesh.Generate(); _floorMesh = new FloorMesh(width, height, quadSize, borderSize, _borderMesh.getMap()); _floorMesh.Generate(); }