public static TerrainCollection create(TerrainConfig terrain_config, int world_size) { int terrain_size = world_size / terrain_config.chunk_size; //Debug.Log("TerrainCollectionFactory.create: terrain_size: " + terrain_size); TerrainCollection terrain_collection = new TerrainCollection(); terrain_collection.terrain_chunk_size = terrain_size; terrain_collection.terrain_chunk_offset = Mathf.FloorToInt(terrain_size / 2); terrain_collection.terrain_pos_start = terrain_collection.terrain_chunk_offset * -1; terrain_collection.terrain_pos_end = terrain_collection.terrain_chunk_offset; return(terrain_collection); }
public static void reset(GameObject game_object, TerrainConfig terrain_config, WorldConfig world_config) { terrain_parent = game_object; TerrainService.terrain_config = terrain_config; TerrainService.world_config = world_config; terrain_collection = TerrainCollectionFactory.create(terrain_config, world_config.world_size); TerrainEntityRepository.reset(world_config.world_name); texture = ConfigData.instantiate_texture2D( StrOpe.i + "/Resources/" + terrain_config.texture_filepath, terrain_config.detail_resolution, terrain_config.detail_resolution ); }