コード例 #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);
        }
コード例 #2
0
 protected override void OnSetup()
 {
     _healthDataComponent = Actor.Get <HealthDataComponent>();
 }
コード例 #3
0
 public NearDeathNode(IActorStateModel actorStateModel)
 {
     _healthDataComponent = actorStateModel.Get <HealthDataComponent>();
 }
コード例 #4
0
 protected override void OnSetup()
 {
     _relationshipDataComponent = Actor.Get <RelationshipDataComponent>();
     _healthDataComponent       = Actor.Get <HealthDataComponent>();
 }
コード例 #5
0
 public DeactivateSelfNode(IActorStateModel actorStateModel)
 {
     _healthDataComponent = actorStateModel.Get <HealthDataComponent>();
 }