Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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>();
 }
Ejemplo n.º 5
0
 public DeactivateSelfNode(IActorStateModel actorStateModel)
 {
     _healthDataComponent = actorStateModel.Get <HealthDataComponent>();
 }