public static void Fade(this uLink.MonoBehaviour monoBehaviour, float nFadeTime, CallBackFade nCallBackFade, CallBack nCallBackFadeEnd = null) { var gameObject = monoBehaviour.gameObject; // Disable all fades foreach(var runningFade in gameObject.GetComponents<Fade>()) runningFade.Stop(); // Add new fade var fade = gameObject.AddComponent<Fade>(); fade.fadeTime = nFadeTime; fade.callBackFade = nCallBackFade; fade.callBackFadeEnd = nCallBackFadeEnd; }
public static void Fade(this uLink.MonoBehaviour monoBehaviour, float nFadeTime, CallBackFade nCallBackFade, CallBack nCallBackFadeEnd = null) { var gameObject = monoBehaviour.gameObject; // Disable all fades foreach (var runningFade in gameObject.GetComponents <Fade>()) { runningFade.Stop(); } // Add new fade var fade = gameObject.AddComponent <Fade>(); fade.fadeTime = nFadeTime; fade.callBackFade = nCallBackFade; fade.callBackFadeEnd = nCallBackFadeEnd; }