Version: 2019.1
public void SetStatic (string fieldName, FieldType val);

パラメーター

fieldNameフィールド名(例: <i>int counter;</i> であればフィールド名は "counter" です)
valフィールドに割り当てられた値。これはフィールドの型にマッチする必要があります。

説明

static のフィールドにオブジェクト型の値を設定する

フィールドの型はジェネリックス型です。

using UnityEngine;

public class Example : MonoBehaviour { // Create an object of user provided class org.example.StaticFields, // and set the value of field 'globalName'. void Start() { AndroidJavaObject javaObject = new AndroidJavaObject("org.example.StaticFields"); javaObject.Set<string>("globalName", "this_is_the_name"); } }