Ejemplo n.º 1
0
        private bool ResumeAnimatingProperty <T>(List <PropertyUpdater <T> > updaters, object component, string strProp)
        {
            PropertyUpdater <T> updater = FindAnimatingProperty <T>(updaters, component, strProp);

            if (updater == null)
            {
                return(false);
            }
            updater.Resume();
            return(true);
        }
Ejemplo n.º 2
0
        private bool EndAnimatingProperty <T>(List <PropertyUpdater <T> > updaters, object component, string strProp, EndPropertyState endState)
        {
            PropertyUpdater <T> updater = FindAnimatingProperty <T>(updaters, component, strProp);

            if (updater == null)
            {
                return(false);
            }
            updaters.Remove(updater);
            updater.End(endState);
            return(true);
        }
Ejemplo n.º 3
0
        private PropertyUpdater <T> StartAnimatingProperty <T>(List <PropertyUpdater <T> > updaters, object component, string strProp, Action <T> setter, Func <T> getter, T src, T targ, float durTime,
                                                               PropertyUpdater <T> .GetValAtUpdate getValAtUpdate,
                                                               Action callbacksStart,
                                                               Action callbacksPause,
                                                               Action callbacksResume,
                                                               Action <EndPropertyState> callbacksEnd)
        {
            if (FindAnimatingProperty <T>(updaters, component, strProp) != null)
            {
                Debug.LogWarning("Property is already in animating.");
                return(null);
            }
            PropertyWrapper <T> wrapper = new PropertyWrapper <T>(component, strProp, setter, getter);
            PropertyUpdater <T> updater = null;

            callbacksEnd += (x) => { updaters.Remove(updater); };
            updater       = new PropertyUpdater <T>(wrapper, src, targ, durTime, getValAtUpdate,
                                                    callbacksStart, callbacksPause, callbacksResume, callbacksEnd);
            updaters.Add(updater);
            updater.Start();
            return(updater);
        }
Ejemplo n.º 4
0
 private PropertyUpdater <T> StartAnimatingProperty <T>(List <PropertyUpdater <T> > updaters, object component, string strProp, Action <T> setter, Func <T> getter, T src, T targ, float durTime, PropertyUpdater <T> .GetValAtUpdate getValAtUpdate)
 {
     return(StartAnimatingProperty <T>(updaters, component, strProp, setter, getter, src, targ, durTime, getValAtUpdate, null, null, null, null));
 }