最近一次测量的设备在三维空间中的线性加速度(只读);Unity3d 重力感应

 

void Update () {

v3=Input.acceleration;

}

void OnGUI(){

GUI.TextArea(new Rect(50,50,300,100),"  X  "+v3.x+" Y "+v3.y+" Z "+v3.z);

}

Landscape Left:手机左横方向

Y<0f:左倾斜

Y>0f;右倾斜;

x<0f;前倾斜;

x>0f;后倾斜;

相关文章:

  • 2021-12-20
  • 2021-07-03
  • 2021-09-17
  • 2021-07-23
  • 2021-06-10
  • 2022-02-07
猜你喜欢
  • 2021-09-15
  • 2021-07-17
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案