Duplicate and separate triangles from a mesh

I have an icosphere class that I’m trying to use as a grid of sorts (Think Civilization on a sphere). I can create and subdivide the icosphere already and I have a stored List of the vertices and triangles.

Where I’m running into trouble is separating those triangles and making each into its own “Tile” gameObject that can have its own parameters and material.

I would try something as simple as:

`public List < Tile > tiles;

foreach( var tri in triIndex ) {

 tiles.AddTile( new Tile( tri.v1, tri.v2, tri.v3 ));

}`

…but I can’t use “new” to create MonoBehaviour inheritors, and I need that functionality.

If anyone has a solution, or can offer any wisdom at all, it would be greatly appreciated.

You don’t really give me enough code here to parse what you are doing and what you want to do. Assuming that ‘Tile’ is a component, you can do something like:

GameObject go = new GameObject();
Tile tile = go.AddComponent<Tile>();
tile.SetVertices(tri.v1, tri.v2, tri.ve);
tiles.Add(tile);

SetVertices() is a method you’d have to write for the Tile class. Note you would also have to change the first line to:

public List<Tile> tiles = new List<Tile>();

Again this is just a guess based on incomplete information about your problem.