Akka.Interfaced.SlimSocket.Client.ChannelEventDispatcher.TryInit C# (CSharp) Method

TryInit() public static method

public static TryInit ( ) : bool
return bool
        public static bool TryInit()
        {
            if (s_instanceExists)
                return false;

            s_instanceExists = true;

            var go = new GameObject("_ChannelEventDispatcher");
            s_instance = go.AddComponent<ChannelEventDispatcher>();
            DontDestroyOnLoad(go);
            return true;
        }

Usage Example

        public static Communicator Create()
        {
            ChannelEventDispatcher.TryInit();

            var communicator = new Communicator();

            communicator.ChannelFactory.TaskFactory = new UnitySlimTaskFactory {
                Owner = ChannelEventDispatcher.Instance
            };
            ((ObserverRegistry)communicator.ObserverRegistry).EventPoster = c => ChannelEventDispatcher.Post(c, null);

            return(communicator);
        }
All Usage Examples Of Akka.Interfaced.SlimSocket.Client.ChannelEventDispatcher::TryInit