Exemplo n.º 1
0
    /// <summary>
    /// Destroy method and sends a message that we are gone!
    /// </summary>
    void OnDestroy()
    {
        oscController.Close();
        OscMessage messageOSC = new OscMessage();

        messageOSC.address = "CIAO";
        oscHandshaker.Send(messageOSC);
        oscHandshaker.Close();
        udp_client.Close();
        Network.Disconnect();
    }
Exemplo n.º 2
0
    public void Restart()
    {
        OnApplicationQuit();
        Debug.Log("Restart");

        if (_userRole == UserRole.Playback)
        {
            playbackManager.StopPlayback();
        }
        else if (_userRole == UserRole.Server)
        {
            osc.Close();
        }
        else if (_userRole == UserRole.Player)
        {
            if (soundHandler.isRecording)
            {
                soundHandler.Stop();
            }
        }

        scenarioEvents.medianDancer.Shut();

        Camera.main.transform.parent = GameObject.Find("--------- Scene Objects ------------").transform;
        userManager.EraseAllPlayers();
        userManager = new UserManager();
        osc.sender.SendQuitMessage(_userRole);
        StopAllCoroutines();
        CancelInvoke("AskForRegistration");
        StartCoroutine(InitApplication());

        osc.Close();

        /*string[] endings = new string[]{
         *  "exe", "x86", "x86_64", "app"
         * };
         * string executablePath = Application.dataPath + "/..";
         * foreach (string file in System.IO.Directory.GetFiles(executablePath)) {
         *  foreach (string ending in endings) {
         *      if (file.ToLower ().EndsWith ("." + ending)) {
         *          System.Diagnostics.Process.Start (executablePath + file);
         *          Application.Quit ();
         *          return;
         *      }
         *  }
         *
         * }*/
    }
Exemplo n.º 3
0
 public void SetearOSC()
 {
     osc.outIP   = ipInput.GetComponent <Text>().text;
     osc.outPort = int.Parse(puertoInput.GetComponent <Text>().text);
     osc.Close();
     osc.Open();
     camara.GetComponent <OSCsender>().prendido = true;
 }
 void Close()
 {
     osc.Close();
 }