UnityMessageSender

open class UnityMessageSender(receiver: String)

Sends messages to a Unity game object.

This class provides a convenient way to send messages to a specific game object within your Unity project from your Android code. You can pass method names and JSON data to trigger actions in Unity.

Parameters

receiver

The name of the Unity game object to receive the messages.

Constructors

Link copied to clipboard
constructor(receiver: String)

Functions

Link copied to clipboard
fun sendMessage(methodName: String, data: JSONObject)

Sends a message to the specified game object with a method name and JSON data.