ドキュメント

Unity Engine

Unity Engine

CloneReference()

Creates a clone of the C# object that references the same Java object.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AndroidJNIModule
public AndroidJavaObject CloneReference()

Returns

Type

Description

AndroidJavaObjectA new C# object which references the same Java object as the original instance.

Remarks

Allows you to create multiple C# instances referencing the same Java object. The Java object will be excluded from garbage collection until all the C# references to it are disposed or garbage collected. If you call this method on an AndroidJavaClass instance, the returned clone's type will also be AndroidJavaClass.