ドキュメント

Unity Engine

Download Unity

Unity Engine

TryGetTransform

Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

TryGetTransform(Entity, TransformRef)

Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved.
public bool TryGetTransform(Entity entity, out TransformRef transform)

Parameters

entity

The entity.

transform

The transform component of type T for the given entity, if it exists.

Returns

Type

Description

boolTrue if the entity has a TransformRef component, and false if it does not. Also returns false if the Entity instance refers to an entity that has been destroyed (or never existed).

TryGetTransform(Entity, TransformRef, bool)

Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved.
public bool TryGetTransform(Entity entity, out TransformRef transform, out bool entityExists)

Parameters

entity

The entity.

transform

The transform component of type T for the given entity, if it exists.

entityExists

Denotes whether the given entity exists. Use to distinguish entity non-existence from TransformRef non-existence.

Returns

Type

Description

boolTrue if the entity has a TransformRef component, and false if it does not. Also returns false if the Entity instance refers to an entity that has been destroyed (or never existed).