关卡载具移动

main
SunChengyong 2026-06-27 13:29:01 +08:00
parent 45ff57e783
commit 4627072952
1 changed files with 14 additions and 5 deletions

View File

@ -44,20 +44,29 @@ namespace GameWrapper.FlareLevel
private void Awake()
{
if (null == TsPointRoot)
{
listPoint = new List<GameObject>(1);
return;
}
Init(TsPointRoot);
}
/// <summary>
/// 初始化路径点位(运行时 AddComponent 后调用)
/// </summary>
public void Init(Transform pointRoot)
{
TsPointRoot = pointRoot;
listPoint = new List<GameObject>(TsPointRoot.childCount);
for (int i = 0; i < TsPointRoot.childCount; ++i)
{
if (TsPointRoot.GetChild(i).name.Contains("EX"))
{
continue;
}
listPoint.Add(TsPointRoot.GetChild(i).gameObject);
}
curIndex = -1;
targetIndex = curIndex;
SetPos(0);
}
private void Update()
@ -90,7 +99,7 @@ namespace GameWrapper.FlareLevel
return;
targetIndex = index;
GameObject goCur = listPoint[curIndex];
GameObject goCur = listPoint[curIndex + 1];
nextTarget = goCur.GetComponent<BSplineCurve>();
if (null == nextTarget)
{