public AvatarFacade(
     IMonoEntity entity,
     IActorStateModel actor,
     IPauseStateModel pauseStateModel)
     : base(entity, actor, pauseStateModel)
 {
 }
        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);
        }
 public GameRoundDurationController(
     IGameRoundDurationModel gameRoundDurationModel,
     IAvatarLocator avatarLocator,
     IGameRoundStateModel gameGameRoundStateModel,
     IPauseStateModel pauseStateModel)
 {
     _gameRoundDurationModel  = gameRoundDurationModel;
     _avatarLocator           = avatarLocator;
     _gameGameRoundStateModel = gameGameRoundStateModel;
     _pauseStateModel         = pauseStateModel;
 }
예제 #4
0
        public InputMovementController(
            IActorStateModel actorStateModel,
            VirtualJoystickModel virtualJoystickModel,
            UserInputConfig userInputConfig,
            IPauseStateModel pauseStateModel)
            : base(actorStateModel)
        {
            _virtualJoystickModel = virtualJoystickModel;
            _userInputConfig      = userInputConfig;
            _pauseStateModel      = pauseStateModel;

            Observable.EveryUpdate()
            .Subscribe(_ => OnUpdate())
            .AddTo(Disposer);
        }
        public NovatarFacade(
            IMonoEntity entity,
            IActorStateModel actor,
            BehaviourTree behaviourTree,
            IPauseStateModel pauseStateModel)
            : base(entity, actor, pauseStateModel)
        {
            _behaviourTree             = behaviourTree;
            _originDataComponent       = Actor.Get <OriginDataComponent>();
            _relationshipDataComponent = Actor.Get <RelationshipDataComponent>();

            _resettableNodes = _behaviourTree.Nodes
                               .OfType <IResettableNode>()
                               .ToList();

            _originDataComponent.SpawnPosition
            .Subscribe(Entity.SetPosition)
            .AddTo(Disposer);
        }