Script/Transition/TransformExtention.cs
/// <summary>
/// Fades In a Ui Transform using CanvasGroup component
/// </summary>
/// <param name="transform">self transform to fade in</param>
/// <param name="duration">fading duration time in seconds</param>
/// <param name="easeType">fading easeType</param>
/// <param name="onCompleteCallback">callback on tween completion</param>
/// <param name="blockRaycast">block Raycasts during tween time?</param>
/// <returns>returns Tweener that can be used for other purposes.</returns>
Fades In a Ui Transform using CanvasGroup component
Fades In a Ui Transform using CanvasGroup component
public static Tweener FadeIn(this Transform transform,
            float duration,
            Ease easeType = Ease.Linear,
            Action onCompleteCallback = null,
            bool blockRaycast = false)
        {
            CanvasGroup image = InitCanvasGroup(transform, blockRaycast);
            image.alpha = 0;
            Tweener tween = image.DOFade(1f, duration);
            tween.SetEase(easeType);
            tween.OnComplete(() =>
            {
                if (onCompleteCallback != null)
                    onCompleteCallback.Invoke();
                image.blocksRaycasts = true;
            });
            return tween;
        }
public static Tweener FadeIn ( this Transform transform , float duration , Ease easeType = Ease . Linear , Action onCompleteCallback = null , bool blockRaycast = false ) { CanvasGroup image = InitCanvasGroup ( transform , blockRaycast ) ; image . alpha = 0 ; Tweener tween = image . DOFade ( 1f , duration ) ; tween . SetEase ( easeType ) ; tween . OnComplete ( ( ) => { if ( onCompleteCallback != null ) onCompleteCallback . Invoke ( ) ; image . blocksRaycasts = true ; } ) ; return tween ; }
Fades In a Ui Transform using CanvasGroup component
Fades In a Ui Transform using CanvasGroup component
returns Tweener that can be used for other purposes.
returns Tweener that can be used for other purposes .
Transform
this
<not_specific>
duration
float
fading duration time in seconds
fading duration time in seconds
easeType
Ease
None
onCompleteCallback
Action
callback on tween completion
callback on tween completion
blockRaycast
bool
None
transform
<not_specific>
self transform to fade in
self transform to fade in