处理resetAction队列
This commit is contained in:
parent
d6f069c408
commit
24f97fedbb
@ -125,7 +125,9 @@ public class OperationController : MonoSingleton<OperationController>
|
|||||||
if (this.index < targetIndex)
|
if (this.index < targetIndex)
|
||||||
{
|
{
|
||||||
var seq = ActionKit.Sequence();
|
var seq = ActionKit.Sequence();
|
||||||
for (int i = this.index + 1; i < targetIndex; i++)
|
if (this.index >= 0)
|
||||||
|
{
|
||||||
|
for (int i = this.index; i < targetIndex; i++)
|
||||||
{
|
{
|
||||||
// 完成动作 直接执行
|
// 完成动作 直接执行
|
||||||
IAction finishAction = ActionHelper.GetActionAndSub(steps[i].Finished);
|
IAction finishAction = ActionHelper.GetActionAndSub(steps[i].Finished);
|
||||||
@ -135,6 +137,7 @@ public class OperationController : MonoSingleton<OperationController>
|
|||||||
seq.Append(finishAction);
|
seq.Append(finishAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
seq.Start(this, () =>
|
seq.Start(this, () =>
|
||||||
{
|
{
|
||||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||||
@ -143,19 +146,22 @@ public class OperationController : MonoSingleton<OperationController>
|
|||||||
}
|
}
|
||||||
else if (this.index > targetIndex)
|
else if (this.index > targetIndex)
|
||||||
{
|
{
|
||||||
|
var seq = ActionKit.Sequence();
|
||||||
for (int i = this.index; i > targetIndex; i--)
|
for (int i = this.index; i > targetIndex; i--)
|
||||||
{
|
{
|
||||||
// 重置动作 直接重置
|
// 重置动作 直接重置
|
||||||
IAction resetAction = ActionHelper.GetActionAndSub(steps[i].Reset);
|
IAction resetAction = ActionHelper.GetActionAndSub(steps[i].Reset);
|
||||||
if (resetAction != null)
|
if (resetAction != null)
|
||||||
{
|
{
|
||||||
resetAction.Start(this);
|
seq.Append(resetAction);
|
||||||
}
|
}
|
||||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart });
|
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
seq.Start(this, () =>
|
||||||
|
{
|
||||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||||
RunCurAction(curAction, targetIndex);
|
RunCurAction(curAction, targetIndex);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user