/// <inheritdoc/> protected override void OnCreate() { var world = this.GetStreamKey(); this._streamBus = StreamBus.GetInstance(world); this._streamBus.Subscribe(this); }
/// <summary> /// Get an instance of StreamBus linked to a key. /// </summary> /// <param name="key"> The bus key. </param> /// <returns> A shared instance of StreamBus. </returns> internal static StreamBus GetInstance(string key) { if (!Instances.TryGetValue(key, out var streamShare)) { streamShare = Instances[key] = new StreamBus(key); } return(streamShare); }