Example #1
0
    //Use this for initialization
    void Start()
    {
#if UNITY_EDITOR
        SerialPortControl.GetInstance().OpenPort("COM3", 9600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
        textDevices.text = "";
#elif UNITY_ANDROID
        AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        _activity = jc.GetStatic <AndroidJavaObject>("currentActivity");

        Debug.Log("make _activity");
#endif
    }
Example #2
0
    public void SendData(string str)
    {
#if UNITY_EDITOR
        SerialPortControl.GetInstance().SendData(str);
#endif
    }