1
DOTween & DOTween Pro / Re: Easing at the end of the value is wrong
« on: November 30, 2015, 02:14:39 AM »
Hi,
Ok! I'll use "OnComplete".
Thank you for your advice.
Ok! I'll use "OnComplete".
Thank you for your advice.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void Update ()
{
if( m_renderer.color.a <= 0.0f )
{ // It does not pass! never.
GameObject.Destroy( gameObject );
}
}
void onComp()
{
Debug.LogFormat( "onComplete {0}" , m_renderer.color.a );
}
void Start ()
{
float liveTime = 2.0f;
m_renderer = GetComponent<SpriteRenderer>();
Sequence seq = DOTween.Sequence();
seq.Append( m_renderer.DOFade( 0.2f , 0.1f ) ).SetEase( Ease.Linear );
seq.Append( m_renderer.DOFade( 0.0f , liveTime ) ).SetEase( Ease.Linear ).OnComplete( onComp );
}