This commit is contained in:
2026-06-20 15:00:15 +08:00
parent 5bf4e31ab3
commit a800620fee
58 changed files with 2997 additions and 619 deletions
@@ -365,6 +365,7 @@ public class MonsterContral : MonoBehaviour
transform.position = next;
}
public bool isRotate = true;
public bool isNot1 = false;
/// <summary>
/// 根据 forwordXYZ 字段将物体朝向目标点方向。
/// 为空时 2D 鱼用 up,3D 鱼用 forward。
@@ -441,8 +442,16 @@ public class MonsterContral : MonoBehaviour
{
transform.GetChild(0).forward = toNext.normalized;
var vv = transform.GetChild(0).eulerAngles;
if (isNot1)
{
vv.z = rotationPY;
vv.z = rotationPY * (vv.y < 180 ? -1 : 1);
}
else
{
vv.z = rotationPY * (vv.y < 180 ? -1 : 1);
}
transform.GetChild(0).eulerAngles = vv;
}