I'm having trouble getting HasReceivedEvent to save the value of an event parameter in a SharedVariable indicating the MonoBehavior that sent that event.
The correct event parameter value makes it into HasReceivedEvent.ReceivedEvent(object), which calls storedValue1.SetValue(arg1). But that storedValue1 is somehow a SharedGenericVariable, whose type string field indicates "SharedGameObject". When SharedVariable<GenericVariable>.SetValue(object) assigns mValue = (T)value, it throws InvalidCastException.
My MonoBehavior subclass is called UserHost. Here I've defined a variable named hostSpeaking of type SharedUserHost:
And here I have a HasReceivedEvent conditional storing its event parameter in that SharedUserHost variable named hostSpeaking:
And here is the state of things when the typecast fails:
Why is the type I select in the Variables pane not the type that receives the value from HasReceivedEvent?
What do I need to do here instead?
Cheers,
The correct event parameter value makes it into HasReceivedEvent.ReceivedEvent(object), which calls storedValue1.SetValue(arg1). But that storedValue1 is somehow a SharedGenericVariable, whose type string field indicates "SharedGameObject". When SharedVariable<GenericVariable>.SetValue(object) assigns mValue = (T)value, it throws InvalidCastException.
My MonoBehavior subclass is called UserHost. Here I've defined a variable named hostSpeaking of type SharedUserHost:
And here I have a HasReceivedEvent conditional storing its event parameter in that SharedUserHost variable named hostSpeaking:
And here is the state of things when the typecast fails:
Why is the type I select in the Variables pane not the type that receives the value from HasReceivedEvent?
What do I need to do here instead?
Cheers,