Set
Set the value of a field in an object (non-static).
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.AndroidJNIModule
Set<T>(string, T)
Set the value of a field in an object (non-static).
public void Set<FieldType>(string fieldName, FieldType val)
Parameters
The name of the field (e.g. int counter; would have fieldName = "counter").
Remarks
The generic parameter determines the field type.
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { AndroidJavaObject javaObject = new AndroidJavaObject("android.text.format.Time"); javaObject.Set<bool>("allDay", true); }}
Set<T>(IntPtr, T)
Set the value of a field in an object (non-static).
public void Set<FieldType>(IntPtr fieldID, FieldType val)
Parameters
The ID of the field to set.
Remarks
The generic parameter determines the field type.