Пример #1
0
    // Update is called once per frame
    void Update()
    {
        d = test.getcoor();

        Debug.Log("x = " + d.x);
        //Debug.Log("test");
    }
Пример #2
0
    // Update is called once per frame
    //int counts = 0;
    public void Update()
    {
        //System.Threading.Thread.Sleep(20);
        //Debug.Log("debug");
        d  = a.getcoor();
        x5 = x4;
        x4 = x3;
        x3 = x2;
        x2 = x1;

        //x1 = d.x;
        //Debug.Log(d.x);

        x1 = d.x * 0.4 + x2 * 0.25 + x3 * 0.15 + x4 * 0.1 + x5 * 0.1;
        y5 = y4;
        y4 = y3;
        y3 = y2;
        y2 = y1;


        y1 = d.y * 0.4 + y2 * 0.25 + y3 * 0.15 + y4 * 0.1 + y5 * 0.1;
        z5 = z4;
        z4 = z3;
        z3 = z2;
        z2 = z1;


        z1 = d.z * 0.4 + z2 * 0.25 + z3 * 0.15 + z4 * 0.1 + z5 * 0.1;

        Vector3 temp = new Vector3((float)(x1) * 4 * 2 + 1, (float)(y1 * 4 + 4), (float)(-z1 + 0.75) * 50 - 3);

        //Vector3 temp = new Vector3((float)(d.x)*4*2+1, (float)(d.y*4+3.5), (float)(-d.z+0.5)*13*3+4);
        transform.position = temp;
        //counts++;
        //Debug.Log(counts);
        Debug.Log("x1 = " + x1 + " y1 = " + x2 + " z1 = " + x3);
        //Debug.Log("d.x = " + d.x + " d.y = " + d.y + " d.z = " + d.z);
        //Debug.Log("temp.x = " + temp.x + " temp.y = " + temp.y + " temp.z = " + temp.z);
        //Console.WriteLine("d.x = " + d.x + " d.y = " + d.y + " d.z = " + d.z);
    }