{"action":"created","issue":{"url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/73","repository_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit","labels_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/73/comments","events_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/73/events","html_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/issues/73","id":156080253,"number":73,"title":"Question about Event Listeners","user":{"login":"garytyler","id":15917021,"avatar_url":"https://avatars.githubusercontent.com/u/15917021?v=3","gravatar_id":"","url":"https://api.github.com/users/garytyler","html_url":"https://github.com/garytyler","followers_url":"https://api.github.com/users/garytyler/followers","following_url":"https://api.github.com/users/garytyler/following{/other_user}","gists_url":"https://api.github.com/users/garytyler/gists{/gist_id}","starred_url":"https://api.github.com/users/garytyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garytyler/subscriptions","organizations_url":"https://api.github.com/users/garytyler/orgs","repos_url":"https://api.github.com/users/garytyler/repos","events_url":"https://api.github.com/users/garytyler/events{/privacy}","received_events_url":"https://api.github.com/users/garytyler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-21T02:59:53Z","updated_at":"2016-05-21T06:01:19Z","closed_at":null,"body":"I'm not very experienced with Event systems like this and have a few questions if you don't mind. This toolkit is a true gift to the vive dev community. Thank you!\r\n\r\nI'm using the Grabbing() and Ungrabbing() funcions from SteamVR_InteractGrab.cs to trigger SceneManager functions and other things throughout the scene (not just on the grabbed object). I also saw the Whirlygig example/script where it inherits SteamVR_InteractableObject.cs. Would it be beneficial to use something the listener example scripts you provided (that must be attached to the controller) or something like the Whirlygig example and spread the interaction scripts throughout the scene? Are there performance benefits in either? \r\n\r\nWhy is the \"new\" keyword being used in the listener example instead of just ...+= DoInteractTouch; etc.?\r\n\r\nThis question is unrelated to the others. If I pick up an object (using any of the 3 interaction modes) then set it down, I have to move my controller away from the object (out of it's trigger range?) and back again to pick it up again. Otherwise it doesn't react when trying to pick it up again. Is there any way to change this? \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/comments/220760855","html_url":"https://github.com/thestonefox/SteamVR_Unity_Toolkit/issues/73#issuecomment-220760855","issue_url":"https://api.github.com/repos/thestonefox/SteamVR_Unity_Toolkit/issues/73","id":220760855,"user":{"login":"thestonefox","id":1029673,"avatar_url":"https://avatars.githubusercontent.com/u/1029673?v=3","gravatar_id":"","url":"https://api.github.com/users/thestonefox","html_url":"https://github.com/thestonefox","followers_url":"https://api.github.com/users/thestonefox/followers","following_url":"https://api.github.com/users/thestonefox/following{/other_user}","gists_url":"https://api.github.com/users/thestonefox/gists{/gist_id}","starred_url":"https://api.github.com/users/thestonefox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thestonefox/subscriptions","organizations_url":"https://api.github.com/users/thestonefox/orgs","repos_url":"https://api.github.com/users/thestonefox/repos","events_url":"https://api.github.com/users/thestonefox/events{/privacy}","received_events_url":"https://api.github.com/users/thestonefox/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T06:01:19Z","updated_at":"2016-05-21T06:01:19Z","body":"hey @garytyler thanks for the compliments!\r\n\r\nThe grabbing/ungrabbing event is useful if you want to trigger something in a script that isn't attached to the controller object.\r\n\r\nThe Whirlygig extends the interactable object so it can add custom code to when an object is used, which is a good way to do something specific on use (or grab if that's your case). But this works because the interactable object knows which controller is doing the grabbing because the object is passed at the point of grabbing.\r\n\r\nHowever, if you had an item that needed to be affected on grab or on use (but it wasn't an interactable object) then you could use the event to know when the grab happened.\r\n\r\nA better example of this is in the touchpad walking branch. The headset collision fade throws a headset collided event when the headset hits an object, then the play area listens for that event and moves the player back to a safe location without needing to know about the headset object.\r\n\r\nEvents are just a clean way of separating and encapsulating code.\r\n\r\nAs for the grab/touch issue .I'll look into it and see what I can do to improve/fix it."}}
{"actor":{"display_login":"thestonefox"}}