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>(); }
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)); } }
protected override void Loaded(BehaviorLoadedEventArgs args) { if (!UseWaitingQueueOfParent) { args.TrackSubscription(ChildEnter.Subscribe(ProcessEnteringChild)); } else { args.TrackSubscription(Update.Where(_ => !IsProcessing).Subscribe(_ => TakeCustomerFromQueueAndProcess())); } }
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)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(PointerMoved.Subscribe(OnPointerMoved)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(ChildEnter.Where(a => a.Reason != Reasons.Unloaded.FromCar).Subscribe(OnChildEnter)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Draw.Subscribe(OnDraw)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Draw.Subscribe(OnDraw)); args.TrackSubscription(Entity.GetBehavior <ShapeColliderBehavior>().Collision.Subscribe(_ => Move())); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(CreateResources.Subscribe(OnCreateResources)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Draw.WhereShouldRender(this).Subscribe(OnRender)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(ChildEnter.Subscribe(OnChildEnter)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(ParentChanged.Subscribe(OnParentChanged)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Update.Subscribe(OnUpdate)); args.TrackSubscription(Entity.GetBehavior <MovableBehavior>().TargetReached.Subscribe(OnTargetReached)); SetTargetToNextPointTowardsParkingLot(Entity.Parent.GetImplementation <IGraphNode>()); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(ChildEnter.Where(_ => _.OldParent != UpperGraphNode.Entity).Subscribe(TeleportEntityToUpperGraph)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(EarlyCreateResources.Subscribe(e => e.Tasks.Add(OnCreateResourcesAsync(e)))); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Draw.WhereLayerIsCorrect(this).Where(CanRender).Subscribe(OnRender)); }
protected override void Loaded(BehaviorLoadedEventArgs args) { args.TrackSubscription(Update.Where(_ => Target != null).Subscribe(OnUpdate)); }