// 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; }
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; }
protected virtual void Dispose(bool disposing) { if (!disposing || _disposed) { return; } DataBus.Dispose(); DataBus = null; ControlBus.Dispose(); ControlBus = null; _disposed = true; }
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; }
public void Start() { controlBus = GetComponent <ControlBus>(); Body = GetComponent <Rigidbody>(); controlBus.Subscribe(InputUpdate); }
void Start() { Init(); controlBus = GetComponent <ControlBus>(); controlBus.Subscribe(InputUpdate); }