public void SwitchThroughResetServices()
        {
            System.Collections.Generic.List <IResetService> providers = ResetServiceHandler.GetProviders();
            if (providers != null)
            {
                IResetService newResetService = null;

                int current = -1;
                for (int i = 0; i < providers.Count; i++)
                {
                    if (CurrentResetService == providers[i])
                    {
                        current = i;
                    }
                }
                newResetService = providers[(current + 1) % providers.Count];

                if (newResetService != null)
                {
                    MessageSystem.Line.Main.AddMessage(new MessageSystem.Message("Reset service set", 0.5f));

                    if (CurrentResetService != null)
                    {
                        CurrentResetService.RemoveOnResetUpdate(SetSignal);
                    }
                    CurrentResetService = newResetService;
                    CurrentResetService.AddOnResetUpdate(SetSignal);
                }
            }
            else
            {
                Debug.LogWarning("no providers");
            }
        }
예제 #2
0
        //on start initialize the interface and try to connect to Adress:Port
        void Start()
        {
            zmq = new ZmqInterface <miVRlink.ResetStatusMessage>();
            zmq.init(Address, Port);

            ResetServiceHandler.AddService(this);
        }
 void OnDestroy()
 {
     ResetServiceHandler.RemoveOnNewResetService(NewServiceAvailable);
 }
 void Start()
 {
     Initialize();
     ResetServiceHandler.AddOnNewResetService(NewServiceAvailable);
 }
예제 #5
0
 void OnDestroy()
 {
     ResetServiceHandler.RemoveService(this);
 }