public EntityFacade( IMonoEntity entity, IActorStateModel actor, IPauseStateModel pauseStateModel) { Entity = entity; Actor = actor; _pauseStateModel = pauseStateModel; _entityLifecycleDisposable = new SerialDisposable().AddTo(Disposer); Entity.Setup(Actor); Actor.Get <TransformDataComponent>() .SetMonoEntity(Entity); HealthDataComponent = Actor.Get <HealthDataComponent>(); HealthDataComponent.IsAlive .DelayFrame(1) .Subscribe(OnIsAliveChanged) .AddTo(Disposer); Observable.EveryUpdate() .Where(_ => CanTick) .Subscribe(_ => OnTick()) .AddTo(Disposer); }
protected override void OnSetup() { _healthDataComponent = Actor.Get <HealthDataComponent>(); }
public NearDeathNode(IActorStateModel actorStateModel) { _healthDataComponent = actorStateModel.Get <HealthDataComponent>(); }
protected override void OnSetup() { _relationshipDataComponent = Actor.Get <RelationshipDataComponent>(); _healthDataComponent = Actor.Get <HealthDataComponent>(); }
public DeactivateSelfNode(IActorStateModel actorStateModel) { _healthDataComponent = actorStateModel.Get <HealthDataComponent>(); }