Esempio n. 1
0
 void Awake()
 {
     networkController       = Graph.GetComponent <NetworkController>();
     inputController         = Graph.GetComponent <InputController>();
     nodeController          = Graph.GetComponent <NodeController>();
     connectionController    = Graph.GetComponent <ConnectionController>();
     graphController         = Graph.GetComponent <GraphController>();
     consoleWindowController = ConsoleWindow.GetComponent <ConsoleWindowController>();
     routeController         = Graph.GetComponent <RouteController>();
 }
Esempio n. 2
0
        public async Task OnExecuteAsync()
        {
            ObsWebSocketClientSettings settings = await ReadSettings().ConfigureAwait(false);

            logger.LogInformation("Try to connect using Address: {IpAddress}:{Port}", settings.IpAddress, settings.Port);

            try
            {
                await client.ConnectAsync(settings).ConfigureAwait(false);

                logger.LogInformation("Connected");
            }
            catch (Exception ex)
            {
                logger.LogError("Cannot connect: {Message}", ex.Message);
            }

            /* Suscribe the client. */
            subscriber.Subscribe("OBS", async command =>
            {
                logger.LogTrace("Received command: {Command}", command);

                if (command == "**START")
                {
                    await client.StartRecordingAsync();
                }
                else if (command == "**STOP")
                {
                    await client.StopRecordingAsync();
                }
                else if (string.IsNullOrEmpty(command))
                {
                    await client.ChangeSceneAsync(command);
                }
            });


            if (!NoGui)
            {
                logger.LogInformation("Runnig with GUI");
                ConsoleWindowController.Hide();
                RunGui(settings);

                /* Save if running GUI. */
                await settingsRepository.SaveAsync(settings);
            }
            else
            {
                logger.LogInformation("Runnig without GUI");
                Console.ReadKey();
            }
        }
Esempio n. 3
0
        private void Awake()
        {
            inputController      = GetComponent <InputController>();
            nodeController       = GetComponent <NodeController>();
            graphController      = GetComponent <GraphController>();
            connectionController = GetComponent <ConnectionController>();
            infoSpaceController  = (InfoSpaceController)Resources.FindObjectsOfTypeAll(typeof(InfoSpaceController))[0];
            consoleController    = (ConsoleWindowController)Resources.FindObjectsOfTypeAll(typeof(ConsoleWindowController))[0];
            actionController     = GetComponent <ActionController>();

            NetworkView = GetComponent <NetworkView>();

            if (inputController.Environment == Environment.Cave)
            {
                Lzwp.OnLZWPlibInitialize += Initialize;
            }
            else
            {
                Initialize();
            }
        }