AndroidJavaObject.SetStatic.<FieldType> 设置静态域类型


function SetStatic.<FieldType> (fieldName : string, val : FieldType) : void

Parameters参数

  • fieldName
    The name of the field (e.g. int counter; would have fieldName = "counter")
       域的名称。
  • val
    The value to assign to the field. It has to match the field type.
          指定到域的值,它必须匹配域类型。

Description描述

Set the value of a static field in an object type.

设置一个对象类型上的静态域值。

The generic parameter determines the field type.

一般参数定义域类型。

// Create an object of user provided class org.example.StaticFields,// and set the value of field 'globalName'.//创建一个用户提供 
的类对象org.example.StaticFields//并设置域globalName的值
function Start() {var jo = new AndroidJavaObject("org.example.StaticFields");jo.Set.<string>("globalName", "this_is_the_name");}


,