protected override void OnUpdateStatus() { bool visible = TerrianColliderMgr.IsVisibleFormViewer(coord); if (visible) { if (colliderMesh.hasMesh) { meshCollider.sharedMesh = colliderMesh.mesh; } else if (!colliderMesh.hasRequestedMesh) { colliderMesh.RequestMesh(mapData); } } }
void Start() { mapGenerator = FindObjectOfType <MapDataGen>(); mapGenerator.Init(); colliderMgr = TerrianColliderMgr.Instance; var colMgrTrans = new GameObject("TerrianColliders").transform; colMgrTrans.parent = transform; colMgrTrans.localPosition = Vector3.zero; colliderMgr.mapGenerator = mapGenerator; colliderMgr.meshLod = coliderMeshLod; colliderMgr.Init(colMgrTrans, viewer, MapDataGen.CHUNK_SIZE, coliderViewDist, coliderRatainDist); colliderMgr.CreateChunks(); //meshMgr.CreateChunks(); }