关卡载具移动
parent
45ff57e783
commit
4627072952
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue