处理resetAction队列
This commit is contained in:
parent
d6f069c408
commit
24f97fedbb
@ -125,17 +125,20 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
if (this.index < targetIndex)
|
||||
{
|
||||
var seq = ActionKit.Sequence();
|
||||
for (int i = this.index + 1; i < targetIndex; i++)
|
||||
if (this.index >= 0)
|
||||
{
|
||||
// Íê³É¶¯×÷ Ö±½ÓÖ´ÐÐ
|
||||
IAction finishAction = ActionHelper.GetActionAndSub(steps[i].Finished);
|
||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.Finished });
|
||||
if (finishAction!=null)
|
||||
for (int i = this.index; i < targetIndex; i++)
|
||||
{
|
||||
seq.Append(finishAction);
|
||||
// Íê³É¶¯×÷ Ö±½ÓÖ´ÐÐ
|
||||
IAction finishAction = ActionHelper.GetActionAndSub(steps[i].Finished);
|
||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.Finished });
|
||||
if (finishAction != null)
|
||||
{
|
||||
seq.Append(finishAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
seq.Start(this,() =>
|
||||
seq.Start(this, () =>
|
||||
{
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
@ -143,19 +146,22 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
}
|
||||
else if (this.index > targetIndex)
|
||||
{
|
||||
var seq = ActionKit.Sequence();
|
||||
for (int i = this.index; i > targetIndex; i--)
|
||||
{
|
||||
// ÖØÖö¯×÷ Ö±½ÓÖØÖÃ
|
||||
IAction resetAction = ActionHelper.GetActionAndSub(steps[i].Reset);
|
||||
if (resetAction != null)
|
||||
{
|
||||
resetAction.Start(this);
|
||||
seq.Append(resetAction);
|
||||
}
|
||||
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart });
|
||||
|
||||
}
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
seq.Start(this, () =>
|
||||
{
|
||||
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
|
||||
RunCurAction(curAction, targetIndex);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -166,7 +172,7 @@ public class OperationController : MonoSingleton<OperationController>
|
||||
}
|
||||
}
|
||||
|
||||
public void RunCurAction(IAction curAction,int targetIndex)
|
||||
public void RunCurAction(IAction curAction, int targetIndex)
|
||||
{
|
||||
if (curAction != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user