- Home /
Question by
Riiich · Sep 12, 2018 at 12:30 AM ·
editoreventevent handlers
How do you access the editor event args?
I need to access the "object" on the OnGrab event. How is this done in the method I call?
event-args.png
(45.3 kB)
Comment
Best Answer
Answer by Riiich · Aug 31, 2021 at 11:47 PM
Example method, using dynamically created args
private void DoObjectGrab(object sender, InteractableObjectEventArgs e)
{
if (e.interactingObject == controllers.left)
{
holdControl = controllers.left.GetComponent<VRTK_ControllerEvents>();
stringControl = controllers.right.GetComponent<VRTK_ControllerEvents>();
holdActions = controllers.left.GetComponent<VRTK_ControllerActions>();
stringActions = controllers.right.GetComponent<VRTK_ControllerActions>();
}
else
{
stringControl = controllers.left.GetComponent<VRTK_ControllerEvents>();
holdControl = controllers.right.GetComponent<VRTK_ControllerEvents>();
stringActions = controllers.left.GetComponent<VRTK_ControllerActions>();
holdActions = controllers.right.GetComponent<VRTK_ControllerActions>();
}
StartCoroutine("GetBaseRotation");
}