public void SetField(string fieldName, object value) { switch (fieldName) { case nameof(Type): Type = (Generated.Semantic.Traits.Enums.CellType)Enum.ToObject(typeof(Generated.Semantic.Traits.Enums.CellType), value); break; case nameof(Left): Left = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Right): Right = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Top): Top = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Bottom): Bottom = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; default: throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Cell."); } }
public void SetField(string fieldName, object value) { switch (fieldName) { case nameof(Left): Left = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Right): Right = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Up): Up = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Down): Down = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(Occupied): Occupied = (System.Boolean)value; break; case nameof(StepsToEnd): StepsToEnd = (System.Int32)value; break; default: throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Waypoint."); } }
public void SetField(string fieldName, object value) { switch (fieldName) { case nameof(Carried): Carried = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; default: throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Carrier."); } }
public GameObject GetDataSource(TraitBasedObjectId traitBasedObjectId) { if (m_ObjectIdToEntity.TryGetValue(traitBasedObjectId, out var entity)) { var sourceEntityManager = World.DefaultGameObjectInjectionWorld.EntityManager; if (sourceEntityManager.Exists(entity)) { return(sourceEntityManager.GetComponentObject <Transform>(entity).gameObject); } } return(null); }
public void SetField(string fieldName, object value) { switch (fieldName) { case nameof(Waypoint): Waypoint = (Unity.AI.Planner.Traits.TraitBasedObjectId)value; break; case nameof(ID): ID = (System.Int32)value; break; default: throw new ArgumentException($"Field \"{fieldName}\" does not exist on trait Character."); } }