GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Documentation
  • User Manual
  • Script Reference
  • Download Unity
  • Unity Engine Documentation
  • UnityEngine
  • AddComponentMenu
  • AnchoredJoint2D
  • AndroidInput
  • AndroidJavaClass
  • AndroidJavaObject
  • Call
  • CallStatic
  • CloneReference

This view

  • Original page
  • New address

GeezerVison is showing docs.unity.com — SetStatic • AndroidJavaObject • 6000.6 • Unity Editor

SetStatic

Set the value of a static field in an object type.
Read time 1 minute
Last updated 13 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AndroidJNIModule

SetStatic<T>(string, T)

Set the value of a static field in an object type.
public void SetStatic<FieldType>(string fieldName, FieldType val)

Parameters

fieldName

string
The name of the field (e.g. int counter; would have fieldName = "counter").

val

T
The value to assign to the field. It has to match the field type.

Remarks

The generic parameter determines the field type.

Examples

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"); }}

SetStatic<T>(IntPtr, T)

Set the value of a static field in an object type.
public void SetStatic<FieldType>(nint fieldID, FieldType val)

Parameters

fieldID

IntPtr
The ID of the field to set.

val

T
The value to assign to the field. It has to match the field type.

Remarks

The generic parameter determines the field type.


Report a problem with this page
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.