ドキュメント

Unity Engine

Download Unity

Unity Engine

NewObject

Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with \<init\> as the method name and void (V) as the return type.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

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

NewObject(IntPtr, IntPtr, jvalue[])

Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with \<init\> as the method name and void (V) as the return type.
public static nint NewObject(nint clazz, nint methodID, jvalue[] args)

Parameters

clazz

The Java class to instantiate.

methodID

The ID of the constructor to invoke.

args

jvalue[]
An array of arguments to pass to the constructor.

Returns

Type

Description

IntPtrA local reference to the newly constructed object.

Remarks

NewObject(IntPtr, IntPtr, Span<jvalue>)

Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling
GetMethodID
with
init
as the method name and
void (V)
as the return type.
public static nint NewObject(nint clazz, nint methodID, Span<jvalue> args)

Parameters

clazz

The Java class to instantiate.

methodID

The ID of the constructor to invoke.

An array of arguments to pass to the constructor.

Returns

Type

Description

IntPtrA local reference to the newly constructed object.

Remarks