To test that this is working, we will pick a number, and test that we can set that dig spot to have treasure. We’ll start with the number 2, which is the maximum number if you have 3 dig spots (because array indices start at 0).
- In TreasureControllerScript, find the randomizeTreasure function.
After the console.log, send an event to digSpots[2] (the third dig spot), with “setHasTreasure” for the name of the function, and true for the value of its parameter.