You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to subscribe to changes made to a custom variables made using code generation. I created a UserStatesVariable based on a UserStates class defined as follows :
public enum UserStatus { headsetOff, headsetOn, readyToStart }
public class UserStates
{
public UserStatus selfStatus;
public UserStatus otherStatus;
public bool dataCollectionConsent;
}
My StatusManager.cs script has a method that I want to assign as a dynamic UserStates method with the following signature
but changing the values of the UserStatesVariables wouldn't trigger any event.
I then tried adding the UserStatesVariable as a parameter to a GameEventListener, however, by doing so I am unable to assign the dynamic UserStatesChanged method
So I am left with using an extra event, called UserStatesGameEvent that I can use as an input to an UserStatesGameEventListener to assign to my UserStatesChanged(UserStates newState) method, which I would have liked to avoid.
Am I missing something or is it simply not possible to use a custom class as a variable that can be used to trigger events?
The text was updated successfully, but these errors were encountered:
Hi!
I'm trying to subscribe to changes made to a custom variables made using code generation. I created a UserStatesVariable based on a UserStates class defined as follows :
My StatusManager.cs script has a method that I want to assign as a dynamic UserStates method with the following signature
private void UserStatesChanged(UserStates newState)
I first tried adding the following.
but changing the values of the
UserStatesVariables
wouldn't trigger any event.I then tried adding the
UserStatesVariable
as a parameter to aGameEventListener
, however, by doing so I am unable to assign the dynamicUserStatesChanged
methodSo I am left with using an extra event, called
UserStatesGameEvent
that I can use as an input to anUserStatesGameEventListener
to assign to myUserStatesChanged(UserStates newState)
method, which I would have liked to avoid.Am I missing something or is it simply not possible to use a custom class as a variable that can be used to trigger events?
The text was updated successfully, but these errors were encountered: