文档

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.