Documentation

Unity Engine

Download Unity

Unity Engine

RemoveComponentData<T>()

Removes the ComponentData T, an IComponentData, from the GameObject this Component is attached to.
Read time 1 minuteLast updated 6 hours ago

Definition

public bool RemoveComponentData<T>() where T : unmanaged, IComponentData

Returns

Type

Description

boolFalse if the GameObject didn't have the ComponentData.

Remarks

Throws an
ArgumentException
if the GameObject has been destroyed.
This is a structural change: it waits for all jobs in the World to complete. To make it from a job or a system without waiting, record it in a
Unity.Entities.EntityCommandBuffer
instead.