Exemple #1
0
        /// <inheritdoc/>
        protected override void OnCreate()
        {
            var world = this.GetStreamKey();

            this._streamBus = StreamBus.GetInstance(world);
            this._streamBus.Subscribe(this);
        }
Exemple #2
0
        /// <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);
        }