예제 #1
0
    public override void OnInspectorGUI()
    {
        UIView uiview = target as UIView;

        EditorTools.DrawEntityMark();

        EditorTools.DrawUpdateKeyTextField(uiview);

        UIView.ShowType viewType = (UIView.ShowType)EditorGUILayout.EnumPopup("视图类型", uiview.viewType);

        float releaseDelay = 0;
        int   orderIndex   = 2;

        if (uiview.viewType != UIView.ShowType.CONTENT)
        {
            orderIndex   = ViewOrderToIndex(uiview.viewOrder);
            orderIndex   = EditorGUILayout.Popup("渲染层级", orderIndex, hierarchyOptions);
            releaseDelay = EditorGUILayout.FloatField("延迟释放", uiview.releaseDelay);
        }

        if (Application.isPlaying && uiview.viewType != UIView.ShowType.CONTENT)
        {
            GUI.color = Color.yellow;
            EditorGUILayout.LabelField("渲染序号", (uiview.sortingOrder).ToString());
            GUI.color = Color.white;
        }

        if (GUI.changed)
        {
            EditorTools.RegisterUndo("UIView", uiview);
            uiview.viewType     = viewType;
            uiview.viewOrder    = IndexToViewOrder(orderIndex);
            uiview.releaseDelay = releaseDelay;
            EditorTools.SetDirty(uiview);
        }

        if (EditorTools.DrawHeader("逻辑绑定", false, false))
        {
            this.serializedObject.Update();
            //开始检查是否有修改
            EditorGUI.BeginChangeCheck();

            EditorGUILayout.PropertyField(this.m_EventOnShow, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_EventOnClose, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                this.serializedObject.ApplyModifiedProperties();
            }

            GUILayout.Space(10);
        }



        UIUpdateGroupEditor.DrawUpdateTree(uiview);
    }
예제 #2
0
        public int UF_GetTypeCountInViewStack(int vType)
        {
            if (m_ViewStack.Count == 0)
            {
                return(0);
            }
            UIView.ShowType viewType = (UIView.ShowType)(vType);
            UIView          view     = null;
            int             ret      = 0;

            m_ViewStack.Seek(0);
            do
            {
                view = m_ViewStack.Current;
                if (view.viewType == viewType)
                {
                    ret++;
                }
            } while(m_ViewStack.MoveNext());
            return(ret);
        }
예제 #3
0
        //更具UIViewType类型,自动隐藏或显示界面
        //FULL类型覆盖WINDOW类型,ALWAYS类型不受影响
        protected void UF_ApplyDisplayViewOnStack()
        {
            if (m_ViewStack.Count == 0)
            {
                return;
            }
            m_ViewStack.Seek(0);
            bool   mark = false;
            UIView view = null;

            UIView.ShowType viewType   = UIView.ShowType.FULL;
            int             stackCount = m_ViewStack.Count;

            do
            {
                view     = m_ViewStack.Current;
                viewType = view.viewType;

                view.localPosition = new Vector3(view.localPosition.x, view.localPosition.y, stackCount * VIEW_ZOOM);

                if (mark && viewType != UIView.ShowType.ALWAYS && viewType != UIView.ShowType.CONTENT)
                {
                    view.UF_SetActive(false);
                }
                else
                {
                    view.UF_SetActive(true);
                }
                if (viewType == UIView.ShowType.FULL)
                {
                    mark = true;
                }
                view.stackOrder = stackCount;

                stackCount--;
            } while(m_ViewStack.MoveNext());
        }