Altering UI Grid System for Unity 2017

Changing our project from Unity 2018 to 2017 caused a small issue with the UI grid system I created. It relied on a prefab of a UI image object, which 2017 does not play nicely with. They did not take on the positional data assigned to them on instantiation, they would simply keep the transform information of the prefab, so they would all be in the same location which does not create our nice grid.

To get around the need for a prefab, I simply created new gameObjects which then had image components added to them and attached the necessary script since our objects were relatively small and simple. This got around the issue of needing a preexisting object to instantiate in the first place.

These UI image prefabs also had an event trigger attached to them to perform the method to change their color and array value when clicked, so this also needed to be attached or emulated when creating these new objects. Instead of specifically trying to add a pointer click event trigger, I simply added an OnPointerDown method to the script already being attached to the newly created objects that would perform the array value changing method.

Links Referenced for Solution:

UI OnPointerDown Method for Unity
Create UI Elements in Unity