1
This commit is contained in:
@@ -178,7 +178,8 @@ public class MonsterControl_BossBase : MonsterContral
|
||||
monsterData.moveLine.Init(bezierData, time);
|
||||
// ⭐ isMove=true 的 Boss 初始位置设为曲线起点,
|
||||
// 避免在 moveTime 更新前卡在生成时的 (9999,9999,0)
|
||||
transform.position = new Vector3(bezierData.start.x, bezierData.start.y, 0);
|
||||
// z 保留当前值:3D Boss 在预制体上配置的深度不被擦掉
|
||||
transform.position = new Vector3(bezierData.start.x, bezierData.start.y, transform.position.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -190,6 +191,18 @@ public class MonsterControl_BossBase : MonsterContral
|
||||
// 否则 OnMoveUpdata 不会被调用(OnUpdate 里 isInitialized=false 会 return),moveTime 不自增
|
||||
isInitialized = true;
|
||||
ChangeState(CharacterStateType.move);
|
||||
|
||||
if (transform.childCount == 0) return;
|
||||
Transform child = transform.GetChild(0);
|
||||
|
||||
|
||||
Vector3 localPos = child.localPosition;
|
||||
// ⭐ x/y 归零摆正模型;z 深度只在显式配置 depthOffset(≠0)时才覆盖,
|
||||
// 否则保留预制体上设置的 3D 深度(3D Boss 用,之前被强制归零导致深度无效)
|
||||
localPos.x = 0f;
|
||||
if (depthOffset != 0)
|
||||
localPos.z = depthOffset;
|
||||
child.localPosition = localPos;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user