public void Enter(Acting acting) { if (enterFunction != null) { enterFunction(acting); } }
public void Exit(Acting e) { if (exitFunction != null) { exitFunction(e); } }
public void TickAction(Acting acting) { currentRepeatCount++; Step currentStep = m_steps[currentStepIndex]; if (!currentStep.IsRepeatLimitMet(currentRepeatCount)) { return; } int relativeIndex = currentStep.CheckSuccessAndGetRelativeIndex(acting); if (relativeIndex != 0) { currentStepIndex += relativeIndex + m_steps.Length; currentStepIndex %= m_steps.Length; currentRepeatCount = 0; currentStep.Exit(acting); m_steps[currentStepIndex].Enter(acting); } }
public int CheckSuccessAndGetRelativeIndex(Acting acting) { if (successFunction != null) { var result = successFunction(acting); if (result.index != null) { return((int)result.index); } if (result.success) { return(relativeStepIndexSuccess); } return(relativeStepIndexFail); } if (acting._flags.HasFlag(ActingState.ActionSucceeded)) { return(relativeStepIndexSuccess); } return(relativeStepIndexFail); }
public SubstitutionContext(Acting acting, CompiledAction action) { this.acting = acting; this.initialAction = action; this.currentAction = action; }