public static MapMeshChunkLayer CreateEmpty( Material material, bool useCollider, bool useHexData, bool useUVCoordinates, bool useUV2Coordinates ) { GameObject resultObj = new GameObject("Map Mesh Chunk Layer"); MapMeshChunkLayer resultMono = resultObj.AddComponent <MapMeshChunkLayer>(); resultMono.GetComponent <MeshRenderer>().material = material; resultMono._useCollider = useCollider; if (useCollider) { resultMono._meshCollider = resultObj.AddComponent <MeshCollider>(); } resultMono._useHexData = useHexData; resultMono._useUVCoordinates = useUVCoordinates; resultMono._useUV2Coordinates = useUV2Coordinates; return(resultMono); }