| fieldName | フィールド名(例: <i>int counter;</i> であればフィールド名は "counter" です) |
| val | フィールドに割り当てられた値。これはフィールドの型にマッチする必要があります。 |
static でないフィールドに値を設定する
フィールドの型はジェネリックス型です。
// Create a android.text.format.Time object, and set the 'allDay' field to true.
function Start() {
var jo = new AndroidJavaObject("android.text.format.Time");
jo.Set.<boolean>("allDay", true);
}
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void Start() { AndroidJavaObject jo = new AndroidJavaObject("android.text.format.Time"); jo.Set<bool>("allDay", true); } }