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