Skip to content

autoAlpha

Jan-Ole Schümann edited this page Jun 3, 2017 · 3 revisions

Plugin Alpha

Tweens the alpha value of a GameObject, Transform or RectTransform, and sets SetActive() to false if the alpha value is 0, otherwise to true. The value should be between 0 and 1.

Example

The example below shows how to fade out an object from its current alpha value to 0. When alpha reaches 0, SetActive(false) is automatically called on the target GameObject.

 TweenSharp tween = new TweenSharp(gameObject, 5f, 
 {
    autoAlpha = 0f, 
    ease = Quad.EaseOut
 });
Clone this wiki locally