Ejemplo n.º 1
0
    void Update()
    {
        if (!Input.gyro.enabled)
        {
            return;
        }

        Click = _checkLimits(Input.GetMouseButton(0));

        string toSend =
            "hand=" + (dominantHand == DominantHandType.Right ? "Right" : "Left") + "/"
            + "click=" + Click + "/"
            + "r.x=" + gameObject.transform.rotation.x + "/"
            + "r.y=" + gameObject.transform.rotation.y + "/"
            + "r.z=" + gameObject.transform.rotation.z + "/"
            + "r.w=" + gameObject.transform.rotation.w;

        toSend.Replace(",", ".");
        toSend = DataEncryptor.Encrypt(toSend, EncriptKey);

        if (!ShowConfig)
        {
            _udp.send(toSend);
        }
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (!Input.gyro.enabled)
        {
            return;
        }

        click  = !ShowConfig && _checkClick();
        _reset = Input.GetMouseButton(0) && resetRect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y));


        Quaternion attitude = Input.gyro.attitude;

        string toSend =
            "hand=" + (dominantHand == DominantHandType.Right ? "Right" : "Left") + "/"
            + "reset=" + _reset + "/"
            + "click=" + click + "/"
            + "a.x=" + attitude.x + "/"
            + "a.y=" + attitude.y + "/"
            + "a.z=" + attitude.z + "/"
            + "a.w=" + attitude.w;

        //_reset = false;

        toSend.Replace(",", ".");

        print(toSend);

        if (!ShowConfig)
        {
            _udp.send(toSend);
        }
    }