//Script 1
if (other.gameObject.tag == "Hat")
{
sendPickValues.Invoke(0, 1);
}
if (other.gameObject.tag == "Boot")
{
sendPickValues.Invoke(4, 1);
}
//Script 2
private void OnEnable()
{
WearableCollider.sendPickValues += GetPickValues;
}
List<int> getVal = new List<int>();
public void GetPickValues(int selection, int toadd)
{
getVal.Insert(selection,toadd);
}
I think the first value is entered after calling GetPickValues second time getting error "ArgumentOutOfRangeException: Insertion index was out of range. Must be non-negative and less than or equal to size. Parameter name: index"
Aim is to store by taking specific index and storing values inside it.I may take getVal[0] and save -1 and next I need to take getVal[5]=1. Insert function is used to insert at a specific position right?