public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(120f);

        TweenVolume tw = target as TweenVolume;

        GUI.changed = false;

        float from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
        float to   = EditorGUILayout.Slider("To", tw.to, 0f, 1f);

        if (GUI.changed)
        {
            NGUIEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            if (preview)
            {
                tw.Sample(tw.tweenFactor, false);
            }
            NGUITools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
Beispiel #2
0
 public static TweenVolume Begin(GameObject go, float duration, float targetVolume)
 {
     TweenVolume volume = UITweener.Begin<TweenVolume>(go, duration);
     volume.from = volume.volume;
     volume.to = targetVolume;
     if (duration <= 0f)
     {
         volume.Sample(1f, true);
         volume.enabled = false;
     }
     return volume;
 }
Beispiel #3
0
    public static TweenVolume Begin(GameObject go, float duration, float targetVolume)
    {
        TweenVolume tweenVolume = UITweener.Begin <TweenVolume>(go, duration);

        tweenVolume.from = tweenVolume.volume;
        tweenVolume.to   = targetVolume;
        if (duration <= 0f)
        {
            tweenVolume.Sample(1f, isFinished: true);
            tweenVolume.enabled = false;
        }
        return(tweenVolume);
    }
Beispiel #4
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenVolume Begin(GameObject go, float duration, float targetVolume)
    {
        TweenVolume comp = UITweener.Begin <TweenVolume>(go, duration);

        comp.from = comp.volume;
        comp.to   = targetVolume;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }