void OnClickLod0(Vector2 screenPos) { Ray ray = MapCamera.ScreenPointToRay(screenPos); RaycastHit[] hits = Physics.RaycastAll(ray); // map space Coord c = Layout.ScreenPos2Coord(MapCamera, screenPos); DoClickOnTile(c); }
void OnClickLod1(Vector2 screenPos) { Coord coord = Layout.ScreenPos2Coord(MapCamera, screenPos); Ray ray = MapCamera.ScreenPointToRay(screenPos); RaycastHit[] hits = Physics.RaycastAll(ray); // MyCityFlag foreach (RaycastHit hit in hits) { if (hit.collider.gameObject == Lod1.MyCityFlag) { coord = GameFacade.GetProxy <CityProxy>().myCityCoord; break; } } coord.x = Mathf.Clamp(coord.x, 0, MapConst.MAP_WIDTH); coord.y = Mathf.Clamp(coord.y, 0, MapConst.MAP_HEIGHT); Vector3 wp = GetCameraPosWhenLookAt(coord, MapView.CameraHeightInit); StartCoroutine(Lod1to0(wp)); }