public static GameObject Model(Vector3 pos, Vector3 rot, Vector3 scale, string name) { Model model = ModelManager.models[name]; GameObject g = new GameObject(); g.Transform.Position = pos; g.Transform.Rotation = rot; g.Transform.Scale = scale; Renderer r = (Renderer)g.AddComponent <Renderer>(ComponentType.Renderer); Mesh mesh = new VoxelMesh(); mesh.Copy(model.mesh); mesh.Transform = g.Transform; r.mesh = mesh; g.Instantiate(name, GameObjectType.ENVIROMENT); return(g); }