Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 83063cd

Browse files
committed
简单优化了编辑器的操作
1 parent b399d77 commit 83063cd

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed

Diff for: Assets/EmojiText/Editor/SpriteAssetEditor.cs

+34-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class SpriteAssetEditor : Editor
2222
private bool _addTag;
2323
//添加的标签的名称
2424
private string _addTagName;
25+
//选择
26+
private Dictionary<SpriteInforGroup, bool> _selectSpriteGroup = new Dictionary<SpriteInforGroup, bool>();
2527

2628
public void OnEnable()
2729
{
@@ -56,7 +58,7 @@ public override void OnInspectorGUI()
5658
_spriteAsset.IsStatic = EditorGUILayout.Toggle("Static:", _spriteAsset.IsStatic);
5759
GUILayout.EndHorizontal();
5860
GUILayout.BeginHorizontal();
59-
if (GUILayout.Button("Add Tag"))
61+
if (GUILayout.Button("New Tag"))
6062
{
6163
_addTag = !_addTag;
6264
}
@@ -91,6 +93,34 @@ public override void OnInspectorGUI()
9193
}
9294
GUILayout.EndHorizontal();
9395
}
96+
97+
if (GUILayout.Button("Add Tag"))
98+
{
99+
GenericMenu gm = new GenericMenu();
100+
for (int n = 0; n < _tags.Count; n++)
101+
{
102+
string newTag = _tags[n];
103+
gm.AddItem(new GUIContent(_tags[n]), false,
104+
delegate ()
105+
{
106+
List<SpriteInforGroup> selectGroup = new List<SpriteInforGroup>();
107+
foreach (var item in _selectSpriteGroup)
108+
{
109+
if (item.Value)
110+
selectGroup.Add(item.Key);
111+
}
112+
113+
for (int j = 0; j < selectGroup.Count; j++)
114+
{
115+
for (int i = 0; i < selectGroup[j].ListSpriteInfor.Count; i++)
116+
{
117+
ChangeTag(newTag, selectGroup[j].ListSpriteInfor[i]);
118+
}
119+
}
120+
});
121+
}
122+
gm.ShowAsContext();
123+
}
94124
GUILayout.BeginHorizontal();
95125
if (GUILayout.Button("Clear Tag"))
96126
{
@@ -111,6 +141,7 @@ public override void OnInspectorGUI()
111141
for (int i = 0; i < _spriteAsset.ListSpriteGroup.Count; i++)
112142
{
113143
GUILayout.BeginHorizontal("HelpBox");
144+
_selectSpriteGroup[_spriteAsset.ListSpriteGroup[i]] = GUILayout.Toggle(_selectSpriteGroup[_spriteAsset.ListSpriteGroup[i]],"");
114145
#region 展开与收缩按钮
115146
if (GUILayout.Button(_spriteAsset.ListSpriteGroup[i].Tag, _showIndex == i ? "OL Minus" : "OL Plus"))
116147
{
@@ -233,10 +264,12 @@ private void Init()
233264
{
234265
_tags = new List<string>();
235266
_playIndexs = new List<int>();
267+
_selectSpriteGroup.Clear();
236268
for (int i = 0; i < _spriteAsset.ListSpriteGroup.Count; i++)
237269
{
238270
_tags.Add(_spriteAsset.ListSpriteGroup[i].Tag);
239271
_playIndexs.Add(0);
272+
_selectSpriteGroup.Add(_spriteAsset.ListSpriteGroup[i], false);
240273
}
241274
_playIndex = 0;
242275
_showIndex = -1;

Diff for: Assets/EmojiText/Examples/Scene/Text.unity

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RenderSettings:
2626
m_AmbientIntensity: 1
2727
m_AmbientMode: 0
2828
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29-
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
29+
m_SkyboxMaterial: {fileID: 0}
3030
m_HaloStrength: 0.5
3131
m_FlareStrength: 1
3232
m_FlareFadeSpeed: 3
@@ -38,7 +38,7 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1}
41+
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
@@ -956,8 +956,8 @@ Camera:
956956
m_GameObject: {fileID: 1807511892}
957957
m_Enabled: 1
958958
serializedVersion: 2
959-
m_ClearFlags: 1
960-
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
959+
m_ClearFlags: 2
960+
m_BackGroundColor: {r: 0.19010323, g: 0.3173709, b: 0.4528302, a: 0}
961961
m_projectionMatrixMode: 1
962962
m_SensorSize: {x: 36, y: 24}
963963
m_LensShift: {x: 0, y: 0}

Diff for: obj/Debug/Assembly-CSharp.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)