Question by
bogs101 · Dec 29, 2017 at 03:32 AM ·
arraydeclaration
How to Create a reference to an array for easier readability.
hi, I want to be able to create a reference to an array. for example if i have an array called allRays and an array item reference called i. i want to be able to write
public class test : MonoBehaviour {
RayData[] allRays;
public int rayID = 0;
// RayData thisray = allRays[rayID];
for (int i = 0; i < numOfRays; i++) { thisray = allRays[i] }
this works fine. However i want to be able to use this currentRay reference in a number of other functions without needing to write thisray = allRays[i] in every function.
Anyway of making this work.
Comment