fieldName | フィールド名(例: <i>int counter;</i> であればフィールド名は "counter" です) |
staticのフィールドの値を取得します
フィールドの型はジェネリックス型です。
// Create an object of user provided class org.example.StaticFields, // and get the string value of field 'globalName'. function Start() { var jo = new AndroidJavaObject("org.example.StaticFields"); var globalName = jo.GetStatic.<String>("globalName"); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start() { AndroidJavaObject jo = new AndroidJavaObject("org.example.StaticFields"); string globalName = jo.GetStatic<string>("globalName"); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Start() as void: jo as AndroidJavaObject = AndroidJavaObject('org.example.StaticFields') globalName as string = jo.GetStatic[of string]('globalName')