private void Start() { spawnPos = transform.position; if (runner == null) { runner = CoroutineRunner.Instantiate("DisableAndRespawnHelper"); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (resolveAttackRunner == null) { resolveAttackRunner = CoroutineRunner.Instantiate("ResolveAttackRunner"); DontDestroyOnLoad(resolveAttackRunner); } actionsCount = actions.Value.Length; actionToCast = 0; OnAction(); }
private void PrepareTimeChange() { if (runner == null) { runner = CoroutineRunner.Instantiate(this.name); DontDestroyOnLoad(runner); } if (timeInRoutine != null) { runner.StopCoroutine(timeInRoutine); } }
public void GetNextKey(GetKeyCallback callback, Action cancelCallback) { if (runner == null) { runner = CoroutineRunner.Instantiate(this.name + "_KeyGetter"); } else if (nextKeyRoutine != null) { if (storedGetNextKeyCancel != null) { storedGetNextKeyCancel.Invoke(); } runner.StopCoroutine(nextKeyRoutine); } storedGetNextKeyCancel = cancelCallback; nextKeyRoutine = GetNextKeyRoutine(callback); runner.StartCoroutine(nextKeyRoutine); }