public static TweenMaterialTransparency SetTransparency(GameObject go, float transparency, float duration = 1f)
    {
        TweenMaterialTransparency twt = Tweener.InitGO <TweenMaterialTransparency>(go);

        twt.BeginTransparency = twt.CurrentTransparency;
        twt.EndTransparency   = transparency;
        twt.duration          = duration;
        twt.Play(true);

        return(twt);
    }
Beispiel #2
0
    protected override void CustomInspectorGUI()
    {
        TweenMaterialTransparency tTransp = (TweenMaterialTransparency)tween;

        EditorGUILayout.BeginHorizontal();
        EditorTools.DrawLabel("Begin transparency", true, GUILayout.Width(150f));
        tTransp.BeginTransparency = EditorGUILayout.Slider(tTransp.BeginTransparency, 0f, 1f);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorTools.DrawLabel("End transparency", true, GUILayout.Width(150f));
        tTransp.EndTransparency = EditorGUILayout.Slider(tTransp.EndTransparency, 0f, 1f);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorTools.DrawLabel("Shader transparency id", true, GUILayout.Width(150f));
        tTransp.ShaderTransparencyId = EditorGUILayout.TextField(tTransp.ShaderTransparencyId);
        EditorGUILayout.EndHorizontal();
    }