Example #1
0
    public void SendUdpData()
    {
        ReceiveData();
        if (!arkitPart.activeInHierarchy)
        {
            return;
        }

        for (int i = 0; i < randomVector.Length; i++)
        {
            randomVector[i] = Random.Range(0f, 100.0f);
        }

        if (udp == null)
        {
            udp = GameObject.FindWithTag("UDP").GetComponent <UDPObj>();
        }
        else
        {
            string s = DateTime.Now.ToString("M/d/yyyy") + " "
                       + System.DateTime.Now.ToString("HH:mm:ss") + ":"
                       + System.DateTime.Now.Millisecond + ","
                       + AudioSync.currentSlideIndex + ","
                       + AudioSync.instance.leftTriggerPressed + ","
                       + AudioSync.instance.rightTriggerPressed + ","
                       //+ string.Join(":", myVector.values);
                       + string.Join(":", randomVector);

            udp.SendData(s);
            //Debug.Log(s);
        }
    }
Example #2
0
    // start from Unity3d
    public void Start()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);

        //init ();
    }
Example #3
0
    void Update()
    {
        HandBrake();

        wheels[0].ConfigureVehicleSubsteps(2000f, 1000, 300);
        wheels[1].ConfigureVehicleSubsteps(2000f, 1000, 300);
        wheels[2].ConfigureVehicleSubsteps(2000f, 1000, 300);
        wheels[3].ConfigureVehicleSubsteps(2000f, 1000, 300);

        GameObject go             = GameObject.Find("GameManager");
        UDPObj     udpobj         = go.GetComponent <UDPObj>();
        float      InputSignalNum = udpobj.inputNumber;

        print("move" + InputSignalNum);
    }