void Duplicate(Bounds b) { foreach (var m in mesh_sprites_dupes) { Destroy(m); } mesh_sprites_dupes.Clear(); foreach (var m in winter_mesh_sprites_dupes) { Destroy(m); } winter_mesh_sprites_dupes.Clear(); mesh_sprites_dupes.AddRange(BorderOverlap.Duplicate(mesh_sprites.gameObject, mesh_sprites.Bounds, b)); winter_mesh_sprites_dupes.AddRange(BorderOverlap.Duplicate(winter_mesh_sprites.gameObject, winter_mesh_sprites.Bounds, b)); }
void MakeProvinceIdTexture(ProvinceMarker pm, Vector3 offset, Transform t) { Bounds cam_bounds = CaptureCam.Bounds(offset); var pn = pm.ProvinceNumber; Color c = new Color32(0, (byte)(pn / 256), (byte)(pn % 256), 255); Debug.Assert(pn != 0); { var province_mesh = Instantiate(province_id_mesh_prefab); province_mesh.GetComponent <MeshFilter>().mesh = pm.MeshFilter.sharedMesh; var new_mat = Instantiate(province_id_mesh_prefab.sharedMaterial); new_mat.color = c; province_mesh.GetComponent <MeshRenderer>().material = new_mat; province_mesh.transform.position = offset; var bounds = province_mesh.bounds; province_mesh.transform.SetParent(t); BorderOverlap.Duplicate(province_mesh.gameObject, province_mesh.bounds, cam_bounds); } }