文档

Unity Engine

Download Unity

Unity Engine

AddSharedComponent<T>(Entity, T)

Adds a shared component to an entity.
阅读时间1 分钟最后更新于 1 天前

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static bool AddSharedComponent<T>(Entity entity, T componentData) where T : unmanaged, ISharedComponentData

Parameters

entity

The entity.

componentData

T
The value.

Returns

Type

Description

boolFalse if the entity already had the component, in which case only its value is set.

Remarks

This is a structural change.