Ejemplo n.º 1
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);
        }
        switch (endState)
        {
        case EndPropertyState.Src:
            updater.Pause();
            updater.SetStartVal();
            break;

        case EndPropertyState.Targ:
            updater.End();
            break;

        case EndPropertyState.Keep:
            updater.Pause();
            break;
        }
        updaters.Remove(updater);

        UnityEvent             uevent;
        Tuple <object, string> key = new Tuple <object, string>(component, strProp);

        // Remove pausing event
        eventsDicPause.Remove(key);
        // Remove resuming event
        eventsDicResume.Remove(key);
        // Invoke endineventsDicPauseg event
        uevent = FindPropertyEvent <T>(eventsDicEnd, component, strProp);
        if (uevent != null)
        {
            uevent.Invoke();
        }
        // Remove resuming event
        eventsDicEnd.Remove(key);

        return(true);
    }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="component">Object containing the prop</param>
 /// <param name="strProp">Prop in string</param>
 /// <param name="endState">Set the state of property value when animating ended</param>
 /// <returns>Is successful?</returns>
 public bool EndAnimatingPropertyFloat(object component, string strProp, EndPropertyState endState)
 {
     return(EndAnimatingProperty <float>(updatersFloat, component, strProp, endState));
 }
Ejemplo n.º 3
0
 public bool EndAnimatingPropertyVector3Int(object component, string strProp, EndPropertyState endState)
 {
     return(EndAnimatingProperty <Vector3Int>(updatersVector3Int, component, strProp, endState));
 }
Ejemplo n.º 4
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);
        }