protected new AudioSource audio; // = GetComponent<AudioSource>(); public static SoundFadeIn Add( GameObject gameObject, float duration = 1f, FinishNotify finishNotify = null) { SoundFadeIn fadeIn = gameObject.AddComponent <SoundFadeIn>(); fadeIn.duration = duration; fadeIn.onFinish = finishNotify; return(fadeIn); }
public static SoundFadeOut Add( GameObject gameObject, float duration = 1f, FinishNotify finishNotify = null) { SoundFadeOut fadeOut = gameObject.AddComponent <SoundFadeOut>(); fadeOut.duration = duration; fadeOut.onFinish = finishNotify; return(fadeOut); }
public override void Finish() { Game.IsFinished = true; FinishNotify?.Invoke($"Car with {Id} id finished the race!"); Thread.Sleep(2000); }