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

Commit 2d13e3a

Browse files
committed
bakup
1 parent 9a012b0 commit 2d13e3a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Assets/TextInlineSprite/Scripts/AutoContainer.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Collections;
22
using System.Collections.Generic;
33
using UnityEngine;
4-
4+
using System.Text.RegularExpressions;
55
namespace EmojiUI
66
{
77
public class AutoContainer
@@ -11,9 +11,11 @@ public class AutoContainer
1111
#else
1212
public const int hot = 100;
1313
#endif
14-
1514
private List<IParser> parsers = new List<IParser>(8);
1615

16+
private Regex TagRegex = new Regex(@"{\S+}");
17+
18+
private List<SpriteTagInfo> tagList;
1719

1820
public void Add(IParser data)
1921
{
@@ -23,7 +25,6 @@ public void Add(IParser data)
2325
Debug.LogErrorFormat("has contains it :{0}", data);
2426
}
2527
#endif
26-
2728
parsers.Add(data);
2829
}
2930

@@ -32,17 +33,18 @@ public bool Remove(IParser data)
3233
return parsers.Remove(data);
3334
}
3435

35-
public void DoStep()
36+
public void DoParser(string content)
3637
{
37-
bool needfix = false;
38+
if (tagList == null)
39+
tagList = new List<SpriteTagInfo>(8);
40+
else
41+
tagList.Clear();
42+
3843
for (int i = 0; i < parsers.Count;++i)
3944
{
4045
var data = parsers[i];
4146

4247
}
43-
44-
//reset
45-
4648
}
4749
}
4850

Assets/TextInlineSprite/Scripts/Parser/IParser.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
using System.Collections;
22
using System.Collections.Generic;
33
using UnityEngine;
4+
using System.Text.RegularExpressions;
45

56
namespace EmojiUI
67
{
78
public interface IParser
89
{
910
int Hot { get; set; }
1011

12+
Regex regex { get; }
13+
1114
bool ParsetContent(string data);
1215
}
1316

0 commit comments

Comments
 (0)