示例#1
0
        public ProcessMonitor(string processName)
        {
            OSCManager.Initialize("255.255.255.255", 19876);
            OSCManager.ListenToAddress("/unity/client/restart", OnRestartClient);

            _processName   = processName;
            _monitorThread = new Thread(new ThreadStart(MonitorThreadProc))
            {
                Name = "Monitor Thread"
            };
            _monitorThread.Start();
        }
示例#2
0
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad(gameObject);
     OSCManager.Initialize("239.1.2.3");
     OSCManager.ListenToAddress("/unity/server/status", OnServerStatus);
     OSCManager.ListenToAddress("/unity/server/show/loadScene", OnLoadScene);
     OSCManager.ListenToAddress("/unity/server/show/showObject", OnShowHideObject);
     OSCManager.ListenToAddress("/unity/server/show/hideObject", OnShowHideObject);
     try
     {
         _clientConfig = JsonUtility.FromJson <ClientConfig>(System.IO.File.ReadAllText("client_config.json"));
     }
     catch (System.Exception ex)
     {
         _clientConfig    = new ClientConfig();
         _clientConfig.id = "-2";
         Debug.LogError(ex.ToString());
     }
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        _knownClients = new Dictionary <int, ClientInfo>();

        SharedLogger.ListenToMessages(LogMessageHandler);
        OSCManager.Initialize("239.1.2.3");
        OSCManager.ListenToAddress("/unity/client/show/join", OnJoinShow);
        OSCManager.ListenToAddress("/unity/client/status", OnClientStatus);
        OSCManager.ListenToAddress("/unity/client/restarting", OnClientRestarting);

        if (Debug.isDebugBuild && File.Exists("show_debug.json"))
        {
            LoadJSON(File.ReadAllText("show_debug.json"));
        }
        else if (!string.IsNullOrEmpty(JSON_URL))
        {
            StartCoroutine(FetchShowScript());
        }
    }