Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CallStatic

Call a static Java method on a class.
Read time 3 minutesLast updated 4 days ago

Definition

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

CallStatic<T>(string, `<>[])

Call a static Java method on a class.
public void CallStatic<T>(string methodName, T[] args)

Parameters

methodName

Specifies which method to call.

args

An array of parameters passed to the method.

Remarks

To call a static method with return type 'void', use the regular version.

CallStatic<T>(IntPtr, `<>[])

Call a static Java method on a class.
public void CallStatic<T>(nint methodID, T[] args)

Parameters

methodID

The ID of the method to call.

args

An array of parameters passed to the method.

Remarks

To call a static method with return type 'void', use the regular version.

CallStatic(string, Object[])

Call a static Java method on a class.
public void CallStatic(string methodName, params object[] args)

Parameters

methodName

Specifies which method to call.

An array of parameters passed to the method.

Remarks

To call a static method with return type 'void', use the regular version.

CallStatic(IntPtr, Object[])

Call a static Java method on a class.
public void CallStatic(nint methodID, params object[] args)

Parameters

methodID

The ID of the method to call.

An array of parameters passed to the method.

Remarks

To call a static method with return type 'void', use the regular version.

CallStatic<T, U>(string, `<T>[])

Call a static Java method on a class.
public ReturnType CallStatic<ReturnType, T>(string methodName, T[] args)

Parameters

methodName

Specifies which method to call.

args

An array of parameters passed to the method.

Returns

Type

Description

TThe value returned by the static Java method call.

Remarks

To call a static method with a non-void return type, use the generic version.

CallStatic<T, U>(IntPtr, `<T>[])

Call a static Java method on a class.
public ReturnType CallStatic<ReturnType, T>(nint methodID, T[] args)

Parameters

methodID

The ID of the method to call.

args

An array of parameters passed to the method.

Returns

Type

Description

TThe value returned by the static Java method call.

Remarks

To call a static method with a non-void return type, use the generic version.

CallStatic<T>(string, Object[])

Call a static Java method on a class.
public ReturnType CallStatic<ReturnType>(string methodName, params object[] args)

Parameters

methodName

Specifies which method to call.

An array of parameters passed to the method.

Returns

Type

Description

TThe value returned by the static Java method call.

Remarks

To call a static method with a non-void return type, use the generic version.

CallStatic<T>(IntPtr, Object[])

Call a static Java method on a class.
public ReturnType CallStatic<ReturnType>(nint methodID, params object[] args)

Parameters

methodID

The ID of the method to call.

An array of parameters passed to the method.

Returns

Type

Description

TThe value returned by the static Java method call.

Remarks

To call a static method with a non-void return type, use the generic version.