Brent Allard
Brent Allard

Reputation: 396

How to add an Event object to Unity's EventSystem

If I have an event from Event.current and I want to 'replay' it by making the event system process it again, how do I do that? Can I access the scripts responsible for raising events?

Upvotes: 0

Views: 146

Answers (2)

Brent Allard
Brent Allard

Reputation: 396

I found a neat C# library which simulates input called Windows Input Simulator which does a good job of raising all the keyboard events I needed. Looks like it also works for things like mouse input!

Upvotes: 0

SilentSin
SilentSin

Reputation: 1036

You might be able to track down how events are created using IL Spy then use reflection to invoke that, but unfortunately there is no public API for creating events manually.

Upvotes: 1

Related Questions