I’m working on an RTS and the resource item keeps a dictionary of every gameobject currently harvesting it. How can I use SendMessage on the contents? Or is there some better way of doing this that I’m missing?
If you are sending the messgae to a particular game object you know, you can use a GetComponent on it and use a method like below:
void ModifyDictionary(Type value)
{
foreach(KeyValuePair<Type, Type> kvp in dict)
{
kvp.Value = value;
}
}