public void Add(Tweener tweener) { mTweeners.Add(tweener); // We could use a function in the // tweener to prevent allocating a function. tweener.Ended += () => mTweeners.Remove(tweener); }
public StateCategoryControl() { InitializeComponent(); FillAdvancedInterpolationComboBoxes(); AdvancedInterpolationPanel.Visible = false; mTweener = new Tweener(); mTweenTimer = new Timer(); mTweenTimer.Interval = 33; // 30fps is a good default I think mTweenTimer.Tick += new EventHandler(HandleTimerTick); }
public Tweener Using(InterpolationType interpolation, Easing easing) { object currentValueAsObject = LateBinder.GetValueStatic(Caller, MemberToSet); if (currentValueAsObject is float) { float currentValue = (float)currentValueAsObject; Tweener tweener = new Tweener(currentValue, ValueToSet, (float)TimeToTake, interpolation, easing); tweener.PositionChanged = HandlePositionSet; TweenerManager.Self.Add(tweener); tweener.Start(); return tweener; } else { throw new NotImplementedException(); } }