Field() static public méthode

Draw an editor field for the Unity Delegate.
static public Field ( Object undoObject, EventDelegate, del ) : bool
undoObject Object
del EventDelegate,
Résultat bool
 void DrawEvents(string key, string text, List <EventDelegate> list, bool minimalistic)
 {
     if (!NGUIEditorTools.DrawHeader(text, key, false, minimalistic))
     {
         return;
     }
     NGUIEditorTools.BeginContents();
     EventDelegateEditor.Field(mTrigger, list, null, null, minimalistic);
     NGUIEditorTools.EndContents();
 }
    /// <summary>
    /// Draw a list of fields for the specified list of delegates.
    /// </summary>

    static public void DrawEvents(string text, Object undoObject, List <EventDelegate> list, string noTarget, string notValid)
    {
        if (!NGUIEditorTools.DrawHeader(text))
        {
            return;
        }
        NGUIEditorTools.BeginContents();
        EventDelegateEditor.Field(undoObject, list, notValid, notValid);
        NGUIEditorTools.EndContents();
    }
Exemple #3
0
    public void DrawEvents()
    {
        EventListener script = (EventListener)target;

        if (NGUIEditorTools.DrawHeader("Events"))
        {
            NGUIEditorTools.BeginContents();
            script.clearAfterExecuting = EditorGUILayout.ToggleLeft(" Clear After Executing", script.clearAfterExecuting);
            EditorGUILayout.Space();
            EventDelegateEditor.Field(script.gameObject, script.events);
            NGUIEditorTools.EndContents();
        }
    }
Exemple #4
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        Trigger trigger = target as Trigger;

        GUILayout.BeginVertical(GUI.skin.box);
        GUILayout.Label("OnEnter");
        EventDelegateEditor.Field(trigger as Object, trigger.onEnter, "", "");
        GUILayout.EndVertical();
        GUILayout.BeginVertical(GUI.skin.box);
        GUILayout.Label("OnExit");
        EventDelegateEditor.Field(trigger as Object, trigger.onExit, "", "");
        GUILayout.EndVertical();
    }
Exemple #5
0
 public static void DrawEvents(string name, List <EventDelegate> evts, Object undoObject)
 {
     if (!CaomaoEditorTools.DrawHead(name, name))
     {
         return;
     }
     CaomaoEditorTools.BeginContents();
     GUILayout.BeginHorizontal();
     GUILayout.BeginVertical();
     EventDelegateEditor.Field(evts, undoObject);
     GUILayout.EndVertical();
     GUILayout.EndHorizontal();
     CaomaoEditorTools.EndContents();
 }
Exemple #6
0
    /// <summary>
    /// Draw a list of fields for the specified list of delegates.
    /// </summary>

    static public void DrawActions(string text, string key, Object undoObject, ref float distance, List <EventDelegate> list, string noTarget, string notValid)
    {
        if (!UIEditorTools.DrawHeader(text, key))
        {
            return;
        }

        UIEditorTools.BeginContents();
        GUILayout.Space(5);
        distance = EditorGUILayout.FloatField("Trigger Dist", distance);
        GUILayout.Space(5);
        EventDelegateEditor.Field(undoObject, list, notValid, notValid);
        GUILayout.Space(5);
        UIEditorTools.EndContents();
    }
Exemple #7
0
    /// <summary>
    /// Draw a list of fields for the specified list of delegates.
    /// </summary>

    static public void DrawActions(string text, string key, Object undoObject, ref Collider collider, List <EventDelegate> list, string noTarget, string notValid)
    {
        if (!UIEditorTools.DrawHeader(text, key))
        {
            return;
        }

        UIEditorTools.BeginContents();
        GUILayout.Space(5);
        collider = EditorGUILayout.ObjectField("Trigger Rgn", collider, typeof(Collider), true) as Collider;
        GUILayout.Space(5);
        EventDelegateEditor.Field(undoObject, list, notValid, notValid);
        GUILayout.Space(5);
        UIEditorTools.EndContents();
    }
    /// <summary>
    /// 绘制委托事件
    /// </summary>

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


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

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

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        CustomUITweenEditorTools.EndContents();
    }
    /// <summary>
    /// Draw a list of fields for the specified list of delegates.
    /// </summary>

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

        if (!minimalistic)
        {
            NGUIEditorTools.BeginContents(minimalistic);
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();

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

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            NGUIEditorTools.EndContents();
        }
        else
        {
            EventDelegateEditor.Field(undoObject, list, notValid, notValid, minimalistic);
        }
    }
Exemple #10
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출                         */

    /* public - [Event] Function
     * 프랜드 객체가 호출                       */

    // ========================================================================== //

    /* protected - [abstract & virtual]         */

    /* protected - [Event] Function
     * 자식 객체가 호출                         */

    /* protected - Override & Unity API         */
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        _pTarget = target as CUIButtonMultiToggle;
        _pAtlas  = _pTarget.GetComponent <UISprite>().atlas;

        if (_pTarget.listEvent == null)
        {
            _pTarget.listEvent = new List <CUIButtonMultiToggle.SButtonToggle>();
        }

        _iOriginStateCount = _pTarget.listEvent.Count;
        _iOriginStateCount = EditorGUILayout.IntField("상태 개수", _iOriginStateCount);

        if (_pTarget.listEvent == null)
        {
            _pTarget.listEvent = new List <CUIButtonMultiToggle.SButtonToggle>();
        }

        if (_pAtlas == null)
        {
            Debug.LogWarning("UI Sprite의 Atlas가 세팅되지 않았습니다..", _pTarget);
            return;
        }

        if (_iOriginStateCount != _pTarget.listEvent.Count)
        {
            if (_iOriginStateCount < _pTarget.listEvent.Count)
            {
                int iLoopCount = _pTarget.listEvent.Count - _iOriginStateCount;
                try
                {
                    for (int i = 0; i < iLoopCount; i++)
                    {
                        _pTarget.listEvent.Remove(_pTarget.listEvent[i]);
                    }
                }
                catch (System.Exception e)
                {
                    Debug.LogWarning(e);
                }
            }
            else
            {
                int iLoopCount = _iOriginStateCount - _pTarget.listEvent.Count;
                for (int i = 0; i < iLoopCount; i++)
                {
                    _pTarget.listEvent.Add(new CUIButtonMultiToggle.SButtonToggle());
                }
            }
        }

        if (_iOriginStateCount != 0)
        {
            _pTarget.iDefaultState = EditorGUILayout.IntField(string.Format("기본 상태 1 ~ {0}", _pTarget.listEvent.Count), _pTarget.iDefaultState);
        }
        if (_pTarget.iDefaultState > _pTarget.listEvent.Count || _pTarget.iDefaultState <= 0)
        {
            Debug.LogError("상태개수 범위안의 숫자를 선택해 주십시오.");
        }

        _pTarget._eButtonToggleOption = (CUIButtonMultiToggle.EButtonToggleOption)EditorGUILayout.EnumPopup("옵션선택", _pTarget._eButtonToggleOption);

        for (int i = 0; i < _pTarget.listEvent.Count; i++)
        {
            CUIButtonMultiToggle.SButtonToggle sToggle = _pTarget.listEvent[i];
            //NGUIEditorTools.DrawEvents("On StateChange", _pTarget, sToggle.listEvent, false);

            if (NGUIEditorTools.DrawHeader(string.Format("OnChangeState_{0}", i + 1)) == false)
            {
                continue;
            }

            if (_pTarget.listEvent[i].listEvent == null)
            {
                _pTarget.listEvent[i].listEvent = new List <EventDelegate>();
            }

            EventDelegateEditor.Field(_pTarget, _pTarget.listEvent[i].listEvent, false);
            // 여기서 필요한 로직만 가져옴
            //NGUIEditorTools.DrawAdvancedSpriteField(_pAtlas, sToggle.strSpriteName, SelectSprite, false);
            GUILayout.BeginHorizontal();
            {
                if (NGUIEditorTools.DrawPrefixButton("Sprite"))
                {
                    NGUISettings.atlas          = _pAtlas;
                    NGUISettings.selectedSprite = sToggle.strSpriteName;
                    SpriteSelector.Show(SelectSprite);
                    _iCurrentEditItemIndex = i;
                }

                GUILayout.BeginHorizontal();
                GUILayout.Label(sToggle.strSpriteName, "HelpBox", GUILayout.Height(18f));
                NGUIEditorTools.DrawPadding();
                GUILayout.EndHorizontal();
            }
            GUILayout.EndHorizontal();
        }
    }