Advertisement
Tricky_Fat_Cat

21_pb_cu2 ChangeLevel method

Sep 11th, 2019
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. private void ChangeLevel(State newState, AudioClip soundToPlay, string methodToInvoke, float invokeTime)
  2. {
  3. // newState - a new state of the rocket
  4. // soundToPlay - sound which must be played while this method executed
  5. // methodToInvoke - the name of a method which must be executed
  6. // invokeTime - time of invoke
  7. currentState = newState;
  8. audioSource.Stop();
  9. audioSource.PlayOneShot(soundToPlay);
  10. Invoke(methodToInvoke, invokeTime);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement