Exemplo n.º 1
0
 protected MyBehaviorTreeState HasTargetArea([BTIn] ref MyBBMemoryTarget inTarget)
 {
     if (inTarget != null && inTarget.EntityId.HasValue)
     {
         MyEntity entity = null;
         if (MyEntities.TryGetEntityById(inTarget.EntityId.Value, out entity))
         {
             MyPlaceArea area = null;
             if (entity.Components.TryGet <MyPlaceArea>(out area))
             {
                 return(MyBehaviorTreeState.SUCCESS);
             }
         }
     }
     return(MyBehaviorTreeState.FAILURE);
 }
Exemplo n.º 2
0
 protected MyBehaviorTreeState HasTargetArea([BTIn] ref MyBBMemoryTarget inTarget)
 {
     if ((inTarget != null) && (inTarget.EntityId != null))
     {
         VRage.Game.Entity.MyEntity entity = null;
         if (Sandbox.Game.Entities.MyEntities.TryGetEntityById(inTarget.EntityId.Value, out entity, false))
         {
             MyPlaceArea component = null;
             if (entity.Components.TryGet <MyPlaceArea>(out component))
             {
                 return(MyBehaviorTreeState.SUCCESS);
             }
         }
     }
     return(MyBehaviorTreeState.FAILURE);
 }