修改步骤列表跳步骤的时候 先等前面的finished执行完毕
This commit is contained in:
parent
aff0e81e67
commit
d6f069c408
@ -124,18 +124,22 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
{
|
||||
if (this.index < targetIndex)
|
||||
{
|
||||
var seq = ActionKit.Sequence();
|
||||
for (int i = this.index + 1; i < targetIndex; i++)
|
||||
{
|
||||
// Íê³É¶¯×÷ Ö±½ÓÖ´ÐÐ
|
||||
IAction finishAction = ActionHelper.GetActionAndSub(steps[i].Finished);
|
||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.Finished });
|
||||
if (finishAction!=null)
|
||||
{
|
||||
finishAction.Start(this);
|
||||
seq.Append(finishAction);
|
||||
}
|
||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.Finished });
|
||||
|
||||
}
|
||||
seq.Start(this,() =>
|
||||
{
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
});
|
||||
}
|
||||
else if (this.index > targetIndex)
|
||||
{
|
||||
@ -151,11 +155,19 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
|
||||
}
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void RunCurAction(IAction curAction,int targetIndex)
|
||||
{
|
||||
if (curAction != null)
|
||||
{
|
||||
this.index = targetIndex;
|
||||
@ -175,4 +187,3 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user