//grab and set generic, neccesary iTweenInBlindGUI arguments:
    void RetrieveArgs()
    {
        foreach (Hashtable item in tweens) {
                if((GameObject)item["target"] == gameObject){
                    tweenArguments=item;
                    break;
                }
            }

            id=(string)tweenArguments["id"];
            type=(string)tweenArguments["type"];
            /* GFX47 MOD START */
            _name=(string)tweenArguments["name"];
            /* GFX47 MOD END */
            method=(string)tweenArguments["method"];

            if(tweenArguments.Contains("time")){
                time=(float)tweenArguments["time"];
            }else{
                time=Defaults.time;
            }

            //do we need to use physics, is there a rigidbody?
            if(rigidbody != null){
                physics=true;
            }

            if(tweenArguments.Contains("delay")){
                delay=(float)tweenArguments["delay"];
            }else{
                delay=Defaults.delay;
            }

            if(tweenArguments.Contains("namedcolorvalue")){
                //allows namedcolorvalue to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
                if(tweenArguments["namedcolorvalue"].GetType() == typeof(NamedValueColor)){
                    namedcolorvalue=(NamedValueColor)tweenArguments["namedcolorvalue"];
                }else{
                    try {
                        namedcolorvalue=(NamedValueColor)Enum.Parse(typeof(NamedValueColor),(string)tweenArguments["namedcolorvalue"],true);
                    } catch {
                        Debug.LogWarning("iTweenInBlindGUI: Unsupported namedcolorvalue supplied! Default will be used.");
                        namedcolorvalue = iTweenInBlindGUI.NamedValueColor._Color;
                    }
                }
            }else{
                namedcolorvalue=Defaults.namedColorValue;
            }

            if(tweenArguments.Contains("looptype")){
                //allows loopType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
                if(tweenArguments["looptype"].GetType() == typeof(LoopType)){
                    loopType=(LoopType)tweenArguments["looptype"];
                }else{
                    try {
                        loopType=(LoopType)Enum.Parse(typeof(LoopType),(string)tweenArguments["looptype"],true);
                    } catch {
                        Debug.LogWarning("iTweenInBlindGUI: Unsupported loopType supplied! Default will be used.");
                        loopType = iTweenInBlindGUI.LoopType.none;
                    }
                }
            }else{
                loopType = iTweenInBlindGUI.LoopType.none;
            }

            if(tweenArguments.Contains("easetype")){
                //allows easeType to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
                if(tweenArguments["easetype"].GetType() == typeof(EaseType)){
                    easeType=(EaseType)tweenArguments["easetype"];
                }else{
                    try {
                        easeType=(EaseType)Enum.Parse(typeof(EaseType),(string)tweenArguments["easetype"],true);
                    } catch {
                        Debug.LogWarning("iTweenInBlindGUI: Unsupported easeType supplied! Default will be used.");
                        easeType=Defaults.easeType;
                    }
                }
            }else{
                easeType=Defaults.easeType;
            }

            if(tweenArguments.Contains("space")){
                //allows space to be set as either an enum(C# friendly) or a string(JS friendly), string case usage doesn't matter to further increase usability:
                if(tweenArguments["space"].GetType() == typeof(Space)){
                    space=(Space)tweenArguments["space"];
                }else{
                    try {
                        space=(Space)Enum.Parse(typeof(Space),(string)tweenArguments["space"],true);
                    } catch {
                        Debug.LogWarning("iTweenInBlindGUI: Unsupported space supplied! Default will be used.");
                        space = Defaults.space;
                    }
                }
            }else{
                space = Defaults.space;
            }

            if(tweenArguments.Contains("islocal")){
                isLocal = (bool)tweenArguments["islocal"];
            }else{
                isLocal = Defaults.isLocal;
            }

            // Added by PressPlay
            if (tweenArguments.Contains("ignoretimescale"))
            {
                useRealTime = (bool)tweenArguments["ignoretimescale"];
            }
            else
            {
                useRealTime = Defaults.useRealTime;
            }

            //instantiates a cached ease equation reference:
            GetEasingFunction();
    }
Exemplo n.º 2
0
 /// <summary>
 /// Starts Animation from objects current state to new
 /// </summary>
 /// <param name="targetState">
 /// Target animation state <see cref="blindGUIAnimationState"/>
 /// </param>
 /// <param name="animationTime">
 /// Duration of animation <see cref="System.Single"/>
 /// </param>
 /// <param name="animationCompleteDelegate">
 /// This function will be called after animation is finished <see cref="AnimationCompleteDelegate"/>
 /// </param>
 /// <param name="easeType">
 /// Animation Ease type <see cref="iTweenInBlindGUI.EaseType"/>
 /// </param>
 public void AnimateTo(blindGUIAnimationState targetState, float animationTime, AnimationCompleteDelegate animationCompleteDelegate, iTweenInBlindGUI.EaseType easeType)
 {
     AnimateTo(targetState, animationTime, animationCompleteDelegate, easeType, 0.0f);
 }
Exemplo n.º 3
0
    /// <summary>
    /// Starts Animation from objects current state to new
    /// </summary>
    /// <param name="targetState">
    /// Target animation state <see cref="blindGUIAnimationState"/>
    /// </param>
    /// <param name="animationTime">
    /// Duration of animation <see cref="System.Single"/>
    /// </param>
    /// <param name="animationCompleteDelegate">
    /// This function will be called after animation is finished <see cref="AnimationCompleteDelegate"/>
    /// </param>
    /// <param name="easeType">
    /// Animation Ease type <see cref="iTweenInBlindGUI.EaseType"/>
    /// </param>
    /// <param name="delay">
    /// Delay of animation <see cref="System.Single"/>
    /// </param>
    public void AnimateTo(blindGUIAnimationState targetState, float animationTime, AnimationCompleteDelegate animationCompleteDelegate, iTweenInBlindGUI.EaseType easeType, float delay)
    {
        m_animationCompleteDelegate = animationCompleteDelegate;
        m_animationTime             = animationTime;
        m_startAnimationState       = new blindGUIAnimationState(this);
        m_finishAnimationState      = targetState;

        //iTweenInBlindGUI.StopByName(this.name+"_animation");
        iTweenInBlindGUI.ValueTo(this.gameObject, iTweenInBlindGUI.Hash(
                                     "name", this.name + "_animation",
                                     "time", m_animationTime,
                                     "delay", delay,
                                     "from", 0,
                                     "to", 1,
                                     "easetype", easeType,
                                     "onupdate", "AnimationStep",
                                     "oncomplete", "AnimationFinished"));
    }
Exemplo n.º 4
0
 /// <summary>
 /// Starts Animation from objects current state to new
 /// </summary>
 /// <param name="targetState">
 /// Target animation state <see cref="blindGUIAnimationState"/>
 /// </param>
 /// <param name="animationTime">
 /// Duration of animation <see cref="System.Single"/>
 /// <param name="easeType">
 /// Animation Ease type <see cref="iTweenInBlindGUI.EaseType"/>
 /// </param>
 public void AnimateTo(blindGUIAnimationState targetState, float animationTime, iTweenInBlindGUI.EaseType easeType)
 {
     AnimateTo(targetState, animationTime, null, easeType, 0.0f);
 }