예제 #1
0
    /// <summary>
    /// 绘制委托事件
    /// </summary>

    static public void DrawEvents(string text, Object undoObject, List <EventDelegate> list, string noTarget, string notValid)
    {
        if (!SUGUIEditorTools.DrawHeader(text, text, false))
        {
            return;
        }


        SUGUIEditorTools.BeginContents();
        GUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

        EventDelegateEditor.Field(undoObject, list, notValid, notValid);

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        SUGUIEditorTools.EndContents();
    }
예제 #2
0
    protected void DrawCommonProperties()
    {
        UITweener tw = target as UITweener;

        if (SUGUIEditorTools.DrawHeader("Tweener"))
        {
            SUGUIEditorTools.BeginContents();
            SUGUIEditorTools.SetLabelWidth(110f);

            GUI.changed = false;

            UITweener.Style style    = (UITweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style);
            EaseType        easeType = (EaseType)EditorGUILayout.EnumPopup("Ease Type", tw.easeType);
            EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
            GUILayout.BeginHorizontal();
            float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f));
            GUILayout.Label("seconds");
            GUILayout.EndHorizontal();

            int  tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f));
            bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale);

            if (GUI.changed)
            {
                SUGUIEditorTools.RegisterUndo("Tween Change", tw);
                tw.easeType        = easeType;
                tw.style           = style;
                tw.ignoreTimeScale = ts;
                tw.tweenGroup      = tg;
                tw.duration        = dur;
                tw.delay           = del;
                SUGUITools.SetDirty(tw);
            }
            SUGUIEditorTools.EndContents();
        }

        SUGUIEditorTools.SetLabelWidth(80f);
        SUGUIEditorTools.DrawEvents("On Finished", tw, tw.onFinished);
    }