How to assign methods to OnSelectedUsable through script on Proximity Selector?
Posted: Tue Apr 19, 2022 11:28 pm
Hello,
How do I assign methods from another gameobject to the proximity selector's OnSelectedUsable method?
I got this so far:
proximitySelector.onSelectedUsable.AddListener(
But then I'm completely lost. Is this even the right path to go down, or am I totally missing the right way to do this?
Thank you!
EDIT: Okay, as usual—the SECOND I post a question to a forum—I figure out a solution. For those wondering, here's what worked for me:
proximitySelector.onSelectedUsable.AddListener(delegate { someScript.someMethod(); });
I'd be curious to see if there's a better way to do this, or if there is some issue with the solution I found! Thanks again!
How do I assign methods from another gameobject to the proximity selector's OnSelectedUsable method?
I got this so far:
proximitySelector.onSelectedUsable.AddListener(
But then I'm completely lost. Is this even the right path to go down, or am I totally missing the right way to do this?
Thank you!
EDIT: Okay, as usual—the SECOND I post a question to a forum—I figure out a solution. For those wondering, here's what worked for me:
proximitySelector.onSelectedUsable.AddListener(delegate { someScript.someMethod(); });
I'd be curious to see if there's a better way to do this, or if there is some issue with the solution I found! Thanks again!