示例#1
0
        protected override void Loaded(BehaviorLoadedEventArgs args)
        {
            args.TrackSubscription(Draw.Subscribe(OnDraw));
            args.TrackSubscription(CreateResources.Subscribe(e => e.Tasks.Add(OnCreateResourcesAsync(e))));

            _terrain = Entity.GetBehavior <TerrainBehavior>();
        }
示例#2
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Draw.Where(a => a.RenderLayer == RenderLayers.TopMost).Subscribe(OnDraw));
     if (Entity.Implements <IReadOnlyTransform>())
     {
         args.TrackSubscription(MouseInteractionFeature.MouseEnterFor(Entity).Subscribe(OnMouseEnter));
         args.TrackSubscription(MouseInteractionFeature.MouseMoveOverFor(Entity).Subscribe(OnMouseMove));
         args.TrackSubscription(MouseInteractionFeature.MouseLeaveFor(Entity).Subscribe(OnMouseLeave));
     }
 }
示例#3
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     if (!UseWaitingQueueOfParent)
     {
         args.TrackSubscription(ChildEnter.Subscribe(ProcessEnteringChild));
     }
     else
     {
         args.TrackSubscription(Update.Where(_ => !IsProcessing).Subscribe(_ => TakeCustomerFromQueueAndProcess()));
     }
 }
示例#4
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Update.Where(a =>
     {
         _timeSinceLastSpawn += a.DeltaTime;
         var result           = _timeSinceLastSpawn.TotalSeconds > 20;
         if (result)
         {
             _timeSinceLastSpawn = TimeSpan.Zero;
         }
         return(result);
     }).Subscribe(OnUpdate));
 }
示例#5
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(PointerMoved.Subscribe(OnPointerMoved));
 }
示例#6
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(ChildEnter.Where(a => a.Reason != Reasons.Unloaded.FromCar).Subscribe(OnChildEnter));
 }
示例#7
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Draw.Subscribe(OnDraw));
 }
示例#8
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Draw.Subscribe(OnDraw));
     args.TrackSubscription(Entity.GetBehavior <ShapeColliderBehavior>().Collision.Subscribe(_ => Move()));
 }
示例#9
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(CreateResources.Subscribe(OnCreateResources));
 }
示例#10
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Draw.WhereShouldRender(this).Subscribe(OnRender));
 }
示例#11
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(ChildEnter.Subscribe(OnChildEnter));
 }
示例#12
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(ParentChanged.Subscribe(OnParentChanged));
 }
示例#13
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Update.Subscribe(OnUpdate));
     args.TrackSubscription(Entity.GetBehavior <MovableBehavior>().TargetReached.Subscribe(OnTargetReached));
     SetTargetToNextPointTowardsParkingLot(Entity.Parent.GetImplementation <IGraphNode>());
 }
示例#14
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(ChildEnter.Where(_ => _.OldParent != UpperGraphNode.Entity).Subscribe(TeleportEntityToUpperGraph));
 }
示例#15
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(EarlyCreateResources.Subscribe(e => e.Tasks.Add(OnCreateResourcesAsync(e))));
 }
示例#16
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Draw.WhereLayerIsCorrect(this).Where(CanRender).Subscribe(OnRender));
 }
示例#17
0
 protected override void Loaded(BehaviorLoadedEventArgs args)
 {
     args.TrackSubscription(Update.Where(_ => Target != null).Subscribe(OnUpdate));
 }