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

Commit 8e8d8d8

Browse files
author
DESKTOP-UBV38B7\codingworks
committed
心血来潮,更新了命名规则
1 parent 6a980c2 commit 8e8d8d8

File tree

17 files changed

+399
-384
lines changed

17 files changed

+399
-384
lines changed

Assets/TextInlineSprite/Editor/CreateSpriteAsset.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ static void main()
2828
if (isNewAsset)
2929
{
3030
spriteAsset = ScriptableObject.CreateInstance<SpriteAsset>();
31-
spriteAsset.texSource = sourceTex;
32-
spriteAsset.listSpriteGroup = GetAssetSpriteInfor(sourceTex);
31+
spriteAsset.TexSource = sourceTex;
32+
spriteAsset.ListSpriteGroup = GetAssetSpriteInfor(sourceTex);
3333
AssetDatabase.CreateAsset(spriteAsset, filePath + fileNameWithoutExtension + ".asset");
3434
}
3535
}
@@ -50,29 +50,29 @@ public static List<SpriteInforGroup> GetAssetSpriteInfor(Texture2D tex)
5050
continue;
5151
SpriteInfor temp = new SpriteInfor();
5252
Sprite sprite = objects[i] as Sprite;
53-
temp.ID = i;
54-
temp.name = sprite.name;
55-
temp.pivot = sprite.pivot;
56-
temp.rect = sprite.rect;
57-
temp.sprite = sprite;
58-
temp.tag = sprite.name;
59-
temp.uv = GetSpriteUV(_texSize, sprite.rect);
53+
temp.Id = i;
54+
temp.Name = sprite.name;
55+
temp.Pivot = sprite.pivot;
56+
temp.Rect = sprite.rect;
57+
temp.Sprite = sprite;
58+
temp.Tag = sprite.name;
59+
temp.Uv = GetSpriteUV(_texSize, sprite.rect);
6060
_tempSprite.Add(temp);
6161
}
6262

6363
for (int i = 0; i < _tempSprite.Count; i++)
6464
{
6565
SpriteInforGroup _tempGroup = new SpriteInforGroup();
66-
_tempGroup.tag = _tempSprite[i].tag;
67-
//_tempGroup.size = 24.0f;
68-
//_tempGroup.width = 1.0f;
69-
_tempGroup.listSpriteInfor = new List<SpriteInfor>();
70-
_tempGroup.listSpriteInfor.Add(_tempSprite[i]);
66+
_tempGroup.Tag = _tempSprite[i].Tag;
67+
//_tempGroup.Size = 24.0f;
68+
//_tempGroup.Width = 1.0f;
69+
_tempGroup.ListSpriteInfor = new List<SpriteInfor>();
70+
_tempGroup.ListSpriteInfor.Add(_tempSprite[i]);
7171
for (int j = i+1; j < _tempSprite.Count; j++)
7272
{
73-
if ( _tempGroup.tag == _tempSprite[j].tag)
73+
if ( _tempGroup.Tag == _tempSprite[j].Tag)
7474
{
75-
_tempGroup.listSpriteInfor.Add(_tempSprite[j]);
75+
_tempGroup.ListSpriteInfor.Add(_tempSprite[j]);
7676
_tempSprite.RemoveAt(j);
7777
j--;
7878
}

Assets/TextInlineSprite/Editor/SpriteAssetEditor.cs

Lines changed: 84 additions & 84 deletions
Large diffs are not rendered by default.

Assets/TextInlineSprite/Editor/TextMenuExtender.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ public class TextMenuExtender
1010
static void CreateCustomGameObject(MenuCommand menuCommand)
1111
{
1212
GameObject go = null;
13-
InlineManager _inline = AssetDatabase.LoadAssetAtPath<InlineManager>("Assets/TextInlineSprite/Prefabs/TextInline.prefab");
14-
if (_inline)
13+
InlineManager inline = AssetDatabase.LoadAssetAtPath<InlineManager>("Assets/TextInlineSprite/Prefabs/TextInline.prefab");
14+
if (inline)
1515
{
16-
go = GameObject.Instantiate(_inline).gameObject;
16+
go = GameObject.Instantiate(inline).gameObject;
1717
}
1818
else
1919
{
2020
go = new GameObject();
2121
go.AddComponent<InlineText>();
2222
}
2323
go.name = "InlinText";
24-
GameObject _parent = menuCommand.context as GameObject;
25-
if (_parent == null)
24+
GameObject parent = menuCommand.context as GameObject;
25+
if (parent == null)
2626
{
27-
_parent = new GameObject("Canvas");
28-
_parent.layer = LayerMask.NameToLayer("UI");
29-
_parent.AddComponent<Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
30-
_parent.AddComponent<CanvasScaler>();
31-
_parent.AddComponent<GraphicRaycaster>();
27+
parent = new GameObject("Canvas");
28+
parent.layer = LayerMask.NameToLayer("UI");
29+
parent.AddComponent<Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
30+
parent.AddComponent<CanvasScaler>();
31+
parent.AddComponent<GraphicRaycaster>();
3232

3333
EventSystem _es = GameObject.FindObjectOfType<EventSystem>();
3434
if (!_es)
@@ -37,7 +37,7 @@ static void CreateCustomGameObject(MenuCommand menuCommand)
3737
_es.gameObject.AddComponent<StandaloneInputModule>();
3838
}
3939
}
40-
GameObjectUtility.SetParentAndAlign(go, _parent);
40+
GameObjectUtility.SetParentAndAlign(go, parent);
4141
//注册返回事件
4242
Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
4343
Selection.activeObject = go;
-7.24 KB
Binary file not shown.
-7 KB
Binary file not shown.
-5.56 KB
Binary file not shown.

Assets/TextInlineSprite/Examples/Scripts/ChatTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public void OnClickSend()
3434

3535
GameObject _chatClone = Instantiate(_PreChatItem);
3636
_chatClone.transform.SetParent( _ChatParent);
37-
InlineText _chatText = _chatClone.transform.FindChild("Text").GetComponent<InlineText>();
38-
Image _chatImage= _chatClone.transform.FindChild("BG").GetComponent<Image>();
37+
InlineText _chatText = _chatClone.transform.Find("Text").GetComponent<InlineText>();
38+
Image _chatImage= _chatClone.transform.Find("BG").GetComponent<Image>();
3939
_chatText.text = _chatString;
4040
// _chatText.ActiveText();
4141
Vector2 _imagSize = _ChatTextSize;
-4.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)