// Update is called once per frame
    void Update()
    {
        float ZTilting = Input.acceleration.x;

        if(ZTilting < -0.3)
            Direction = TiltingDirection.Left;

        else if(ZTilting > 0.3)
            Direction = TiltingDirection.Right;

        else
            Direction = TiltingDirection.None;

        //Debug.Log (Direction + " " + ZTilting );
        //Debug.Log(Input.deviceOrientation);
    }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        float ZTilting = Input.acceleration.x;

        if (ZTilting < -0.3)
        {
            Direction = TiltingDirection.Left;
        }

        else if (ZTilting > 0.3)
        {
            Direction = TiltingDirection.Right;
        }

        else
        {
            Direction = TiltingDirection.None;
        }

        //Debug.Log (Direction + " " + ZTilting );
        //Debug.Log(Input.deviceOrientation);
    }