In the last technical post about the Icosphere, we designed and employed a Coupled Ring Search to detect the observation region. This is the region that we will break down into descendant triangles when the observer draws near enough – and eventually, pack back up into ancestor triangles when the observer retreats far enough.
At this point, we have an Icosphere which we can uniformly recurse to any depth we like. We also know that we can asymetrically recurse any arbitrary face of the icosphere, but we have no system for detecting or determining which face(s) to recurse. Ultimately, we want the faces directly "below" the observer to be the faces under recursion - and the rest of the icosphere to remain unaffected.
We now have all of the information we need to harvest our mesh data from the Abstract Icosphere. We will begin with a simple Awake() method, which Unity will run before all else on program start. This awake method will initialize the icosphere, acquisition the Mesh from the Game Object to which this script is attached, initialize a few other variables which we'll come to later, and call our heavier methods, HarvestMeshData and CreateMesh.