Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ChangeLevel(State newState, AudioClip soundToPlay, string methodToInvoke, float invokeTime)
- {
- // newState - a new state of the rocket
- // soundToPlay - sound which must be played while this method executed
- // methodToInvoke - the name of a method which must be executed
- // invokeTime - time of invoke
- currentState = newState;
- audioSource.Stop();
- audioSource.PlayOneShot(soundToPlay);
- Invoke(methodToInvoke, invokeTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement