...
float height = this.transform.position.y;
float rot_x = this.transform.eulerAngles.x;
float a = Mathf.Tan((90 - rot_x) * Mathf.Deg2Rad) * height;
print("a: " + a);
...
相关资料:
2.[Unity]获得Inspector视图下Transform.Rotation的值
参考资料:
3.