예제 #1
0
 public void Start()
 {
     anim = HandyAnimator.OfFloat((float)Math.PI * 2, 0, LapDuration);
     anim.core.SetInterpolator(new LinearInterpolator());
     anim.Update          += (value) => CurAngle = (float)value;
     anim.core.RepeatCount = -1;
     anim.core.Start();
 }
예제 #2
0
 void AnimateSwitch(float fromX, float toX, Action action)
 {
     switchAnim = HandyAnimator.OfFloat(fromX, toX, SwitchDuration);
     switchAnim.core.SetInterpolator(new DecelerateInterpolator(SwitchEasingFactor));
     switchAnim.Update += (value) => pivot.X = (float)value;
     switchAnim.After  += action;
     switchAnim.core.Start();
 }
예제 #3
0
        public void AnimateAppearance()
        {
            HandyAnimator anim = HandyAnimator.OfFloat(0, 1, AppearanceDuration);

            anim.Update += (value) => VisiblePart = (float)(value);
            anim.core.Start();
            SoundMaster.PlaySound(SoundMaster.SegmentBornSound);
        }
예제 #4
0
 void AnimateDivingTo(int divingTimeDest)
 {
     diveAnim?.core.Cancel();
     diveAnim = HandyAnimator.OfFloat(currentDiveTime,
                                      divingTimeDest, (int)Math.Abs(currentDiveTime - divingTimeDest));
     diveAnim.Update += (value) => CurrentDiveTime = (float)value;
     diveAnim.core.Start();
 }
예제 #5
0
        public void AnimateAppearance()
        {
            HandyAnimator apAnim = HandyAnimator.OfFloat(0, 1, BirthDuration);

            apAnim.core.SetInterpolator(new OvershootInterpolator(2));
            apAnim.core.StartDelay      = (int)(random.NextDouble() * MaxBirthDelay);
            apAnim.Update              += (value) => BirthScaleFactor = (float)value;
            apAnim.core.AnimationStart += (sender, e)
                                          => SoundMaster.PlaySound(SoundMaster.PointBornSound);
            apAnim.core.Start();
        }
예제 #6
0
        static public void ChangeBackgroundColor(bool toBlack)
        {
            float coefDest = (toBlack) ? 0 : 1;
            var   prefs    = Application.Context.GetSharedPreferences("AppPrefs",
                                                                      FileCreationMode.Private);
            var editor = prefs.Edit();

            editor.PutFloat("background", coefDest);
            editor.Commit();

            bgAnim?.core.Cancel();
            bgAnim = HandyAnimator.OfFloat(currentBgCoef, coefDest,
                                           (int)(Math.Abs(currentBgCoef - coefDest) * BgAnimDuration));
            bgAnim.core.SetInterpolator(new DecelerateInterpolator(1.6f));
            bgAnim.Update += (value) => CurrentBgCoef = (float)value;
            bgAnim.core.Start();
        }