Documentation

Unity Engine

Download Unity

Unity Engine

isDataComponent

Whether this Component refers to a data component instead of a native component.
Read time 1 minuteLast updated 6 hours ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public bool isDataComponent { get; }

Remarks

Passing a data component to a method that does not support it, throws a
NotSupportedException
. A data component represented by a Component can only be used from the main thread. On other threads it behaves as if it no longer exists: comparing it to
null
returns
true
, and Component.GetComponentData and Component.SetComponentData throw a
MissingReferenceException
, the same exception thrown when the data component has been removed. This property still returns
true
on any thread. The data component is not affected, so back on the main thread it is no longer equal to
null
and can be used again.