Here is my code:
ShopButton[] allButtons = FindObjectsOfType<ShopButton> ();
for (int i = 0; i < allButtons.Length; i++)
{
allButtons [i].UpdateButtonState ((GameDataManager.publicInstance.skinAvailability & 1 << allButtons [i - 1].ninjaNumber) == 1 << allButtons [i - 1].ninjaNumber);
}
When I run it this code gives me an IndexOutOfRangeException.
iwill be 0 andi - 1will be -1, which is not a valid index for an array. - Ian H.