public void Play(float duration, System.Action MidWayAction, System.Action EndAction = null)
    {
        image.enabled = true;
        transform.SetSiblingIndex(transform.parent.childCount - 1);
        bool midwayReached = false;

        this.ProgressionAnim(duration, delegate(float progression)
        {
            image.color = image.color.SetA(AniMath.Bell(progression));
            if (progression >= .5f && !midwayReached)
            {
                if (MidWayAction != null)
                {
                    MidWayAction();
                }
                midwayReached = true;
            }
        }, delegate
        {
            if (EndAction != null)
            {
                EndAction();
            }
            image.enabled = false;
        });
    }
Beispiel #2
0
 void Flash()
 {
     if (!gameObject.activeInHierarchy)
     {
         return;
     }
     this.ProgressionAnim(flashDuration, progression =>
     {
         HandleProgression(AniMath.Bell(progression));
     }, OnFlashEnd);
 }