Exemplo n.º 1
0
 public void End()
 {
     if (pPort != null)
     {
         pPort.Close();
     }
 }
Exemplo n.º 2
0
    public void DetectProjectors()
    {
        int supportedProjectorCount = 0;

        for (int i = 0; i < ProjectorManagerScript.availablePortNames.Length; i++)
        {
            string portName = ProjectorManagerScript.availablePortNames[i];
            if (!portNameDetectRegex.Match(portName).Success)
            {
                continue;
            }
            ProjectorPort port = new ProjectorPort(portName);
            port.Open();
            Debug.Log(portName + " is " + (port.IsPortSupported ? "good" : "bad"));
            if (port.IsPortSupported)
            {
                projectors[supportedProjectorCount++].SetPortName(portName);
            }
            port.Close();
        }

        for (int i = supportedProjectorCount; i < projectors.Count; i++)
        {
            projectors[i].inputStatus.text = PROJECTOR_NOT_DETECTED_STRING;
        }

        SavePortNames();
    }