public void ChangeState(GameState state) { if (state == nowState) { return; } switch (state) { case GameState.playing: foreach (var obj in resetableObjs) { obj.GetComponent <IReset>()?.DoReset(); } DoReset(); break; case GameState.clear: Stopwatch.Stop(); result.Init(); break; } nowState = state; }