Esempio n. 1
0
 //灰度预览
 static public void DrawGreyPreView(UIUpdateGroup view)
 {
     if (view == null)
     {
         return;
     }
     GUILayout.Space(2);
     GUILayout.BeginHorizontal();
     GUILayout.Label("灰度预览", GUILayout.Width(115));
     GUILayout.Space(2);
     if (GUILayout.Button("色彩", GUILayout.Width(60)))
     {
         view.UF_SetGrey(false);
         view.UF_SetActive(false);
         view.UF_SetActive(true);
     }
     if (GUILayout.Button("灰度", GUILayout.Width(60)))
     {
         view.UF_SetGrey(true);
         view.UF_SetActive(false);
         view.UF_SetActive(true);
     }
     GUILayout.EndHorizontal();
     GUILayout.Space(2);
 }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        UIUpdateGroup updateGroup = target as UIUpdateGroup;

        base.OnInspectorGUI();
        EditorTools.DrawUpdateKeyTextField(updateGroup);
        EditorTools.DrawGreyPreView(updateGroup);
        DrawUpdateTree(updateGroup);
    }
Esempio n. 3
0
    public static void DrawUpdateTree(UIUpdateGroup updateGroup)
    {
        GUI.color = Color.yellow;



        if (GUILayout.Button("构建更新树", GUILayout.Height(40)))
        {
            UIUpdateTools.UF_BuildUpdateList(updateGroup, updateGroup.ListUpdateUI);
            EditorTools.SetDirty(updateGroup);
        }

        GUI.color = Color.white;


        if (updateGroup == null)
        {
            return;
        }
        if (EditorTools.DrawHeader("显示更新树", false, false))
        {
            DrawUpdateGroup(updateGroup as UIUpdateGroup, 0, Color.cyan);
        }
    }
Esempio n. 4
0
 public static void Exchange()
 {
     GameObject[] objs = Selection.gameObjects;
     for (int i = 0, count = objs.Length; i < count; i++)
     {
         UIUpdateGroup updategroup = objs[i].GetComponent <UIUpdateGroup>();
         if (updategroup)
         {
             updategroup.updateKey = objs[i].name;
             continue;
         }
         UISlider slider = objs[i].GetComponent <UISlider>();
         if (slider)
         {
             slider.updateKey = objs[i].name;
             continue;
         }
         UIView uiview = objs[i].GetComponent <UIView>();
         if (uiview)
         {
             uiview.updateKey = objs[i].name;
             continue;
         }
         UIToggle toggle = objs[i].GetComponent <UIToggle>();
         if (toggle)
         {
             toggle.updateKey = objs[i].name;
             continue;
         }
         UIGrid grid = objs[i].GetComponent <UIGrid>();
         if (grid)
         {
             grid.updateKey = objs[i].name;
             continue;
         }
         UITexture texture = objs[i].GetComponent <UITexture>();
         if (texture)
         {
             texture.updateKey = objs[i].name;
             continue;
         }
         UIButton button = objs[i].GetComponent <UIButton>();
         if (button)
         {
             button.updateKey = objs[i].name;
             continue;
         }
         UISprite sprite = objs[i].GetComponent <UISprite>();
         if (sprite)
         {
             sprite.updateKey = objs[i].name;
             continue;
         }
         UILabel label = objs[i].GetComponent <UILabel>();
         if (label)
         {
             label.updateKey = objs[i].name;
             continue;
         }
     }
 }
Esempio n. 5
0
    private static void DrawUpdateGroup(UIUpdateGroup uigroup, int tagidx, Color color)
    {
        if (uigroup == null)
        {
            return;
        }

        GUI.backgroundColor = color;

        GUILayout.BeginHorizontal();
        GUILayout.Space(tagidx * 50);

//		EditorGUILayout.ObjectField (uigroup, uigroup.GetType (),false);

        GUI.contentColor = Color.white;
        EditorTools.DrawPingBox(uigroup, string.Format("{0}  <{1}>", uigroup.updateKey, uigroup.GetType().Name));

        GUILayout.EndHorizontal();

        ++tagidx;

        for (int k = 0; k < uigroup.ListUpdateUI.Count; k++)
        {
            if (uigroup.ListUpdateUI [k] is UIUpdateGroup)
            {
                DrawUpdateGroup(uigroup.ListUpdateUI [k] as UIUpdateGroup, tagidx, color);
            }
            else
            {
                GUI.backgroundColor = color;
                GUILayout.BeginHorizontal();
                GUILayout.Space(tagidx * 50);
                IUIUpdate ui = uigroup.ListUpdateUI[k] as IUIUpdate;
                if (ui != null)
                {
                    EditorTools.DrawPingBox(uigroup.ListUpdateUI[k], string.Format("{0}  <{1}>", ui.updateKey, ui.GetType().Name));
                }
                else
                {
                    GUI.backgroundColor = Color.grey;
                    EditorTools.DrawPingBox(null, "<null>");
                }
                GUILayout.EndHorizontal();
            }
        }

        if (uigroup.MapDynamicUI != null)
        {
            ++tagidx;
            foreach (Object obj in uigroup.MapDynamicUI.Values)
            {
                if (obj is UIUpdateGroup)
                {
                    DrawUpdateGroup(obj as UIUpdateGroup, tagidx, Color.red);
                }
                else
                {
                    GUI.backgroundColor = color;
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(tagidx * 50);
                    IUIUpdate ui = obj as IUIUpdate;

                    if (ui != null)
                    {
                        EditorTools.DrawPingBox(obj, string.Format("{0}  <{1}>", ui.updateKey, ui.GetType().Name));
                    }
                    else
                    {
                        GUI.backgroundColor = Color.grey;
                        EditorTools.DrawPingBox(null, "<null>");
                    }

                    GUILayout.EndHorizontal();
                }
            }
        }
    }