Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetConstructorID

Scans a particular Java class for a constructor method matching a signature.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AndroidJNIModule

GetConstructorID(IntPtr)

Scans a particular Java class for a constructor method matching a signature.
public static nint GetConstructorID(nint javaClass)

Parameters

javaClass

Raw JNI Java class object (obtained by calling AndroidJNI.FindClass).

Returns

Type

Description

IntPtr

Remarks

The signature comparison is done to allow for sub-/base-classes of the class types. If no signature is provided the first constuctor found will be returned.

GetConstructorID(IntPtr, string)

Scans a particular Java class for a constructor method matching a signature.
public static nint GetConstructorID(nint javaClass, string signature)

Parameters

javaClass

Raw JNI Java class object (obtained by calling AndroidJNI.FindClass).

signature

Constructor method signature (e.g. obtained by calling AndroidJNIHelper.GetSignature).

Returns

Type

Description

IntPtr

Remarks

The signature comparison is done to allow for sub-/base-classes of the class types. If no signature is provided the first constuctor found will be returned.

GetConstructorID(IntPtr, Object[])

Get a JNI method ID for a constructor based on calling arguments.
public static nint GetConstructorID(nint jclass, object[] args)

Parameters

jclass


Array with parameters to be passed to the constructor when invoked.

Returns

Type

Description

IntPtr

Remarks

Scans a particular Java class for a constructor method matching a signature based on passed arguments. The signature comparison is done to allow for sub-/base-classes of the class types.