IUnityPlayer

interface IUnityPlayer

Defines essential methods for interacting with a Unity Player instance.

Implement this interface to provide the core functionalities required to manage the Unity Player's lifecycle, handle events, and respond to system changes.

Inheritors

Functions

Link copied to clipboard
abstract fun configurationChanged(configuration: Configuration?)

Called when the device configuration changes, such as screen orientation or language.

Link copied to clipboard
abstract fun destroy()

Destroys the Unity Player, releasing all associated resources.

Link copied to clipboard
abstract fun displayChanged(displayId: Int, updatedSurface: Surface?): Boolean

Called when the display configuration changes.

Link copied to clipboard
abstract fun injectEvent(inputEvent: InputEvent?): Boolean

Injects an input event into the Unity Player for processing.

Link copied to clipboard
abstract fun kill()

Forcefully terminates the Unity Player, potentially discarding unsaved state.

Link copied to clipboard
abstract fun lowMemory()

Notifies the Unity Player of a low-memory condition. It should take appropriate actions to release unnecessary resources.

Link copied to clipboard
abstract fun onNewCurrentActivity(activity: Activity)

Called when a new Activity becomes the current foreground activity.

Link copied to clipboard
abstract fun pause()

Pauses the Unity Player, suspending its execution.

Link copied to clipboard
abstract fun quit()

Quits the Unity Player, gracefully terminating its operation.

Link copied to clipboard
abstract fun resume()

Resumes the Unity Player, allowing it to continue execution.

Link copied to clipboard
abstract fun unload()

Unloads the Unity Player, releasing resources but maintaining its state.

Link copied to clipboard
abstract fun windowFocusChanged(hasFocus: Boolean)

Called when the window containing the Unity Player gains or loses focus.