private void OnTriggerEnter(Collider other)
{
if (other.tag == "LeftRight")
{
//Debug.Log(Vector3.Angle(this.transform.forward, Vector3.forward));
Vector3 a = this.transform.localRotation.eulerAngles;
this.transform.localRotation = Quaternion.Euler(0, 360 - a.y, 0);
}
if (other.tag == "UpAndDown")
{
Vector3 a = this.transform.localRotation.eulerAngles;
this.transform.localRotation = Quaternion.Euler(0, 180 - a.y, 0);
}
}
Unity碰撞反弹
最新推荐文章于 2024-05-11 00:39:23 发布