예제 #1
0
 /// <summary>
 /// 显示带Label组件的子物体
 /// </summary>
 private void ShowLabels()
 {
     if (childLblList != null && childLblList.Count != 0)
     {
         //lblFoldout = EditorGUILayout.Foldout(lblFoldout, "Labels");
         if (lblFoldout)
         {
             DrawGuiHelper.DrawVertical(() =>
             {
                 foreach (var itemLbl in childLblList)
                 {
                     DrawToggleLabelItem(itemLbl, itemLbl.gameObject.activeSelf);
                 }
             }, "Box");
         }
     }
 }
예제 #2
0
 private void ShowSprites()
 {
     if (childSpList != null && childSpList.Count != 0)
     {
         //SpriteFoldout = EditorGUILayout.Foldout(SpriteFoldout, "Sprites");
         if (SpriteFoldout)
         {
             DrawGuiHelper.DrawVertical(() =>
             {
                 foreach (var item in childSpList)
                 {
                     DrawToggleSpriteItem(item, item.gameObject.activeSelf);
                 }
             }, "Box");
         }
     }
 }
예제 #3
0
    private void ShowComAtlas()
    {
        DrawGuiHelper.DrawHorizontal(() =>
        {
            commonAtlasFoldout = EditorGUILayout.Foldout(commonAtlasFoldout, "常用图集");
            DrawGuiHelper.DrawLabel("Size");
            totalAtlasNum = EditorGUILayout.IntField(totalAtlasNum);
        });

        commonAtlasFoldout = totalAtlasNum > 0;

        if (commonAtlasFoldout)
        {
            DrawGuiHelper.DrawVertical(() =>
            {
                for (int i = 0; i < totalAtlasNum; i++)
                {
                    DrawAtlasItem(i);
                }
            });
        }
    }
예제 #4
0
    void OnGUI()
    {
        EditorGUILayout.HelpBox("创建对象:", MessageType.Info, true);
        DrawGuiHelper.DrawVertical(() =>
        {
            DrawGuiHelper.DrawButton("创建按钮", CreateButton);
            isNeedScale = GUILayout.Toggle(isNeedScale, "点击需要缩放效果");
        }, "Box");

        //常用图集
        ShowComAtlas();
        if (totalAtlasNum > 0)
        {
            EditorGUILayout.HelpBox("针对此对象的子物体修改:", MessageType.Info);
        }
        DrawGuiHelper.DrawHorizontal(() =>
        {
            DrawGuiHelper.DrawVertical(() =>
            {
                if (mTarget == null)
                {
                    mTarget = Selection.activeGameObject;
                }
                mTarget = EditorGUILayout.ObjectField("修改对象:", mTarget, typeof(GameObject), true, GUILayout.ExpandWidth(true)) as GameObject;

                if (mTarget != null)
                {
                    DrawGuiHelper.DrawHorizontal(() =>
                    {
                        isNeedChangeName = GUILayout.Toggle(isNeedChangeName, "修改名字");
                        isNeedChangeTs   = GUILayout.Toggle(isNeedChangeTs, "修改位置");
                    });
                    isOnlyShowDepthBelowTen = GUILayout.Toggle(isOnlyShowDepthBelowTen, "只显示层级低于10");


                    if (resultStringBuilder != null && resultStringBuilder.Length > 0)
                    {
                        GUILayout.TextArea(resultStringBuilder.ToString());
                    }

                    DrawGuiHelper.DrawHorizontal(() =>
                    {
                        //labels sprites Textures
                        DrawToggleBtn();
                    });
                    DrawGuiHelper.DrawScrollView(() =>
                    {
                        //labels
                        ShowLabels();
                        //Sprites
                        ShowSprites();
                    }, ref mLblScrollViewPos);
                }
            }, "Box");
            DrawGuiHelper.DrawVertical(() =>
            {
                DrawGuiHelper.DrawButton("保存修改", ApplyChangeAndSave);
                DrawGuiHelper.DrawButton("位置计算工具", OpenCalTs);
                DrawGuiHelper.DrawButton("一键修正缩放", OneKeyResetScale);
                DrawGuiHelper.DrawButton("一键修改使用图集", OneKeyChangeAtlas);
                DrawGuiHelper.DrawButton("查Foreach", FindAllScripts);
            }, "Box");
        });
    }