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(); }
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(); }
public void AnimateAppearance() { HandyAnimator anim = HandyAnimator.OfFloat(0, 1, AppearanceDuration); anim.Update += (value) => VisiblePart = (float)(value); anim.core.Start(); SoundMaster.PlaySound(SoundMaster.SegmentBornSound); }
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(); }
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(); }
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(); }