|
| 1 | +/** |
| 2 | + * The event map contains all of the keys and their respective parameter types |
| 3 | + * which can be used from adding event listeners to a Unity Context instance. |
| 4 | + */ |
| 5 | +export default interface IUnityContextEventMap { |
| 6 | + /** |
| 7 | + * While your game is being downloaded from the server and loaded into memory, |
| 8 | + * you might want to display some sort of loading indicator informing the user |
| 9 | + * of the progression. The built-in progression event listeners can be used |
| 10 | + * for such cases. On Progress is emitted while the Unity player is being |
| 11 | + * loaded. The parameter contains the progression from 0 to 1. When the game |
| 12 | + * is fully loaded into memory and will start execution, the progression will |
| 13 | + * hit 1. The event will invoke everytime the progression advances. |
| 14 | + */ |
| 15 | + progress: number; |
| 16 | + |
| 17 | + /** |
| 18 | + * While your application is being downloaded from the server and loaded into |
| 19 | + * memory, you might want to display some sort of overlay or loading screen. |
| 20 | + * The built-in loaded event listeners can be used for such cases. On Loaded |
| 21 | + * is emitted when the Unity player is loaded into memory and execution is |
| 22 | + * started. Event will be invoked only once. |
| 23 | + */ |
| 24 | + loaded: void; |
| 25 | + |
| 26 | + /** |
| 27 | + * When your Applications run into a runtime error, you might want to display |
| 28 | + * your players any kind of error screen, or debug the problem yourself. The |
| 29 | + * built-in error event listeners can be used for such cases. On Error is |
| 30 | + * emitted while the Unity Player runs into an error. This is most likely a |
| 31 | + * runtime error. The error details and stack trace are passed along via the |
| 32 | + * parameter. |
| 33 | + */ |
| 34 | + error: string; |
| 35 | + |
| 36 | + /** |
| 37 | + * The quitted event is emitted in two cases, when the Unity component is |
| 38 | + * unmounted, and when Application.Quit is invoked from within your Unity |
| 39 | + * Application. In both cases the Unity Player will be unloaded from memory. |
| 40 | + */ |
| 41 | + quitted: void; |
| 42 | +} |
0 commit comments