Esempio n. 1
0
    // Use this for initialization

    void Awake()
    {
        InputBus = GetComponent <ControlBus>();
        InputBus.Subscribe(InputUpdate);

        myTransform = gameObject.transform;
        controller  = GetComponent <CharacterController>();
        speed       = walkSpeed;
        rayDistance = controller.height * .5f + controller.radius;
        slideLimit  = controller.slopeLimit - .1f;
        jumpTimer   = antiBunnyHopFactor;
    }
Esempio n. 2
0
        public TwitchBot(IConfiguration config, ControlBus controlBus,
                         ImageStore imageStore, SoundStore soundStore,
                         TwitchAuth twitchAuth, ILogger <TwitchBot> logger)
        {
            _controlBus = controlBus;
            _imageStore = imageStore;
            _soundStore = soundStore;
            _twitchAuth = twitchAuth;
            _logger     = logger;

            _twitchAuth.TokenSet += TwitchAuthOnTokenSet;
        }
Esempio n. 3
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing || _disposed)
            {
                return;
            }

            DataBus.Dispose();
            DataBus = null;

            ControlBus.Dispose();
            ControlBus = null;

            _disposed = true;
        }
Esempio n. 4
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                if (_consumerPool != null)
                {
                    _consumerPool.Stop();
                    _consumerPool.Dispose();
                    _consumerPool = null;
                }

                if (_serviceContainer != null)
                {
                    _serviceContainer.Stop();
                    _serviceContainer.Dispose();
                    _serviceContainer = null;
                }

                if (ControlBus != this)
                {
                    ControlBus.Dispose();
                }

                if (_performanceCounterConnection != null)
                {
                    _performanceCounterConnection.Dispose();
                    _performanceCounterConnection = null;
                }

                _eventChannel = null;

                Endpoint = null;

                if (_counters != null)
                {
                    _counters.Dispose();
                    _counters = null;
                }

                EndpointCache.Dispose();
            }
            _disposed = true;
        }
Esempio n. 5
0
 public void Start()
 {
     controlBus = GetComponent <ControlBus>();
     Body       = GetComponent <Rigidbody>();
     controlBus.Subscribe(InputUpdate);
 }
Esempio n. 6
0
 void Start()
 {
     Init();
     controlBus = GetComponent <ControlBus>();
     controlBus.Subscribe(InputUpdate);
 }