예제 #1
0
 private void Next(params object[] args)
 {
     _list[_index++].OnStop();
     OnElementChanging?.Invoke();
     _list[_index].OnStart(args);
     OnStartWorking?.Invoke();
 }
예제 #2
0
 public void Launch(int index)
 {
     if (_list.Count == 0)
     {
         throw new StateManagerException("List array can't be empty");
     }
     _index = index;
     _list[_index].OnStart();
     OnStartWorking?.Invoke();
     _running = RunningState.Running;
 }
예제 #3
0
 public override void Interact(Interactor interactor)
 {
     if (_isWorking)
     {
         return;
     }
     base.Interact(interactor);
     _material.color = workingColor;
     OnStartWorking?.Invoke();
     if (_hasTurnableAnimator)
     {
         turnableAnimator.SetTrigger(StartWorkingTrigger);
     }
     CalculateBreakingTime();
 }