/// <summary> /// get the top position y of the scene (include the building) /// </summary> /// <returns></returns> public static float GetPosTop(IntVector2 worldPosXZ, out bool canGenNpc) { //int x = worldPosXZ.x >> VoxelTerrainConstants._shift; //int z = worldPosXZ.y >> VoxelTerrainConstants._shift; float top = GetPosHeight(worldPosXZ, true); float townHeight = VArtifactUtil.IsInTown(worldPosXZ); if (townHeight != 0) { if (top < townHeight) { top = townHeight; } canGenNpc = false; return(top + 1.5f); } if (IsSea(Mathf.FloorToInt(top))) { canGenNpc = false; return(top + 1.5f); } canGenNpc = true; return(top + 1.5f); }
public static float GetPosHeightWithTown(IntVector2 worldPosXZ, bool InWater = false) { float top = GetPosHeight(worldPosXZ, InWater) + 1.5f; float townHeight = VArtifactUtil.IsInTown(worldPosXZ); if (townHeight != 0) { if (top < townHeight) { top = townHeight; } } return(top); }
public static float GetPosTop(IntVector2 worldPosXZ) { //int x = worldPosXZ.x >> VoxelTerrainConstants._shift; //int z = worldPosXZ.y >> VoxelTerrainConstants._shift; float top = GetPosHeight(worldPosXZ) + 1.5f; float townHeight = VArtifactUtil.IsInTown(worldPosXZ); if (townHeight != 0) { if (top < townHeight) { top = townHeight + 1.5f; } return(top); } return(top); }