Exemple #1
0
    void Update()
    {
        //Obj1 = GameObject.Find("MainCamera");
        SelfFace script = Obj1.GetComponent <SelfFace>();
        double   roll   = script.roll;

        //double angle = -6.963 - zhuan;
        //Debug.Log("angle:"+angle);
        //transform.localEulerAngles =
        //if (roll > 0) {

        //    transform.localEulerAngles = Vector3.MoveTowards(transform.localEulerAngles, new Vector3(transform.localEulerAngles.x, (float)roll, transform.localEulerAngles.z), speed * Time.deltaTime);
        //}
        //if (roll <= 0)
        //{
        //MoveObject(transform.localEulerAngles, new Vector3(transform.localEulerAngles.x, (float)roll, transform.localEulerAngles.z),1);
        //while (dur <= time)
        //{
        //    dur += Time.deltaTime;
        //    //float t = 3;
        //transform.localEulerAngles = Vector3.Lerp(transform.localEulerAngles, new Vector3(transform.localEulerAngles.x, (float)roll, transform.localEulerAngles.z), dur / time);
        transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, (float)roll, transform.localEulerAngles.z);
        //    //}
        //}
        //transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, (float)roll, transform.localEulerAngles.z);
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        //Obj1 = GameObject.Find("MainCamera");
        SelfFace script = Obj1.GetComponent <SelfFace>();
        double   pitch  = -script.pitch;

        //double angle = -6.963 - zhuan;
        //Debug.Log("angle:"+angle);
        //transform.localEulerAngles =
        //transform.localEulerAngles = Vector3.MoveTowards(transform.localEulerAngles, new Vector3((float)angle, transform.locaslEulerAngles.y, transform.localEulerAngles.z), speed * Time.deltaTime);
        transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, transform.localEulerAngles.y, (float)pitch);
    }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        //Obj1 = GameObject.Find("Quad");
        SelfFace script = Obj1.GetComponent <SelfFace>();

        d3      = script.state3;
        d3value = (float)d3;

        transform.localPosition = Vector3.MoveTowards(transform.localPosition, transform.localPosition + new Vector3(-transform.localPosition.x + left_bottom_back + D_value * d3value, 0, 0), speed * Time.deltaTime);

        //      {
        //          transform.localPosition = Vector3.MoveTowards(transform.localPosition, transform.localPosition + new Vector3(-transform.localPosition.x + (-0.17f), 0, 0), speed * Time.deltaTime);
        //      }
        Debug.Log("blink.d3:" + d3);
        // transform.localPosition += new Vector3(-transform.localPosition.x  + (-0.17f), 0, 0);
    }