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

Commit 3d65ec4

Browse files
committed
# Conflicts: # Assets/TextInlineSprite/Scripts/InlineText.cs # Assets/TextInlineSprite/Scripts/Parser/EmojiParser.cs.meta # Assets/TextInlineSprite/Scripts/Parser/HrefParser.cs.meta # Assets/TextInlineSprite/Scripts/Parser/IParser.cs # Assets/TextInlineSprite/Scripts/Parser/ParserTransmit.cs
2 parents 6817054 + 84d3fe4 commit 3d65ec4

File tree

11 files changed

+55
-71
lines changed

11 files changed

+55
-71
lines changed

Assets/Examples.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.
-7.8 KB
Binary file not shown.
-5.67 KB
Binary file not shown.
1.28 KB
Binary file not shown.
31.1 KB
Binary file not shown.

Assets/Examples/Scene/.DS_Store

6 KB
Binary file not shown.

Assets/Examples/Scene/Chat.unity

-13.1 KB
Binary file not shown.

Assets/Examples/Scene/Text.unity

723 Bytes
Binary file not shown.

Assets/Examples/Scripts/ChatTest.cs

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,39 @@
1212
using UnityEngine.UI;
1313
using EmojiUI;
1414

15-
public class ChatTest : MonoBehaviour {
16-
17-
[SerializeField]
18-
private GameObject _PreChatItem;
19-
[SerializeField]
20-
private RectTransform _ChatParent;
21-
[SerializeField]
22-
private RectTransform _ViewContent;
23-
[SerializeField]
24-
private InputField _InputText;
25-
26-
public int testcnt;
27-
28-
#region 点击发送
29-
public void OnClickSend()
30-
{
31-
string _chatString = _InputText.text;
32-
if (string.IsNullOrEmpty(_chatString))
33-
return;
34-
35-
for(int i =0;i < testcnt;++i)
36-
{
37-
GameObject _chatClone = Instantiate(_PreChatItem);
38-
_chatClone.transform.SetParent(_ChatParent);
39-
40-
InlineText _chatText = _chatClone.GetComponentInChildren<InlineText>();
41-
if (_chatText != null)
42-
{
43-
_chatText.text = _chatString;
44-
}
45-
}
46-
47-
}
48-
#endregion
15+
public class ChatTest : MonoBehaviour
16+
{
17+
18+
[SerializeField]
19+
private GameObject _PreChatItem;
20+
[SerializeField]
21+
private RectTransform _ChatParent;
22+
[SerializeField]
23+
private RectTransform _ViewContent;
24+
[SerializeField]
25+
private InputField _InputText;
26+
27+
public int testcnt;
28+
29+
#region 点击发送
30+
public void OnClickSend()
31+
{
32+
string _chatString = _InputText.text;
33+
if (string.IsNullOrEmpty(_chatString))
34+
return;
35+
36+
for (int i = 0; i < testcnt; ++i)
37+
{
38+
GameObject _chatClone = Instantiate(_PreChatItem);
39+
_chatClone.transform.SetParent(_ChatParent);
40+
41+
InlineText _chatText = _chatClone.GetComponentInChildren<InlineText>();
42+
if (_chatText != null)
43+
{
44+
_chatText.text = _chatString;
45+
}
46+
}
47+
48+
}
49+
#endregion
4950
}

Assets/Examples/Scripts/ClickTest.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,29 @@
1111
using UnityEngine;
1212
using EmojiUI;
1313

14-
public class ClickTest : MonoBehaviour {
14+
public class ClickTest : MonoBehaviour
15+
{
1516

16-
private InlineText _text;
17+
private InlineText _text;
1718

18-
void Awake()
19-
{
20-
_text = GetComponent<InlineText>();
21-
}
19+
void Awake()
20+
{
21+
_text = GetComponent<InlineText>();
22+
}
2223

23-
void OnEnable()
24-
{
25-
_text.OnHrefClick.AddListener(OnHrefClick);
26-
}
24+
void OnEnable()
25+
{
26+
_text.OnHrefClick.AddListener(OnHrefClick);
27+
}
2728

28-
void OnDisable()
29-
{
30-
_text.OnHrefClick.RemoveListener(OnHrefClick);
31-
}
29+
void OnDisable()
30+
{
31+
_text.OnHrefClick.RemoveListener(OnHrefClick);
32+
}
3233

33-
private void OnHrefClick(string hrefName,int id)
34-
{
35-
Debug.Log("点击了 " + hrefName+" id:"+id);
36-
// Application.OpenURL("www.baidu.com");
37-
}
34+
private void OnHrefClick(string hrefName, int id)
35+
{
36+
Debug.Log("点击了 " + hrefName + " id:" + id);
37+
// Application.OpenURL("www.baidu.com");
38+
}
3839
}

0 commit comments

Comments
 (0)