1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user