Struct Location
A custom trait for locations, since it is commonly used in domains
Namespace: Unity.AI.Planner.DomainLanguage.TraitBased
Syntax
[Serializable]
public struct Location : ICustomTrait<Location>, ICustomTrait, ITrait<Location>, ITrait, IComponentData, IEquatable<Location>
Fields
Forward
The forward vector of the location
Declaration
public Vector3 Forward
Field Value
Type | Description |
---|---|
Vector3 |
Position
The position of the location
Declaration
public Vector3 Position
Field Value
Type | Description |
---|---|
Vector3 |
TransformInstanceID
The ID of the transform of the location
Declaration
public int TransformInstanceID
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Transform
The transform of the location
Declaration
public Transform Transform { get; set; }
Property Value
Type | Description |
---|---|
Transform |
Methods
Equals(Location)
Compares the location to another
Declaration
public bool Equals(Location other)
Parameters
Type | Name | Description |
---|---|---|
Location | other | Another location to which the location is compared |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the two locations are equal |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
SetComponentData(EntityManager, Entity)
Sets the component on a given domain object
Declaration
public void SetComponentData(EntityManager entityManager, Entity domainObjectEntity)
Parameters
Type | Name | Description |
---|---|---|
EntityManager | entityManager | The entity manager for the world containing the domain object entity |
Entity | domainObjectEntity | The domain object for which the trait is set |
Implements
SetField(String, Object)
Set a field on the trait (alternative to using reflection)
Declaration
public void SetField(string fieldName, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field |
System.Object | value | Value to set |
Implements
SetTraitMask(EntityManager, Entity)
Sets the flag corresponding to the trait in an object's trait mask
Declaration
public void SetTraitMask(EntityManager entityManager, Entity domainObjectEntity)
Parameters
Type | Name | Description |
---|---|---|
EntityManager | entityManager | The entity manager for the world in which the domain object entity exists |
Entity | domainObjectEntity | The domain object entity for which the trait is set |