In trying to write an Input Module for the Oculus Touch controllers and I’d like to know if it’s possible to create a custom Event Type (like PointerEnter, PointerClick…). This way I could detect when buttons like X or Y are pressed. It works for the trigger right now because I use PointerClick to carry the trigger push, but I’d like to add my own inputs.
I tried to inspired and mock from the Unity class ExecuteEvents but I didn’t manage to see my custom event in the list so far.
Thanks for the link. My issue here is not the mapping. Actually my issue is not directly related to the Oculus Touch, it’s more genreric about Unity. I want to create my own type of event to be used by an Event Trigger component. See in the screenshot, i want my own custom event type to be added to this list of event types.
It wasn’t easy but I found a way.
I created my own EventTrigger class by inheriting EventTrigger. Then I added my how triggers to this class.
Then I created an enum class like Unity EventTriggerType with the different possible triggers.
After I copied the UnityEditor.EventSystems.EventTriggerEditor class, created my how class and pasted the code. I modified it a little to read from my new custom EventTriggerType.
And voila!
EDIT: Ended up copying code from EventTrigger as well (no more inheritance) to have the m_Delegates object. Else names of triggers were not matching properly.
Thanks for the last message, I’m trying to do the same thing. I am new to scripting and I was wondering if you could post the script template to create a single new event that will show up in the EventTrigger dropdown menu. I tried to follow the description of the steps you took in your last message but its a bit too high level for my current knowledge level.