예제 #1
0
        void _updateCircleColor()
        {
            float colorProgress = LikeButtonUtil.clamp(this.outerCircleRadiusProgress, 0.5f, 1);

            colorProgress          = LikeButtonUtil.mapValueFromRangeToRange(colorProgress, 0.5f, 1, 0, 1);
            this.circlePaint.color = Color.lerp(this.circleColor.start, this.circleColor.end, colorProgress);
        }
예제 #2
0
 void _updateInnerBubblesPosition()
 {
     this.m_CurrentRadius2 = this.m_CurrentProgress < 0.3f
         ? LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0, 0.3f, 0, this.m_MaxInnerDotsRadius)
         : this.m_MaxInnerDotsRadius;
     if (this.m_CurrentProgress == 0)
     {
         this.m_CurrentDotSize2 = 0;
     }
     else if (this.m_CurrentProgress < 0.2f)
     {
         this.m_CurrentDotSize2 = this.m_MaxDotSize;
     }
     else if (this.m_CurrentProgress < 0.5f)
     {
         this.m_CurrentDotSize2 = LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0.2f, 0.5f,
                                                                          this.m_MaxDotSize, 0.3f * this.m_MaxDotSize);
     }
     else
     {
         this.m_CurrentDotSize2 =
             LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0.5f, 1, this.m_MaxDotSize * 0.3f,
                                                     0);
     }
 }
예제 #3
0
        void _updateBubblesPaints()
        {
            float progress1 = LikeButtonUtil.clamp(this.m_CurrentProgress, 0.6f, 1);
            int   alpha     =
                (int)LikeButtonUtil.mapValueFromRangeToRange(progress1, 0.6f, 1, 255, 0);

            if (this.m_CurrentProgress < 0.5)
            {
                float progress2 =
                    LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0, 0.5f, 0, 1);
                this.m_CirclePaints[0].color = Color.lerp(this.m_Color1, this.m_Color2, progress2).withAlpha(alpha);
                this.m_CirclePaints[1].color = Color.lerp(this.m_Color2, this.m_Color3, progress2).withAlpha(alpha);
                this.m_CirclePaints[2].color = Color.lerp(this.m_Color3, this.m_Color4, progress2).withAlpha(alpha);
                this.m_CirclePaints[3].color = Color.lerp(this.m_Color4, this.m_Color1, progress2).withAlpha(alpha);
            }
            else
            {
                float progress3 =
                    LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0.5f, 1, 0, 1);
                this.m_CirclePaints[0].color = Color.lerp(this.m_Color2, this.m_Color3, progress3).withAlpha(alpha);
                this.m_CirclePaints[1].color = Color.lerp(this.m_Color3, this.m_Color4, progress3).withAlpha(alpha);
                this.m_CirclePaints[2].color = Color.lerp(this.m_Color4, this.m_Color1, progress3).withAlpha(alpha);
                this.m_CirclePaints[3].color = Color.lerp(this.m_Color1, this.m_Color2, progress3).withAlpha(alpha);
            }
        }
예제 #4
0
        void _updateOuterBubblesPosition()
        {
            if (this.m_CurrentProgress < 0.3f)
            {
                this.m_CurrentRadius1 = LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0, 0.3f, 0,
                                                                                this.m_MaxOuterDotsRadius * 0.8f);
            }
            else
            {
                this.m_CurrentRadius1 = LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0.3f, 1,
                                                                                0.8f * this.m_MaxOuterDotsRadius, this.m_MaxOuterDotsRadius);
            }

            if (this.m_CurrentProgress == 0)
            {
                this.m_CurrentDotSize1 = 0;
            }
            else if (this.m_CurrentProgress < 0.7f)
            {
                this.m_CurrentDotSize1 = this.m_MaxDotSize;
            }
            else
            {
                this.m_CurrentDotSize1 =
                    LikeButtonUtil.mapValueFromRangeToRange(this.m_CurrentProgress, 0.7f, 1, this.m_MaxDotSize, 0);
            }
        }