考核模式跨步骤跳转的时候镜头跟随
This commit is contained in:
parent
b37836aeea
commit
a8d275ce9d
@ -88,6 +88,7 @@ namespace ZXK.LouDiXvMuNiu
|
||||
{
|
||||
if (tempData[i].id == nextID)
|
||||
{
|
||||
NiuSceneMng._Instance.StepSetCameraTR(CurNiuHandler.Value, tempData[i]);
|
||||
return tempData[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1083,5 +1083,60 @@ namespace ZXK.LouDiXvMuNiu
|
||||
PopUpMng.ShowToolInfoTip(tranName, worldPos + Vector3.up * 0.05f, -1);
|
||||
}
|
||||
}
|
||||
|
||||
public void StepSetCameraTR(NiuData curStep,NiuData NextStep)
|
||||
{
|
||||
int curID = curStep.id;
|
||||
int nextID = NextStep.id;
|
||||
if (nextID - curID > 1&& curStep.ThreeTaskName!=ConstCtrl.ThreeTaskName_PeoplePlan)
|
||||
{
|
||||
Debug.Log("°ó¶¨Ê¼þ£º" + curID);
|
||||
int allFrame = 0;
|
||||
List<NiuData> modelInfos = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType];
|
||||
for (int a = 0; a < modelInfos.Count; a++)
|
||||
{
|
||||
if (modelInfos[a].TaskName.Equals(curStep.TaskName))
|
||||
{
|
||||
allFrame += modelInfos[a].TimelineLength;
|
||||
}
|
||||
if (modelInfos[a].id == curID)
|
||||
{
|
||||
for (int i = 0; i < nextID-curID-1; i++)
|
||||
{
|
||||
Debug.Log("²åÈëkey£º" + allFrame / 60.0f);
|
||||
if (!_curTimeLineCtrl.OnTriDic.ContainsKey(allFrame / 60.0f))
|
||||
{
|
||||
_curTimeLineCtrl.OnTriDic.Add(allFrame / 60.0f, (time) =>
|
||||
{
|
||||
OperationStepPanel operationStep = UI_Manage.Instance.GetPanel("OperationStepPanel").GetComponent<OperationStepPanel>();
|
||||
List<NiuData> modelInfos = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType];
|
||||
int allFrameTemp = 0;
|
||||
NiuData curTempStep = null;
|
||||
for (int i = 0; i < modelInfos.Count; i++)
|
||||
{
|
||||
if (modelInfos[i].TaskName.Equals(ConstCtrl.TaskName_ActualOperation))
|
||||
{
|
||||
allFrameTemp += modelInfos[i].TimelineLength;
|
||||
}
|
||||
if (Math.Abs(allFrameTemp / 60.0f - time) < 0.01f)
|
||||
{
|
||||
curTempStep = modelInfos[i+1];
|
||||
if (curTempStep.TaskType == ConstCtrl.TASKTYPE_Tran)
|
||||
curTempStep = modelInfos[i + 2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
operationStep.UodateCameraTRID(curTempStep);
|
||||
Debug.Log(curID+i+1);
|
||||
});
|
||||
}
|
||||
|
||||
allFrame += modelInfos[a + i+1].TimelineLength;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -435,7 +435,7 @@ namespace ZXK.LouDiXvMuNiu
|
||||
PopUpMng.PopAlert("提示", "当前模块已完成", "确认", null);
|
||||
}
|
||||
}
|
||||
private void UodateCameraTRID(NiuData obj)
|
||||
public void UodateCameraTRID(NiuData obj)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(obj.CameraNearTR))
|
||||
|
||||
@ -62,6 +62,8 @@ namespace CG.UTility
|
||||
/// </summary>
|
||||
public Action<double, Direction> OnContinue;
|
||||
|
||||
public Dictionary<float, Action<float>> OnTriDic = new Dictionary<float, Action<float>>();
|
||||
|
||||
/// <summary>
|
||||
/// Timeline³¤¶È
|
||||
/// </summary>
|
||||
@ -209,6 +211,14 @@ namespace CG.UTility
|
||||
if (m_playableDirector != null)
|
||||
{
|
||||
m_playableDirector.time = CurrentTime;
|
||||
foreach (float item in OnTriDic.Keys)
|
||||
{
|
||||
if(Math.Abs(item-CurrentTime)<0.01f)
|
||||
{
|
||||
OnTriDic[item]?.Invoke(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_playableDirector.Evaluate();
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user