Exemple #1
0
    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);
    }
Exemple #2
0
    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);
    }
Exemple #3
0
 public override void Finish()
 {
     Game.IsFinished = true;
     FinishNotify?.Invoke($"Car with {Id} id finished the race!");
     Thread.Sleep(2000);
 }