public override void onStartRide() { foreach (motor m in motors) { m.GetAxis(this.gameObject); } base.onStartRide(); foreach (motor m in motors) { m.Enter(); } if (phases.Count <= 0) { animating = false; return; } foreach (motor m in motors) { m.Enter(); } animating = true; phaseNum = 0; currentPhase = phases[phaseNum]; currentPhase.running = true; currentPhase.Enter(); currentPhase.Run(); }
public void EnterPhase(Type newPhase) { _currentPhase?.Exit(); var paramArray = new object[] { _game, (Action <Type>)EnterPhase }; _currentPhase = (Phase)Activator.CreateInstance(newPhase, paramArray); _currentPhase.Enter(); }
void NextPhase() { currentPhase.Exit(); currentPhase.running = false; phaseNum++; if (phases.Count > phaseNum) { currentPhase = phases[phaseNum]; currentPhase.running = true; currentPhase.Enter(); currentPhase.Run(); return; } animating = false; }
void NextPhase() { currentPhase.Exit(); currentPhase.running = false; phaseNum++; if (phases.Count > phaseNum) { currentPhase = phases[phaseNum]; currentPhase.running = true; currentPhase.Enter(); currentPhase.Run(); return; } Debug.Log("-=====[Stopped]=====-"); animating = false; }