├── .gitignore ├── Assets ├── EmojiText.meta └── EmojiText │ ├── Editor.meta │ ├── Editor │ ├── CreateSpriteAsset.cs │ ├── CreateSpriteAsset.cs.meta │ ├── DrawSpriteAsset.cs │ ├── DrawSpriteAsset.cs.meta │ ├── EmojiShaderGUI.cs │ ├── EmojiShaderGUI.cs.meta │ ├── InlineTextEditor.cs │ ├── InlineTextEditor.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── emoji-alipay.png │ │ ├── emoji-alipay.png.meta │ │ ├── emoji-wechatpay.jpg │ │ └── emoji-wechatpay.jpg.meta │ ├── SpriteAssetEditor.cs │ ├── SpriteAssetEditor.cs.meta │ ├── TextMenuExtender.cs │ └── TextMenuExtender.cs.meta │ ├── Examples.meta │ ├── Examples │ ├── Scene.meta │ ├── Scene │ │ ├── Chat.unity │ │ ├── Chat.unity.meta │ │ ├── Text.unity │ │ └── Text.unity.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── ChatItem.cs │ │ ├── ChatItem.cs.meta │ │ ├── ChatTest.cs │ │ ├── ChatTest.cs.meta │ │ ├── ClickTest.cs │ │ └── ClickTest.cs.meta │ ├── data.txt │ └── data.txt.meta │ ├── Prefabs.meta │ ├── Prefabs │ ├── TextInline.prefab │ └── TextInline.prefab.meta │ ├── Resources.meta │ ├── Resources │ ├── Shader.meta │ └── Shader │ │ ├── UI-Emoji.shader │ │ └── UI-Emoji.shader.meta │ ├── Scripts.meta │ ├── Scripts │ ├── InlineManager.cs │ ├── InlineManager.cs.meta │ ├── InlineText.cs │ ├── InlineText.cs.meta │ ├── Pool.cs │ ├── Pool.cs.meta │ ├── SpriteAsset.cs │ ├── SpriteAsset.cs.meta │ ├── SpriteGraphic.cs │ ├── SpriteGraphic.cs.meta │ ├── Utility.cs │ └── Utility.cs.meta │ ├── Texture.meta │ └── Texture │ ├── chatpopo.png │ ├── chatpopo.png.meta │ ├── emoji.asset │ ├── emoji.asset.meta │ ├── emoji.png │ ├── emoji.png.meta │ ├── emoji.png~ │ ├── emoji_lxh.asset │ ├── emoji_lxh.asset.meta │ ├── emoji_lxh.png │ ├── emoji_lxh.png.meta │ ├── player.png │ └── player.png.meta ├── LICENSE ├── Packages ├── manifest.json └── manifest.json.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README - 01.md ├── README.md ├── ShotScreens ├── editor_01.png ├── editor_02.png ├── editor_03.png ├── text01.gif ├── text02.jpg ├── tw04_01.gif ├── tw04_02.gif ├── tw04_03.png ├── tw05_00.png └── tw05_01.gif ├── UnityPackageManager └── manifest.json └── obj └── Debug ├── Assembly-CSharp-Editor.csprojAssemblyReference.cache └── Assembly-CSharp.csprojAssemblyReference.cache /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | 31 | /.vs 32 | /Library 33 | /Temp 34 | *.csproj 35 | *.sln 36 | *.suo 37 | 38 | 39 | .vscode/ 40 | -------------------------------------------------------------------------------- /Assets/EmojiText.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e99469d17e7e9c4db4c90b65b29fc30 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d9b8e5c3970b0498fe500a17bb5e7d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/CreateSpriteAsset.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | using System.IO; 5 | using System.Collections.Generic; 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | public class CreateSpriteAsset : EditorWindow 10 | { 11 | private static Texture2D _sourceTex; 12 | 13 | private Vector2 _texScrollView = Vector2.zero; 14 | private static string _assetPath = ""; 15 | private static SpriteAsset _spriteAsset; 16 | private static DrawSpriteAsset _drawSpriteAsset; 17 | 18 | [MenuItem("Assets/Create/Sprite Asset", false, 10)] 19 | static void main() 20 | { 21 | Object target = Selection.activeObject; 22 | if (target == null || target.GetType() != typeof(Texture2D)) 23 | return; 24 | 25 | _sourceTex = target as Texture2D; 26 | 27 | GetWindow("Asset Window"); 28 | } 29 | 30 | /// 31 | /// 打开资源窗口 32 | /// 33 | /// 34 | public static void OpenAsset(SpriteAsset spriteAsset) 35 | { 36 | if (spriteAsset != null && spriteAsset.TexSource != null) 37 | { 38 | _spriteAsset = spriteAsset; 39 | _sourceTex = (Texture2D)_spriteAsset.TexSource; 40 | SetDrawSpriteAsset(_spriteAsset); 41 | _assetPath = AssetDatabase.GetAssetPath(_spriteAsset); 42 | GetWindow("Asset Window"); 43 | } 44 | } 45 | 46 | 47 | 48 | private void OnGUI() 49 | { 50 | if (_sourceTex != null) 51 | { 52 | GUILayout.BeginHorizontal(); 53 | //纹理渲染-------------- 54 | _texScrollView = GUILayout.BeginScrollView(_texScrollView, "", GUILayout.Width(0.625f * Screen.width)); 55 | GUILayout.Label(_sourceTex); 56 | GUILayout.EndScrollView(); 57 | //参数设置--------------- 58 | GUILayout.BeginVertical(); 59 | GUILayout.BeginVertical("HelpBox"); 60 | GUILayout.BeginHorizontal(); 61 | GUILayout.Label("纹理名称", GUILayout.Width(80)); 62 | GUILayout.Label(_sourceTex.name); 63 | GUILayout.FlexibleSpace(); 64 | //加载 图片 65 | if (GUILayout.Button("Load")) 66 | { 67 | string filePath = EditorUtility.OpenFilePanel("加载图集文件", "", "png"); 68 | if (!string.IsNullOrEmpty(filePath)) 69 | { 70 | //绝对路径->相对路径 71 | filePath = "Assets" + filePath.Replace(Application.dataPath, ""); 72 | Texture2D tex2d = AssetDatabase.LoadAssetAtPath(filePath); 73 | if (tex2d != null) 74 | { 75 | _sourceTex = tex2d; 76 | if (_spriteAsset) 77 | _spriteAsset.TexSource = _sourceTex; 78 | } 79 | } 80 | } 81 | GUILayout.EndHorizontal(); 82 | GUILayout.BeginHorizontal(); 83 | GUILayout.Label("纹理分辨率", GUILayout.Width(80)); 84 | GUILayout.Label(_sourceTex.width + " * " + _sourceTex.height); 85 | GUILayout.EndHorizontal(); 86 | 87 | //保存 88 | GUILayout.BeginHorizontal(); 89 | GUILayout.Label("配置文件路径", GUILayout.Width(80)); 90 | GUILayout.Label(_assetPath); 91 | GUILayout.FlexibleSpace(); 92 | if (GUILayout.Button(_spriteAsset == null ? "Save" : "Save As")) 93 | { 94 | string filePath = EditorUtility.SaveFilePanelInProject("保存表情的序列化文件", _sourceTex.name, "asset", "保存表情的序列化文件"); 95 | if (!string.IsNullOrEmpty(filePath)) 96 | { 97 | _assetPath = filePath; 98 | //创建序列化文件 99 | _spriteAsset = ScriptableObject.CreateInstance(); 100 | _spriteAsset.TexSource = _sourceTex; 101 | _spriteAsset.ListSpriteGroup = new List(); 102 | // spriteAsset.ListSpriteGroup = GetAssetSpriteInfor(sourceTex); 103 | AssetDatabase.CreateAsset(_spriteAsset, _assetPath); 104 | 105 | //设置精灵信息的绘制类 106 | SetDrawSpriteAsset(_spriteAsset); 107 | } 108 | 109 | } 110 | GUILayout.EndHorizontal(); 111 | GUILayout.EndVertical(); 112 | 113 | GUILayout.Space(5); 114 | 115 | //绘制属性 116 | if (_drawSpriteAsset != null) 117 | _drawSpriteAsset.Draw(); 118 | 119 | GUILayout.EndVertical(); 120 | GUILayout.EndHorizontal(); 121 | 122 | //非自动布局绘制------------------ 123 | //绘制线 124 | DrawTextureLines(); 125 | } 126 | 127 | //更新信息 128 | if (_drawSpriteAsset != null) 129 | _drawSpriteAsset.UpdateSpriteGroup(); 130 | 131 | //保存序列化文件 132 | if (_spriteAsset) 133 | EditorUtility.SetDirty(_spriteAsset); 134 | 135 | } 136 | 137 | 138 | //绘制纹理上的线 139 | private void DrawTextureLines() 140 | { 141 | if (_sourceTex && _spriteAsset) 142 | { 143 | Handles.BeginGUI(); 144 | 145 | //行 - line 146 | if (_spriteAsset.Row > 0) 147 | { 148 | Handles.color = _spriteAsset.IsStatic ? Color.green : Color.red; 149 | float interval = _sourceTex.height / _spriteAsset.Row; 150 | float remain = _texScrollView.y % interval; 151 | int max = (int)(Screen.height / interval); 152 | 153 | for (int i = 0; i < max; i++) 154 | { 155 | float h = (interval * i) + (interval - remain); 156 | float endx = 0.625f * Screen.width - 15.0f; 157 | endx = endx > _sourceTex.width ? _sourceTex.width : endx; 158 | Handles.DrawLine(new Vector3(5, h), new Vector3(endx, h)); 159 | } 160 | } 161 | //列 - line 162 | if (_spriteAsset.Column > 0) 163 | { 164 | Handles.color = Color.green; 165 | float interval = _sourceTex.width / _spriteAsset.Column; 166 | float remain = _texScrollView.x % interval; 167 | float scrollViewWidth = 0.625f * Screen.width; 168 | scrollViewWidth = scrollViewWidth > _sourceTex.width ? _sourceTex.width : scrollViewWidth; 169 | int max = (int)(scrollViewWidth / interval); 170 | 171 | for (int i = 0; i < max; i++) 172 | { 173 | float w = (interval * i) + (interval - remain); 174 | float endy = Screen.height > _sourceTex.height ? _sourceTex.height : (Screen.height); 175 | Handles.DrawLine(new Vector3(w, 5), new Vector3(w, endy)); 176 | } 177 | } 178 | 179 | Handles.EndGUI(); 180 | } 181 | } 182 | 183 | 184 | //绘制信息的类 185 | private static void SetDrawSpriteAsset(SpriteAsset spriteAsset) 186 | { 187 | //添加 188 | if (_drawSpriteAsset == null) 189 | _drawSpriteAsset = new DrawSpriteAsset(spriteAsset); 190 | else 191 | _drawSpriteAsset.SetSpriteAsset(spriteAsset); 192 | } 193 | } 194 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/CreateSpriteAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95ebb99458b21c346a54783fdbaf5607 3 | timeCreated: 1458916502 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/DrawSpriteAsset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | public class DrawSpriteAsset 10 | { 11 | private string _assetPath = "配置文件暂未保存"; 12 | private Vector2 _spritesScrollView = Vector2.zero; 13 | private int _showIndex = -1; 14 | private SpriteAsset _spriteAsset; 15 | private bool _isSponsor; 16 | private Texture[] _payTexs; 17 | 18 | public DrawSpriteAsset(SpriteAsset spriteAsset) 19 | { 20 | _spriteAsset = spriteAsset; 21 | _payTexs = new Texture[2]; 22 | _payTexs[0] = Resources.Load("emoji-alipay"); 23 | _payTexs[1] = Resources.Load("emoji-wechatpay"); 24 | } 25 | 26 | /// 27 | /// 设置信息 28 | /// 29 | /// 30 | public void SetSpriteAsset(SpriteAsset spriteAsset) 31 | { 32 | _spriteAsset = spriteAsset; 33 | } 34 | 35 | /// 36 | /// 绘制 37 | /// 38 | public void Draw() 39 | { 40 | if (_spriteAsset) 41 | { 42 | //赞助 43 | _isSponsor = EditorGUILayout.Toggle("请作者喝杯咖啡?", _isSponsor); 44 | if (_isSponsor&& _payTexs!=null) 45 | { 46 | GUILayout.BeginHorizontal("HelpBox"); 47 | for (int i = 0; i < _payTexs.Length; i++) 48 | { 49 | Texture payTex = _payTexs[i]; 50 | if (payTex != null) 51 | { 52 | float height =450.0f; 53 | float width = (payTex.width / (float)payTex.height) * height; 54 | GUILayout.Label(payTex, GUILayout.Width(width),GUILayout.Height(height)); 55 | } 56 | GUILayout.Space(5); 57 | } 58 | GUILayout.EndHorizontal(); 59 | } 60 | EditorGUILayout.HelpBox("强烈建议将资源图片上的所有表情,制成规格完全一样的!有规律才支持程序自动分割处理!如果需要实在特殊,请更行更改代码,或者通过(https://github.com/coding2233/TextInlineSprite)与我沟通。", MessageType.Info); 61 | //属性 62 | GUILayout.Label("属性:"); 63 | GUILayout.BeginVertical("HelpBox"); 64 | //id 65 | GUILayout.BeginHorizontal(); 66 | GUILayout.Label("Id", GUILayout.Width(80)); 67 | _spriteAsset.Id = EditorGUILayout.IntField(_spriteAsset.Id); 68 | GUILayout.EndHorizontal(); 69 | //是否为静态表情 70 | GUILayout.BeginHorizontal(); 71 | bool isStatic = GUILayout.Toggle(_spriteAsset.IsStatic, "是否为静态表情?"); 72 | if (isStatic != _spriteAsset.IsStatic) 73 | { 74 | if (EditorUtility.DisplayDialog("提示", "切换表情类型,会导致重新命名Tag,请确认操作", "确认", "取消")) 75 | { 76 | _spriteAsset.IsStatic = isStatic; 77 | } 78 | } 79 | GUILayout.FlexibleSpace(); 80 | //动画的速度 81 | if (!_spriteAsset.IsStatic) 82 | { 83 | GUILayout.Label("动画速度", GUILayout.Width(80)); 84 | _spriteAsset.Speed = EditorGUILayout.FloatField(_spriteAsset.Speed); 85 | } 86 | GUILayout.EndHorizontal(); 87 | //行列速度 88 | GUILayout.BeginHorizontal(); 89 | GUILayout.Label("Row", GUILayout.Width(80)); 90 | _spriteAsset.Row = EditorGUILayout.IntField(_spriteAsset.Row); 91 | GUILayout.EndHorizontal(); 92 | GUILayout.BeginHorizontal(); 93 | GUILayout.Label("Column", GUILayout.Width(80)); 94 | _spriteAsset.Column = EditorGUILayout.IntField(_spriteAsset.Column); 95 | GUILayout.EndHorizontal(); 96 | GUILayout.EndVertical(); 97 | 98 | //具体的精灵信息 99 | if (_spriteAsset && _spriteAsset.ListSpriteGroup.Count > 0) 100 | { 101 | List inforGroups = _spriteAsset.ListSpriteGroup; 102 | GUILayout.Label("精灵信息:"); 103 | _spritesScrollView = GUILayout.BeginScrollView(_spritesScrollView, "HelpBox"); 104 | for (int i = 0; i < inforGroups.Count; i++) 105 | { 106 | GUILayout.BeginVertical("HelpBox"); 107 | //标题信息.......... 108 | GUILayout.BeginHorizontal(); 109 | if (GUILayout.Button(i.ToString(), _showIndex == i ? "OL Minus" : "OL Plus", GUILayout.Width(40), GUILayout.Height(40))) 110 | { 111 | if (_showIndex == i) 112 | _showIndex = -1; 113 | else 114 | _showIndex = i; 115 | 116 | //_showSprites.Clear(); 117 | } 118 | //表情预览 119 | GUILayout.Label("", GUILayout.Width(40), GUILayout.Height(40)); 120 | if (inforGroups[i].ListSpriteInfor.Count > 0) 121 | { 122 | Rect lastRect = GUILayoutUtility.GetLastRect(); 123 | //渲染精灵图片 124 | GUI.DrawTextureWithTexCoords(lastRect, _spriteAsset.TexSource, inforGroups[i].ListSpriteInfor[0].DrawTexCoord); 125 | } 126 | GUILayout.Label("Tag:"); 127 | inforGroups[i].Tag = EditorGUILayout.TextField(inforGroups[i].Tag); 128 | GUILayout.Label("Size:"); 129 | inforGroups[i].Size = EditorGUILayout.FloatField(inforGroups[i].Size); 130 | GUILayout.Label("Width:"); 131 | inforGroups[i].Width = EditorGUILayout.FloatField(inforGroups[i].Width); 132 | GUILayout.EndHorizontal(); 133 | //具体信息 134 | if (_showIndex == i) 135 | { 136 | List spriteInfors = inforGroups[i].ListSpriteInfor; 137 | for (int m = 0; m < spriteInfors.Count; m++) 138 | { 139 | GUILayout.BeginHorizontal("HelpBox"); 140 | //渲染精灵图片 141 | GUILayout.Label("", GUILayout.Width(80), GUILayout.Height(80)); 142 | 143 | GUI.DrawTextureWithTexCoords(GUILayoutUtility.GetLastRect(), _spriteAsset.TexSource, spriteInfors[m].DrawTexCoord); 144 | 145 | //间隔 146 | GUILayout.Space(50); 147 | 148 | //渲染其他信息 149 | GUI.enabled = false; 150 | GUILayout.BeginVertical(); 151 | //id 152 | GUILayout.BeginHorizontal(); 153 | GUILayout.Label("Id:", GUILayout.Width(50)); 154 | GUILayout.Label(spriteInfors[m].Id.ToString()); 155 | GUILayout.EndHorizontal(); 156 | //Rect 157 | GUILayout.BeginHorizontal(); 158 | GUILayout.Label("Rect:", GUILayout.Width(50)); 159 | EditorGUILayout.RectField(spriteInfors[m].Rect); 160 | GUILayout.EndHorizontal(); 161 | //uvs 162 | for (int u = 0; u < spriteInfors[m].Uv.Length; u++) 163 | { 164 | GUILayout.BeginHorizontal(); 165 | GUILayout.Label("UV" + u + ":", GUILayout.Width(50)); 166 | EditorGUILayout.Vector2Field("", spriteInfors[m].Uv[u]); 167 | GUILayout.EndHorizontal(); 168 | } 169 | 170 | GUILayout.EndVertical(); 171 | GUI.enabled = true; 172 | 173 | GUILayout.EndHorizontal(); 174 | } 175 | 176 | } 177 | GUILayout.EndVertical(); 178 | 179 | } 180 | GUILayout.EndScrollView(); 181 | } 182 | 183 | 184 | } 185 | } 186 | 187 | 188 | /// 189 | /// 更新信息 190 | /// 191 | public void UpdateSpriteGroup() 192 | { 193 | if (_spriteAsset && _spriteAsset.TexSource && _spriteAsset.Row > 1 && _spriteAsset.Column > 1) 194 | { 195 | int count = _spriteAsset.IsStatic ? _spriteAsset.Row * _spriteAsset.Column : _spriteAsset.Row; 196 | if (_spriteAsset.ListSpriteGroup.Count != count) 197 | { 198 | _spriteAsset.ListSpriteGroup.Clear(); 199 | //更新 200 | //---------------------------------- 201 | Vector2 texSize = new Vector2(_spriteAsset.TexSource.width, _spriteAsset.TexSource.height); 202 | Vector2 size = new Vector2((_spriteAsset.TexSource.width / (float)_spriteAsset.Column) 203 | , (_spriteAsset.TexSource.height / (float)_spriteAsset.Row)); 204 | 205 | if (_spriteAsset.IsStatic) 206 | { 207 | int index = -1; 208 | for (int i = 0; i < _spriteAsset.Row; i++) 209 | { 210 | for (int j = 0; j < _spriteAsset.Column; j++) 211 | { 212 | index++; 213 | SpriteInforGroup inforGroup = Pool.Get(); 214 | SpriteInfor infor = GetSpriteInfo(index, i, j, size, texSize); 215 | 216 | inforGroup.Tag = "emoji_" + infor.Id; 217 | inforGroup.ListSpriteInfor.Add(infor); 218 | _spriteAsset.ListSpriteGroup.Add(inforGroup); 219 | } 220 | } 221 | } 222 | else 223 | { 224 | int index = -1; 225 | for (int i = 0; i < _spriteAsset.Row; i++) 226 | { 227 | SpriteInforGroup inforGroup = Pool.Get(); 228 | inforGroup.Tag = "emoji_" + (index + 1); 229 | for (int j = 0; j < _spriteAsset.Column; j++) 230 | { 231 | index++; 232 | 233 | SpriteInfor infor = GetSpriteInfo(index, i, j, size, texSize); 234 | 235 | inforGroup.ListSpriteInfor.Add(infor); 236 | } 237 | _spriteAsset.ListSpriteGroup.Add(inforGroup); 238 | } 239 | } 240 | 241 | } 242 | } 243 | } 244 | 245 | 246 | #region 内部函数 247 | //获取精灵信息 248 | private SpriteInfor GetSpriteInfo(int index, int row, int column, Vector2 size, Vector2 texSize) 249 | { 250 | SpriteInfor infor = Pool.Get(); 251 | infor.Id = index; 252 | infor.Rect = new Rect(size.y * column, texSize.y - (row + 1) * size.x, size.x, size.y); 253 | infor.DrawTexCoord = new Rect(infor.Rect.x / texSize.x, infor.Rect.y / texSize.y 254 | , infor.Rect.width / texSize.x, infor.Rect.height / texSize.y); 255 | infor.Uv = GetSpriteUV(texSize, infor.Rect); 256 | return infor; 257 | } 258 | 259 | //获取uv信息 260 | private static Vector2[] GetSpriteUV(Vector2 texSize, Rect _sprRect) 261 | { 262 | Vector2[] uv = new Vector2[4]; 263 | uv[0] = new Vector2(_sprRect.x / texSize.x, (_sprRect.y + _sprRect.height) / texSize.y); 264 | uv[1] = new Vector2((_sprRect.x + _sprRect.width) / texSize.x, (_sprRect.y + _sprRect.height) / texSize.y); 265 | uv[2] = new Vector2((_sprRect.x + _sprRect.width) / texSize.x, _sprRect.y / texSize.y); 266 | uv[3] = new Vector2(_sprRect.x / texSize.x, _sprRect.y / texSize.y); 267 | return uv; 268 | } 269 | 270 | #endregion 271 | } 272 | 273 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/DrawSpriteAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d29947b228d4e84abcdf9bc2ced85a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/EmojiShaderGUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System; 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | public class EmojiShaderGUI : ShaderGUI 10 | { 11 | 12 | public override void OnGUI(UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] properties) 13 | { 14 | //base.OnGUI(materialEditor, properties); 15 | 16 | //Material targetMat = materialEditor.target as Material; 17 | 18 | //// see if redify is set, and show a checkbox 19 | //bool redify = Array.IndexOf(targetMat.shaderKeywords, "EMOJI_ANIMATION") != -1; 20 | //EditorGUI.BeginChangeCheck(); 21 | //redify = EditorGUILayout.Toggle("Emoji Animation", redify); 22 | //if (EditorGUI.EndChangeCheck()) 23 | //{ 24 | // // enable or disable the keyword based on checkbox 25 | // if (redify) 26 | // targetMat.EnableKeyword("EMOJI_ANIMATION"); 27 | // else 28 | // targetMat.DisableKeyword("EMOJI_ANIMATION"); 29 | //} 30 | } 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/EmojiShaderGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b53c6b83c5fe29468020e059e3b6c8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/InlineTextEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEditor.UI; 5 | using UnityEngine; 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | [CustomEditor(typeof(InlineText), true)] 10 | [CanEditMultipleObjects] 11 | public class TextEditor : GraphicEditor 12 | { 13 | #region 属性 14 | private InlineText _inlineText; 15 | private string _lastText; 16 | SerializedProperty _text; 17 | SerializedProperty m_Text; 18 | SerializedProperty m_FontData; 19 | GUIContent _inputGUIContent; 20 | GUIContent _outputGUIContent; 21 | #endregion 22 | protected override void OnEnable() 23 | { 24 | base.OnEnable(); 25 | _lastText = ""; 26 | _inputGUIContent = new GUIContent("Input Text"); 27 | _outputGUIContent = new GUIContent("Output Text"); 28 | 29 | _text = serializedObject.FindProperty("_text"); 30 | m_Text = serializedObject.FindProperty("m_Text"); 31 | m_FontData = serializedObject.FindProperty("m_FontData"); 32 | 33 | _inlineText = target as InlineText; 34 | } 35 | 36 | public override void OnInspectorGUI() 37 | { 38 | serializedObject.Update(); 39 | EditorGUILayout.PropertyField(_text, _inputGUIContent); 40 | EditorGUILayout.PropertyField(m_Text, _outputGUIContent); 41 | EditorGUILayout.PropertyField(m_FontData); 42 | AppearanceControlsGUI(); 43 | RaycastControlsGUI(); 44 | serializedObject.ApplyModifiedProperties(); 45 | //更新字符 46 | if (_inlineText != null && _lastText != _text.stringValue) 47 | { 48 | _inlineText.text = _text.stringValue; 49 | _lastText = _text.stringValue; 50 | } 51 | } 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/InlineTextEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4610e19b806ca1a42b981267727b7c7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d580ba776a9641d42aca4ff9b1310829 3 | folderAsset: yes 4 | timeCreated: 1593229767 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/Resources/emoji-alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Editor/Resources/emoji-alipay.png -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/Resources/emoji-alipay.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7946fbb00e634240a97d267c7aaf8d1 3 | timeCreated: 1593229900 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | externalObjects: {} 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 0 12 | sRGBTexture: 0 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapsPreserveCoverage: 0 17 | alphaTestReferenceValue: 0.5 18 | mipMapFadeDistanceStart: 1 19 | mipMapFadeDistanceEnd: 3 20 | bumpmap: 21 | convertToNormalMap: 0 22 | externalNormalMap: 0 23 | heightScale: 0.25 24 | normalMapFilter: 0 25 | isReadable: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -1 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spritePixelsToUnits: 100 50 | alphaUsage: 1 51 | alphaIsTransparency: 0 52 | spriteTessellationDetail: -1 53 | textureType: 0 54 | textureShape: 1 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - buildTarget: DefaultTexturePlatform 60 | maxTextureSize: 2048 61 | resizeAlgorithm: 0 62 | textureFormat: -1 63 | textureCompression: 1 64 | compressionQuality: 50 65 | crunchedCompression: 0 66 | allowsAlphaSplitting: 0 67 | overridden: 0 68 | - buildTarget: Standalone 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | physicsShape: [] 82 | spritePackingTag: 83 | userData: 84 | assetBundleName: 85 | assetBundleVariant: 86 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/Resources/emoji-wechatpay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Editor/Resources/emoji-wechatpay.jpg -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/Resources/emoji-wechatpay.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67ef1b3516067754595998b88ac55f55 3 | timeCreated: 1593229882 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | externalObjects: {} 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 0 12 | sRGBTexture: 0 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapsPreserveCoverage: 0 17 | alphaTestReferenceValue: 0.5 18 | mipMapFadeDistanceStart: 1 19 | mipMapFadeDistanceEnd: 3 20 | bumpmap: 21 | convertToNormalMap: 0 22 | externalNormalMap: 0 23 | heightScale: 0.25 24 | normalMapFilter: 0 25 | isReadable: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -1 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spritePixelsToUnits: 100 50 | alphaUsage: 1 51 | alphaIsTransparency: 0 52 | spriteTessellationDetail: -1 53 | textureType: 0 54 | textureShape: 1 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - buildTarget: DefaultTexturePlatform 60 | maxTextureSize: 2048 61 | resizeAlgorithm: 0 62 | textureFormat: -1 63 | textureCompression: 1 64 | compressionQuality: 50 65 | crunchedCompression: 0 66 | allowsAlphaSplitting: 0 67 | overridden: 0 68 | - buildTarget: Standalone 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | physicsShape: [] 82 | spritePackingTag: 83 | userData: 84 | assetBundleName: 85 | assetBundleVariant: 86 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/SpriteAssetEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections.Generic; 4 | 5 | namespace Wanderer.EmojiText 6 | { 7 | [CustomEditor(typeof(SpriteAsset))] 8 | public class SpriteAssetEditor : Editor 9 | { 10 | private SpriteAsset _spriteAsset; 11 | private DrawSpriteAsset _drawSpriteAsset; 12 | 13 | public void OnEnable() 14 | { 15 | _spriteAsset = (SpriteAsset)target; 16 | 17 | if (_spriteAsset) 18 | SetDrawSpriteAsset(_spriteAsset); 19 | } 20 | 21 | public void OnDisable() 22 | { 23 | } 24 | 25 | public override void OnInspectorGUI() 26 | { 27 | if (_spriteAsset == null) 28 | return; 29 | 30 | if (_drawSpriteAsset != null) 31 | { 32 | _drawSpriteAsset.Draw(); 33 | _drawSpriteAsset.UpdateSpriteGroup(); 34 | } 35 | 36 | EditorUtility.SetDirty(_spriteAsset); 37 | } 38 | 39 | //开启预览窗口 40 | public override bool HasPreviewGUI() 41 | { 42 | return true; 43 | } 44 | 45 | //标题 46 | public override GUIContent GetPreviewTitle() 47 | { 48 | return new GUIContent("Texture Preview"); 49 | } 50 | 51 | //预览上面的按钮 52 | public override void OnPreviewSettings() 53 | { 54 | // GUILayout.Label("文本", "preLabel"); 55 | if (GUILayout.Button("Open Asset Window", "preButton") && _spriteAsset != null) 56 | { 57 | CreateSpriteAsset.OpenAsset(_spriteAsset); 58 | } 59 | } 60 | 61 | //重新绘制预览界面 62 | public override void OnPreviewGUI(Rect r, GUIStyle background) 63 | { 64 | // base.OnPreviewGUI(r, background); 65 | 66 | if (_spriteAsset && _spriteAsset.TexSource) 67 | { 68 | Rect drawRect = r; 69 | float ratio = drawRect.height / (float)_spriteAsset.TexSource.height; 70 | float width = ratio * r.width; 71 | drawRect.x = r.width * 0.5f - width; 72 | GUI.Label(drawRect, _spriteAsset.TexSource); 73 | 74 | //绘制线 75 | // DrawTextureLines(drawRect); 76 | } 77 | } 78 | 79 | 80 | //绘制信息的类 81 | private void SetDrawSpriteAsset(SpriteAsset spriteAsset) 82 | { 83 | //添加 84 | if (_drawSpriteAsset == null) 85 | _drawSpriteAsset = new DrawSpriteAsset(spriteAsset); 86 | else 87 | _drawSpriteAsset.SetSpriteAsset(spriteAsset); 88 | } 89 | 90 | //这块窗口的属性 有点乱七八糟 91 | ////绘制纹理上的线 92 | //private void DrawTextureLines(Rect rect) 93 | //{ 94 | // if (_spriteAsset) 95 | // { 96 | // Vector2 endPos = rect.position + rect.size; 97 | // Handles.BeginGUI(); 98 | // //行 - line 99 | // if (_spriteAsset.Row > 0) 100 | // { 101 | // Handles.color = _spriteAsset.IsStatic ? Color.green : Color.red; 102 | // float interval = rect.height / _spriteAsset.Row; 103 | // for (int i = 0; i <= _spriteAsset.Row; i++) 104 | // { 105 | // float h = rect.position.y+(interval * i); 106 | // Handles.DrawLine(new Vector3(rect.position.x, h), new Vector3(endPos.x, h)); 107 | // } 108 | // } 109 | // //列 - line 110 | // if (_spriteAsset.Column > 0) 111 | // { 112 | // Handles.color = Color.green; 113 | // float interval = (rect.width* 2.0f) / _spriteAsset.Column; 114 | // for (int i = 0; i <= _spriteAsset.Column; i++) 115 | // { 116 | // float w = rect.position.x+(interval * i); 117 | // Handles.DrawLine(new Vector3(w, rect.position.y), new Vector3(w, endPos.y)); 118 | // } 119 | // } 120 | 121 | // Handles.EndGUI(); 122 | // } 123 | //} 124 | 125 | 126 | } 127 | 128 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/SpriteAssetEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc7f1905550dc78438aa0a840f485a21 3 | timeCreated: 1459352780 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/TextMenuExtender.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | using UnityEngine.UI; 5 | using UnityEngine.EventSystems; 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | public class TextMenuExtender 10 | { 11 | [MenuItem("GameObject/UI/TextInline", false, 10)] 12 | static void CreateCustomGameObject(MenuCommand menuCommand) 13 | { 14 | GameObject go = null; 15 | InlineManager inline = AssetDatabase.LoadAssetAtPath("Assets/TextInlineSprite/Prefabs/TextInline.prefab"); 16 | if (inline) 17 | { 18 | go = GameObject.Instantiate(inline).gameObject; 19 | } 20 | else 21 | { 22 | go = new GameObject(); 23 | go.AddComponent(); 24 | } 25 | go.name = "InlinText"; 26 | GameObject parent = menuCommand.context as GameObject; 27 | if (parent == null) 28 | { 29 | parent = new GameObject("Canvas"); 30 | parent.layer = LayerMask.NameToLayer("UI"); 31 | parent.AddComponent().renderMode = RenderMode.ScreenSpaceOverlay; 32 | parent.AddComponent(); 33 | parent.AddComponent(); 34 | 35 | EventSystem _es = GameObject.FindObjectOfType(); 36 | if (!_es) 37 | { 38 | _es = new GameObject("EventSystem").AddComponent(); 39 | _es.gameObject.AddComponent(); 40 | } 41 | } 42 | GameObjectUtility.SetParentAndAlign(go, parent); 43 | //注册返回事件 44 | Undo.RegisterCreatedObjectUndo(go, "Create " + go.name); 45 | Selection.activeObject = go; 46 | } 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Editor/TextMenuExtender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db2627de9212fee42b3cf1c0acd13c5e 3 | timeCreated: 1498537361 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 722ad0ec5e00f1940b829961fd905d30 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d16e188c78b3a14ca0874022607285a 3 | folderAsset: yes 4 | timeCreated: 1458923026 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scene/Chat.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b850286de1f21664a9ba0f36987842d8 3 | timeCreated: 1498549064 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scene/Text.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 0 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 1 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 0 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 0 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &89343592 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 0} 120 | serializedVersion: 5 121 | m_Component: 122 | - component: {fileID: 89343596} 123 | - component: {fileID: 89343595} 124 | - component: {fileID: 89343594} 125 | - component: {fileID: 89343593} 126 | m_Layer: 5 127 | m_Name: Canvas 128 | m_TagString: Untagged 129 | m_Icon: {fileID: 0} 130 | m_NavMeshLayer: 0 131 | m_StaticEditorFlags: 0 132 | m_IsActive: 1 133 | --- !u!114 &89343593 134 | MonoBehaviour: 135 | m_ObjectHideFlags: 0 136 | m_PrefabParentObject: {fileID: 0} 137 | m_PrefabInternal: {fileID: 0} 138 | m_GameObject: {fileID: 89343592} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} 142 | m_Name: 143 | m_EditorClassIdentifier: 144 | m_IgnoreReversedGraphics: 1 145 | m_BlockingObjects: 0 146 | m_BlockingMask: 147 | serializedVersion: 2 148 | m_Bits: 4294967295 149 | --- !u!114 &89343594 150 | MonoBehaviour: 151 | m_ObjectHideFlags: 0 152 | m_PrefabParentObject: {fileID: 0} 153 | m_PrefabInternal: {fileID: 0} 154 | m_GameObject: {fileID: 89343592} 155 | m_Enabled: 1 156 | m_EditorHideFlags: 0 157 | m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} 158 | m_Name: 159 | m_EditorClassIdentifier: 160 | m_UiScaleMode: 0 161 | m_ReferencePixelsPerUnit: 100 162 | m_ScaleFactor: 1 163 | m_ReferenceResolution: {x: 800, y: 600} 164 | m_ScreenMatchMode: 0 165 | m_MatchWidthOrHeight: 0 166 | m_PhysicalUnit: 3 167 | m_FallbackScreenDPI: 96 168 | m_DefaultSpriteDPI: 96 169 | m_DynamicPixelsPerUnit: 1 170 | --- !u!223 &89343595 171 | Canvas: 172 | m_ObjectHideFlags: 0 173 | m_PrefabParentObject: {fileID: 0} 174 | m_PrefabInternal: {fileID: 0} 175 | m_GameObject: {fileID: 89343592} 176 | m_Enabled: 1 177 | serializedVersion: 3 178 | m_RenderMode: 0 179 | m_Camera: {fileID: 1807511896} 180 | m_PlaneDistance: 100 181 | m_PixelPerfect: 0 182 | m_ReceivesEvents: 1 183 | m_OverrideSorting: 0 184 | m_OverridePixelPerfect: 0 185 | m_SortingBucketNormalizedSize: 0 186 | m_AdditionalShaderChannelsFlag: 25 187 | m_SortingLayerID: 0 188 | m_SortingOrder: 0 189 | m_TargetDisplay: 0 190 | --- !u!224 &89343596 191 | RectTransform: 192 | m_ObjectHideFlags: 0 193 | m_PrefabParentObject: {fileID: 0} 194 | m_PrefabInternal: {fileID: 0} 195 | m_GameObject: {fileID: 89343592} 196 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 197 | m_LocalPosition: {x: 515.5, y: 285.5, z: 0} 198 | m_LocalScale: {x: 1, y: 1, z: 1} 199 | m_Children: 200 | - {fileID: 303855777} 201 | m_Father: {fileID: 0} 202 | m_RootOrder: 0 203 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 204 | m_AnchorMin: {x: 0, y: 0} 205 | m_AnchorMax: {x: 0, y: 0} 206 | m_AnchoredPosition: {x: 0, y: 0} 207 | m_SizeDelta: {x: 0, y: 0} 208 | m_Pivot: {x: 0, y: 0} 209 | --- !u!224 &303855777 stripped 210 | RectTransform: 211 | m_PrefabParentObject: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 212 | type: 2} 213 | m_PrefabInternal: {fileID: 843054741} 214 | --- !u!1 &657429471 215 | GameObject: 216 | m_ObjectHideFlags: 0 217 | m_PrefabParentObject: {fileID: 0} 218 | m_PrefabInternal: {fileID: 0} 219 | serializedVersion: 5 220 | m_Component: 221 | - component: {fileID: 657429474} 222 | - component: {fileID: 657429473} 223 | - component: {fileID: 657429472} 224 | m_Layer: 0 225 | m_Name: EventSystem 226 | m_TagString: Untagged 227 | m_Icon: {fileID: 0} 228 | m_NavMeshLayer: 0 229 | m_StaticEditorFlags: 0 230 | m_IsActive: 1 231 | --- !u!114 &657429472 232 | MonoBehaviour: 233 | m_ObjectHideFlags: 0 234 | m_PrefabParentObject: {fileID: 0} 235 | m_PrefabInternal: {fileID: 0} 236 | m_GameObject: {fileID: 657429471} 237 | m_Enabled: 1 238 | m_EditorHideFlags: 0 239 | m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} 240 | m_Name: 241 | m_EditorClassIdentifier: 242 | m_HorizontalAxis: Horizontal 243 | m_VerticalAxis: Vertical 244 | m_SubmitButton: Submit 245 | m_CancelButton: Cancel 246 | m_InputActionsPerSecond: 10 247 | m_RepeatDelay: 0.5 248 | m_ForceModuleActive: 0 249 | --- !u!114 &657429473 250 | MonoBehaviour: 251 | m_ObjectHideFlags: 0 252 | m_PrefabParentObject: {fileID: 0} 253 | m_PrefabInternal: {fileID: 0} 254 | m_GameObject: {fileID: 657429471} 255 | m_Enabled: 1 256 | m_EditorHideFlags: 0 257 | m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} 258 | m_Name: 259 | m_EditorClassIdentifier: 260 | m_FirstSelected: {fileID: 0} 261 | m_sendNavigationEvents: 1 262 | m_DragThreshold: 5 263 | --- !u!4 &657429474 264 | Transform: 265 | m_ObjectHideFlags: 0 266 | m_PrefabParentObject: {fileID: 0} 267 | m_PrefabInternal: {fileID: 0} 268 | m_GameObject: {fileID: 657429471} 269 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 270 | m_LocalPosition: {x: 0, y: 0, z: 0} 271 | m_LocalScale: {x: 1, y: 1, z: 1} 272 | m_Children: [] 273 | m_Father: {fileID: 0} 274 | m_RootOrder: 3 275 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 276 | --- !u!1001 &843054741 277 | Prefab: 278 | m_ObjectHideFlags: 0 279 | serializedVersion: 2 280 | m_Modification: 281 | m_TransformParent: {fileID: 89343596} 282 | m_Modifications: 283 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 284 | type: 2} 285 | propertyPath: m_LocalPosition.x 286 | value: 0 287 | objectReference: {fileID: 0} 288 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 289 | type: 2} 290 | propertyPath: m_LocalPosition.y 291 | value: 0 292 | objectReference: {fileID: 0} 293 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 294 | type: 2} 295 | propertyPath: m_LocalPosition.z 296 | value: 0 297 | objectReference: {fileID: 0} 298 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 299 | type: 2} 300 | propertyPath: m_LocalRotation.x 301 | value: 0 302 | objectReference: {fileID: 0} 303 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 304 | type: 2} 305 | propertyPath: m_LocalRotation.y 306 | value: 0 307 | objectReference: {fileID: 0} 308 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 309 | type: 2} 310 | propertyPath: m_LocalRotation.z 311 | value: 0 312 | objectReference: {fileID: 0} 313 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 314 | type: 2} 315 | propertyPath: m_LocalRotation.w 316 | value: 1 317 | objectReference: {fileID: 0} 318 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 319 | type: 2} 320 | propertyPath: m_RootOrder 321 | value: 0 322 | objectReference: {fileID: 0} 323 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 324 | type: 2} 325 | propertyPath: m_AnchoredPosition.x 326 | value: 0 327 | objectReference: {fileID: 0} 328 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 329 | type: 2} 330 | propertyPath: m_AnchoredPosition.y 331 | value: 0 332 | objectReference: {fileID: 0} 333 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 334 | type: 2} 335 | propertyPath: m_SizeDelta.x 336 | value: 0 337 | objectReference: {fileID: 0} 338 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 339 | type: 2} 340 | propertyPath: m_SizeDelta.y 341 | value: 0 342 | objectReference: {fileID: 0} 343 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 344 | type: 2} 345 | propertyPath: m_AnchorMin.x 346 | value: 0 347 | objectReference: {fileID: 0} 348 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 349 | type: 2} 350 | propertyPath: m_AnchorMin.y 351 | value: 0 352 | objectReference: {fileID: 0} 353 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 354 | type: 2} 355 | propertyPath: m_AnchorMax.x 356 | value: 1 357 | objectReference: {fileID: 0} 358 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 359 | type: 2} 360 | propertyPath: m_AnchorMax.y 361 | value: 1 362 | objectReference: {fileID: 0} 363 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 364 | type: 2} 365 | propertyPath: m_Pivot.x 366 | value: 0.5 367 | objectReference: {fileID: 0} 368 | - target: {fileID: 224859831205574702, guid: 60411c537497e614b96c56ec7a2449c7, 369 | type: 2} 370 | propertyPath: m_Pivot.y 371 | value: 0.5 372 | objectReference: {fileID: 0} 373 | - target: {fileID: 114062063772527464, guid: 60411c537497e614b96c56ec7a2449c7, 374 | type: 2} 375 | propertyPath: m_Text 376 | value: 385 | objectReference: {fileID: 0} 386 | - target: {fileID: 114818828643141040, guid: 60411c537497e614b96c56ec7a2449c7, 387 | type: 2} 388 | propertyPath: m_Text 389 | value: "\u8D85\u94FE\u63A5\nNewTextNewText\n[\u8D85\u94FE\u63A5(100)] 391 | \ [\u8D85\u94FE\u63A5(1)]\nNewTextNewText" 393 | objectReference: {fileID: 0} 394 | - target: {fileID: 114179957108913134, guid: 60411c537497e614b96c56ec7a2449c7, 395 | type: 2} 396 | propertyPath: m_Text 397 | value: "\u591A\u56FE\u96C6\u8868\u60C5\nNewTextNewText\nNewTextNew00Text" 400 | objectReference: {fileID: 0} 401 | - target: {fileID: 114688564632623218, guid: 60411c537497e614b96c56ec7a2449c7, 402 | type: 2} 403 | propertyPath: m_Text 404 | value: "\u52A8\u6001\u8868\u60C5\nNewText\nNewText\nNewText\nNewText\nNewText" 407 | objectReference: {fileID: 0} 408 | - target: {fileID: 114257937443932456, guid: 60411c537497e614b96c56ec7a2449c7, 409 | type: 2} 410 | propertyPath: m_Text 411 | value: "\u9759\u6001\u8868\u60C5\nNewText\nNewText\nNewText\nNewText\nNewText" 414 | objectReference: {fileID: 0} 415 | - target: {fileID: 224254945192554434, guid: 60411c537497e614b96c56ec7a2449c7, 416 | type: 2} 417 | propertyPath: m_AnchoredPosition.y 418 | value: 162.7 419 | objectReference: {fileID: 0} 420 | - target: {fileID: 224254945192554434, guid: 60411c537497e614b96c56ec7a2449c7, 421 | type: 2} 422 | propertyPath: m_SizeDelta.y 423 | value: 103.64 424 | objectReference: {fileID: 0} 425 | - target: {fileID: 224254945192554434, guid: 60411c537497e614b96c56ec7a2449c7, 426 | type: 2} 427 | propertyPath: m_LocalPosition.y 428 | value: 164.1 429 | objectReference: {fileID: 0} 430 | m_RemovedComponents: [] 431 | m_ParentPrefab: {fileID: 100100000, guid: 60411c537497e614b96c56ec7a2449c7, type: 2} 432 | m_IsPrefabParent: 0 433 | --- !u!1 &1302729960 434 | GameObject: 435 | m_ObjectHideFlags: 0 436 | m_PrefabParentObject: {fileID: 0} 437 | m_PrefabInternal: {fileID: 0} 438 | serializedVersion: 5 439 | m_Component: 440 | - component: {fileID: 1302729962} 441 | - component: {fileID: 1302729961} 442 | m_Layer: 0 443 | m_Name: Directional Light 444 | m_TagString: Untagged 445 | m_Icon: {fileID: 0} 446 | m_NavMeshLayer: 0 447 | m_StaticEditorFlags: 0 448 | m_IsActive: 1 449 | --- !u!108 &1302729961 450 | Light: 451 | m_ObjectHideFlags: 0 452 | m_PrefabParentObject: {fileID: 0} 453 | m_PrefabInternal: {fileID: 0} 454 | m_GameObject: {fileID: 1302729960} 455 | m_Enabled: 1 456 | serializedVersion: 8 457 | m_Type: 1 458 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 459 | m_Intensity: 1 460 | m_Range: 10 461 | m_SpotAngle: 30 462 | m_CookieSize: 10 463 | m_Shadows: 464 | m_Type: 2 465 | m_Resolution: -1 466 | m_CustomResolution: -1 467 | m_Strength: 1 468 | m_Bias: 0.05 469 | m_NormalBias: 0.4 470 | m_NearPlane: 0.2 471 | m_Cookie: {fileID: 0} 472 | m_DrawHalo: 0 473 | m_Flare: {fileID: 0} 474 | m_RenderMode: 0 475 | m_CullingMask: 476 | serializedVersion: 2 477 | m_Bits: 4294967295 478 | m_Lightmapping: 4 479 | m_AreaSize: {x: 1, y: 1} 480 | m_BounceIntensity: 1 481 | m_ColorTemperature: 6570 482 | m_UseColorTemperature: 0 483 | m_ShadowRadius: 0 484 | m_ShadowAngle: 0 485 | --- !u!4 &1302729962 486 | Transform: 487 | m_ObjectHideFlags: 0 488 | m_PrefabParentObject: {fileID: 0} 489 | m_PrefabInternal: {fileID: 0} 490 | m_GameObject: {fileID: 1302729960} 491 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 492 | m_LocalPosition: {x: 0, y: 3, z: 0} 493 | m_LocalScale: {x: 1, y: 1, z: 1} 494 | m_Children: [] 495 | m_Father: {fileID: 0} 496 | m_RootOrder: 2 497 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 498 | --- !u!1 &1807511892 499 | GameObject: 500 | m_ObjectHideFlags: 0 501 | m_PrefabParentObject: {fileID: 0} 502 | m_PrefabInternal: {fileID: 0} 503 | serializedVersion: 5 504 | m_Component: 505 | - component: {fileID: 1807511897} 506 | - component: {fileID: 1807511896} 507 | - component: {fileID: 1807511895} 508 | - component: {fileID: 1807511894} 509 | - component: {fileID: 1807511893} 510 | m_Layer: 0 511 | m_Name: Main Camera 512 | m_TagString: MainCamera 513 | m_Icon: {fileID: 0} 514 | m_NavMeshLayer: 0 515 | m_StaticEditorFlags: 0 516 | m_IsActive: 1 517 | --- !u!81 &1807511893 518 | AudioListener: 519 | m_ObjectHideFlags: 0 520 | m_PrefabParentObject: {fileID: 0} 521 | m_PrefabInternal: {fileID: 0} 522 | m_GameObject: {fileID: 1807511892} 523 | m_Enabled: 1 524 | --- !u!124 &1807511894 525 | Behaviour: 526 | m_ObjectHideFlags: 0 527 | m_PrefabParentObject: {fileID: 0} 528 | m_PrefabInternal: {fileID: 0} 529 | m_GameObject: {fileID: 1807511892} 530 | m_Enabled: 1 531 | --- !u!92 &1807511895 532 | Behaviour: 533 | m_ObjectHideFlags: 0 534 | m_PrefabParentObject: {fileID: 0} 535 | m_PrefabInternal: {fileID: 0} 536 | m_GameObject: {fileID: 1807511892} 537 | m_Enabled: 1 538 | --- !u!20 &1807511896 539 | Camera: 540 | m_ObjectHideFlags: 0 541 | m_PrefabParentObject: {fileID: 0} 542 | m_PrefabInternal: {fileID: 0} 543 | m_GameObject: {fileID: 1807511892} 544 | m_Enabled: 1 545 | serializedVersion: 2 546 | m_ClearFlags: 2 547 | m_BackGroundColor: {r: 0.19010323, g: 0.3173709, b: 0.4528302, a: 0} 548 | m_NormalizedViewPortRect: 549 | serializedVersion: 2 550 | x: 0 551 | y: 0 552 | width: 1 553 | height: 1 554 | near clip plane: 0.3 555 | far clip plane: 1000 556 | field of view: 60 557 | orthographic: 0 558 | orthographic size: 5 559 | m_Depth: -1 560 | m_CullingMask: 561 | serializedVersion: 2 562 | m_Bits: 4294967295 563 | m_RenderingPath: -1 564 | m_TargetTexture: {fileID: 0} 565 | m_TargetDisplay: 0 566 | m_TargetEye: 3 567 | m_HDR: 0 568 | m_AllowMSAA: 1 569 | m_ForceIntoRT: 0 570 | m_OcclusionCulling: 1 571 | m_StereoConvergence: 10 572 | m_StereoSeparation: 0.022 573 | --- !u!4 &1807511897 574 | Transform: 575 | m_ObjectHideFlags: 0 576 | m_PrefabParentObject: {fileID: 0} 577 | m_PrefabInternal: {fileID: 0} 578 | m_GameObject: {fileID: 1807511892} 579 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 580 | m_LocalPosition: {x: 0, y: 1, z: -10} 581 | m_LocalScale: {x: 1, y: 1, z: 1} 582 | m_Children: [] 583 | m_Father: {fileID: 0} 584 | m_RootOrder: 1 585 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 586 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scene/Text.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d885e5d93a8bbc549a1d1d2949c619c2 3 | timeCreated: 1498384291 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0fdf1d3c1a1bb74b9226920529ede0e 3 | folderAsset: yes 4 | timeCreated: 1498490740 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ChatItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Wanderer.EmojiText 6 | { 7 | public class ChatItem : MonoBehaviour 8 | { 9 | 10 | [SerializeField] 11 | private InlineText _inlineText; 12 | [SerializeField] 13 | private RectTransform _itemRect; 14 | [SerializeField] 15 | private RectTransform _itemBgRect; 16 | 17 | public string Text 18 | { 19 | get { return _inlineText.text; } 20 | set 21 | { 22 | 23 | _inlineText.text = value; 24 | 25 | //加5.0f的偏移值 是为了更加美观-- 具体范围可以看scene视图的蓝色线框 26 | Vector2 size = new Vector2(_inlineText.preferredWidth + 5.0f, _inlineText.preferredHeight + 5.0f); 27 | 28 | _itemRect.sizeDelta = size; 29 | _itemBgRect.sizeDelta = size; 30 | } 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ChatItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9c73aa281847f349a5eef84dcd46559 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ChatTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace Wanderer.EmojiText 7 | { 8 | public class ChatTest : MonoBehaviour 9 | { 10 | [SerializeField] 11 | private TextAsset _txtData; 12 | 13 | [SerializeField] 14 | private GameObject _itemLeft; 15 | [SerializeField] 16 | private GameObject _itemRight; 17 | 18 | //滚动文本 19 | [SerializeField] 20 | private ScrollRect _scrollView; 21 | 22 | [SerializeField] 23 | private RectTransform _spriteRect; 24 | 25 | [SerializeField] 26 | private RectTransform _chatParent; 27 | 28 | [SerializeField] 29 | private InputField _inputText; 30 | 31 | private List _allChatDatas = new List(); 32 | 33 | private Stack _chatLeftPool = new Stack(); 34 | private Stack _chatRightPool = new Stack(); 35 | 36 | //int _index = 0; 37 | //int _chatItemActiveCount = 12; 38 | //private List _activeChatItem = new List(); 39 | 40 | private IEnumerator Start() 41 | { 42 | _scrollView.onValueChanged.AddListener(OnSrcollViewChanged); 43 | 44 | yield return new WaitForEndOfFrame(); 45 | 46 | string[] datas = _txtData.text.Split('\n'); 47 | for (int i = 0; i < datas.Length; i++) 48 | { 49 | string data = datas[i].Insert(Random.Range(0, datas[i].Length), "[#emoji_" + Random.Range(0, 20) + "]"); 50 | _allChatDatas.Add(data); 51 | 52 | //创建聊天 -- 测试 以序列号为偶数 为左边 53 | CreateItem(data, i % 2 == 0); 54 | } 55 | } 56 | 57 | private void CreateItem(string data, bool isLeft) 58 | { 59 | //if (_activeChatItem.Count >= _chatItemActiveCount) 60 | // return; 61 | 62 | ChatItem item = GetChatItem(isLeft).GetComponent(); 63 | item.Text = data; 64 | //_activeChatItem.Add(item); 65 | 66 | //_scrollView.enabled = false; 67 | //_scrollView.verticalNormalizedPosition = 0.0f; 68 | //_scrollView.enabled = true; 69 | } 70 | 71 | 72 | private void OnSrcollViewChanged(Vector2 pos) 73 | { 74 | _spriteRect.anchoredPosition = _scrollView.content.anchoredPosition; 75 | 76 | //无限滚动测试 因为会导致Text的文本变幻位置相当于重新绘制 -- 暂时取消这个功能 77 | //if (_allChatDatas == null || _allChatDatas.Count == 0 78 | // || _activeChatItem == null || _activeChatItem.Count == 0 79 | // || _activeChatItem.Count <= _index || _activeChatItem.Count < _chatItemActiveCount) 80 | // return; 81 | 82 | //if (Mathf.Approximately(pos.y, 1.0f)) 83 | //{ 84 | // if (_index > 0) 85 | // { 86 | // _index--; 87 | // for (int i = _index; i < _index+_chatItemActiveCount; i++) 88 | // { 89 | // _activeChatItem[i - _index].Text = _allChatDatas[i]; 90 | // } 91 | // } 92 | //} 93 | //else if (pos.y < 0.02f) 94 | //{ 95 | // if (_index + _chatItemActiveCount < _allChatDatas.Count) 96 | // { 97 | // _index++; 98 | // for (int i = _index; i < _index + _chatItemActiveCount; i++) 99 | // { 100 | // _activeChatItem[i - _index].Text = _allChatDatas[i]; 101 | // } 102 | // } 103 | //} 104 | } 105 | 106 | 107 | #region 点击发送 108 | public void OnClickSend() 109 | { 110 | string chatStr = _inputText.text; 111 | if (string.IsNullOrEmpty(chatStr)) 112 | return; 113 | //动态创建文本 114 | CreateItem(chatStr, _allChatDatas.Count % 2 == 0); 115 | _allChatDatas.Add(chatStr); 116 | 117 | } 118 | #endregion 119 | 120 | #region 简易对象池 121 | private GameObject GetChatItem(bool isLeft) 122 | { 123 | GameObject item = null; 124 | if (isLeft) 125 | { 126 | if (_chatLeftPool.Count > 0) 127 | item = _chatLeftPool.Pop(); 128 | } 129 | else 130 | { 131 | if (_chatRightPool.Count > 0) 132 | item = _chatRightPool.Pop(); 133 | } 134 | if (item == null) 135 | { 136 | item = isLeft ? Instantiate(_itemLeft) : Instantiate(_itemRight); 137 | item.transform.SetParent(_chatParent); 138 | } 139 | item.SetActive(true); 140 | return item; 141 | } 142 | 143 | private void ReleaseChatItem(GameObject obj, bool isLeft) 144 | { 145 | Stack pool = isLeft ? _chatLeftPool : _chatRightPool; 146 | obj.SetActive(false); 147 | pool.Push(obj); 148 | } 149 | #endregion 150 | 151 | } 152 | 153 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ChatTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c97c5ff8640e1364298a35b847361088 3 | timeCreated: 1498552991 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ClickTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Wanderer.EmojiText 6 | { 7 | public class ClickTest : MonoBehaviour 8 | { 9 | 10 | private InlineText _text; 11 | 12 | void Awake() 13 | { 14 | _text = GetComponent(); 15 | } 16 | 17 | void OnEnable() 18 | { 19 | _text.OnHrefClick.AddListener(OnHrefClick); 20 | } 21 | 22 | void OnDisable() 23 | { 24 | _text.OnHrefClick.RemoveListener(OnHrefClick); 25 | } 26 | 27 | private void OnHrefClick(string hrefName, int id) 28 | { 29 | Debug.Log("点击了 " + hrefName + " id:" + id); 30 | // Application.OpenURL("www.baidu.com"); 31 | } 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/Scripts/ClickTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a43be44be4e113479cbf3f4c3faeec9 3 | timeCreated: 1498490768 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/data.txt: -------------------------------------------------------------------------------- 1 | 以下"鸡汤"来源于网络,请不要对号入座! 2 | 万事开头难,然后中间难,最后结尾难。 3 | 假如生活欺骗了你,不要悲伤,不要心急,反正明天也一样。 4 | 等忙完这一阵,就可以接着忙下一阵了。 5 | 有时候你不努力一下,你都不知道什么叫绝望。 6 | 当你觉得自己又丑又穷的时候,不要悲伤,至少你的判断还是对的。 7 | 生活不止眼前的苟且,还有读不懂的诗和到不了的远方。 8 | 世上无难事,只要肯放弃。 9 | 坚持不一定成功,但放弃肯定很舒服。 10 | 选择比努力更重要,所以我选择不努力。 11 | 不要随便安慰抑郁患者,别人难过时,你说做人最重要的是开心,这就相当于对穷人说:做人最重要的是有钱。 你说你欠不欠揍? 12 | 说胜败乃兵家常事的人,通常是败了。 13 | 真正努力过的人,就会明白天赋的重要。 14 | 有时候你不逼自己一把,你就不知道你还有把事情搞砸的本事。 -------------------------------------------------------------------------------- /Assets/EmojiText/Examples/data.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22de3691c0ad66445b7867af28ac88a6 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/EmojiText/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fc2ec10ec9168241bcea4c677f9f895 3 | folderAsset: yes 4 | timeCreated: 1498541669 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/EmojiText/Prefabs/TextInline.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60411c537497e614b96c56ec7a2449c7 3 | timeCreated: 1559194842 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/EmojiText/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c287c9e647145664eb733d3a35c2d122 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Resources/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbd62c7dc7d45c145bf6f8912aa499f0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Resources/Shader/UI-Emoji.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "Hidden/UI/Emoji" 4 | { 5 | Properties 6 | { 7 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 8 | _Color ("Tint", Color) = (1,1,1,1) 9 | 10 | _CellAmount("Cell Amount",Float)=1 11 | _Speed("Speed",Float)=0 12 | 13 | _StencilComp ("Stencil Comparison", Float) = 8 14 | _Stencil ("Stencil ID", Float) = 0 15 | _StencilOp ("Stencil Operation", Float) = 0 16 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 17 | _StencilReadMask ("Stencil Read Mask", Float) = 255 18 | 19 | _ColorMask ("Color Mask", Float) = 15 20 | 21 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 22 | [Toggle(EMOJI_ANIMATION)] _EMOJIANIMATION("Enable Emoji Animation", Int) = 1 23 | } 24 | 25 | SubShader 26 | { 27 | Tags 28 | { 29 | "Queue"="Transparent" 30 | "IgnoreProjector"="True" 31 | "RenderType"="Transparent" 32 | "PreviewType"="Plane" 33 | "CanUseSpriteAtlas"="True" 34 | } 35 | 36 | Stencil 37 | { 38 | Ref [_Stencil] 39 | Comp [_StencilComp] 40 | Pass [_StencilOp] 41 | ReadMask [_StencilReadMask] 42 | WriteMask [_StencilWriteMask] 43 | } 44 | 45 | Cull Off 46 | Lighting Off 47 | ZWrite Off 48 | ZTest [unity_GUIZTestMode] 49 | Blend SrcAlpha OneMinusSrcAlpha 50 | ColorMask [_ColorMask] 51 | 52 | Pass 53 | { 54 | Name "Default" 55 | CGPROGRAM 56 | // Upgrade NOTE: excluded shader from DX11, OpenGL ES 2.0 because it uses unsized arrays 57 | 58 | #pragma vertex vert 59 | #pragma fragment frag 60 | #pragma target 2.0 61 | 62 | #include "UnityCG.cginc" 63 | #include "UnityUI.cginc" 64 | 65 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 66 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 67 | #pragma shader_feature EMOJI_ANIMATION 68 | 69 | struct appdata_t 70 | { 71 | float4 vertex : POSITION; 72 | float4 color : COLOR; 73 | float2 texcoord : TEXCOORD0; 74 | 75 | UNITY_VERTEX_INPUT_INSTANCE_ID 76 | }; 77 | 78 | struct v2f 79 | { 80 | float4 vertex : SV_POSITION; 81 | fixed4 color : COLOR; 82 | float2 texcoord : TEXCOORD0; 83 | float4 worldPosition : TEXCOORD1; 84 | UNITY_VERTEX_OUTPUT_STEREO 85 | }; 86 | 87 | sampler2D _MainTex; 88 | fixed4 _Color; 89 | fixed4 _TextureSampleAdd; 90 | float4 _ClipRect; 91 | float4 _MainTex_ST; 92 | #if EMOJI_ANIMATION 93 | float _CellAmount; 94 | float _Speed; 95 | #endif 96 | v2f vert(appdata_t v) 97 | { 98 | v2f OUT; 99 | UNITY_SETUP_INSTANCE_ID(v); 100 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 101 | OUT.worldPosition = v.vertex; 102 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 103 | #if !EMOJI_ANIMATION 104 | OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 105 | #else 106 | float2 uv = TRANSFORM_TEX(v.texcoord, _MainTex); 107 | float cell = 1.0f / _CellAmount; 108 | float timeValue = fmod(_Time.y*_Speed, _CellAmount); 109 | timeValue = floor(timeValue); 110 | uv.x += cell * timeValue; 111 | OUT.texcoord = uv; 112 | #endif 113 | OUT.color = v.color * _Color; 114 | return OUT; 115 | } 116 | 117 | fixed4 frag(v2f IN) : SV_Target 118 | { 119 | half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 120 | 121 | #ifdef UNITY_UI_CLIP_RECT 122 | // color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); 123 | #endif 124 | 125 | #ifdef UNITY_UI_ALPHACLIP 126 | clip (color.a - 0.001); 127 | #endif 128 | 129 | return color; 130 | } 131 | ENDCG 132 | } 133 | } 134 | CustomEditor "EmojiText.Taurus.EmojiShaderGUI" 135 | } 136 | -------------------------------------------------------------------------------- /Assets/EmojiText/Resources/Shader/UI-Emoji.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de6269c55dd4f7e40b67e6011f7af4c9 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa37dd5ea8bea1e47ab0cece487e4b65 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/InlineManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Wanderer.EmojiText 6 | { 7 | [ExecuteInEditMode] 8 | public class InlineManager : MonoBehaviour 9 | { 10 | 11 | #region 属性 12 | //所有的精灵消息 13 | public readonly Dictionary> IndexSpriteInfo = new Dictionary>(); 14 | 15 | //图集 16 | [SerializeField] 17 | private List _spriteGraphics = new List(); 18 | 19 | //绘制的模型数据信息 20 | private readonly Dictionary> _graphicMeshInfo = new Dictionary>(); 21 | 22 | //渲染列表 23 | List _renderIndexs = new List(); 24 | #endregion 25 | 26 | // Use this for initialization 27 | void OnEnable() 28 | { 29 | Initialize(); 30 | } 31 | 32 | #region 初始化 33 | void Initialize() 34 | { 35 | for (int i = 0; i < _spriteGraphics.Count; i++) 36 | { 37 | SpriteAsset mSpriteAsset = _spriteGraphics[i].m_spriteAsset; 38 | if (!IndexSpriteInfo.ContainsKey(mSpriteAsset.Id)) 39 | { 40 | Dictionary spriteGroup = new Dictionary(); 41 | foreach (var item in mSpriteAsset.ListSpriteGroup) 42 | { 43 | if (!spriteGroup.ContainsKey(item.Tag) && item.ListSpriteInfor != null && item.ListSpriteInfor.Count > 0) 44 | spriteGroup.Add(item.Tag, item); 45 | } 46 | IndexSpriteInfo.Add(mSpriteAsset.Id, spriteGroup); 47 | } 48 | } 49 | } 50 | #endregion 51 | 52 | private void Update() 53 | { 54 | if (_renderIndexs != null && _renderIndexs.Count > 0) 55 | { 56 | for (int i = 0; i < _renderIndexs.Count; i++) 57 | { 58 | int id = _renderIndexs[i]; 59 | SpriteGraphic spriteGraphic = _spriteGraphics.Find(x => x.m_spriteAsset != null && x.m_spriteAsset.Id == id); 60 | if (spriteGraphic != null) 61 | { 62 | if (!_graphicMeshInfo.ContainsKey(id)) 63 | { 64 | spriteGraphic.MeshInfo = null; 65 | continue; 66 | } 67 | 68 | Dictionary textMeshInfo = _graphicMeshInfo[id]; 69 | if (textMeshInfo == null || textMeshInfo.Count == 0) 70 | spriteGraphic.MeshInfo = null; 71 | else 72 | { 73 | MeshInfo meshInfo = Pool.Get(); 74 | meshInfo.Reset(); 75 | foreach (var item in textMeshInfo) 76 | { 77 | if (item.Value.visable) 78 | { 79 | meshInfo.Vertices.AddRange(item.Value.Vertices); 80 | meshInfo.UVs.AddRange(item.Value.UVs); 81 | } 82 | } 83 | if (spriteGraphic.MeshInfo != null) 84 | Pool.Release(spriteGraphic.MeshInfo); 85 | 86 | spriteGraphic.MeshInfo = meshInfo; 87 | } 88 | } 89 | } 90 | //清掉渲染索引 91 | _renderIndexs.Clear(); 92 | } 93 | } 94 | 95 | //更新Text文本信息 96 | public void UpdateTextInfo(InlineText key, int id, List value, bool visable) 97 | { 98 | Dictionary textMeshInfo; 99 | if (value == null) 100 | { 101 | if (_graphicMeshInfo.TryGetValue(id, out textMeshInfo) && textMeshInfo.ContainsKey(key)) 102 | { 103 | textMeshInfo[key].Release(); 104 | textMeshInfo.Remove(key); 105 | } 106 | } 107 | else 108 | { 109 | SpriteGraphic spriteGraphic = _spriteGraphics.Find(x => x.m_spriteAsset != null && x.m_spriteAsset.Id == id); 110 | if (spriteGraphic != null) 111 | { 112 | if (!_graphicMeshInfo.TryGetValue(id, out textMeshInfo)) 113 | { 114 | textMeshInfo = new Dictionary(); 115 | _graphicMeshInfo.Add(id, textMeshInfo); 116 | } 117 | 118 | MeshInfo meshInfo; 119 | if (!textMeshInfo.TryGetValue(key, out meshInfo)) 120 | { 121 | meshInfo = Pool.Get(); 122 | textMeshInfo.Add(key, meshInfo); 123 | } 124 | meshInfo.Reset(); 125 | meshInfo.visable = visable; 126 | for (int i = 0; i < value.Count; i++) 127 | { 128 | for (int j = 0; j < value[i].Pos.Length; j++) 129 | { 130 | //世界转本地坐标->避免位置变换的错位 131 | meshInfo.Vertices.Add(Utility.TransformWorld2Point(spriteGraphic.transform, value[i].Pos[j])); 132 | } 133 | meshInfo.UVs.AddRange(value[i].UVs); 134 | } 135 | } 136 | } 137 | 138 | //添加到渲染列表里面 -- 等待下一帧渲染 139 | if (!_renderIndexs.Contains(id)) 140 | { 141 | _renderIndexs.Add(id); 142 | } 143 | } 144 | 145 | 146 | } 147 | 148 | #region 模型数据信息 149 | public class MeshInfo 150 | { 151 | public List Vertices = null; 152 | public List UVs = null; 153 | public List Colors = null; 154 | public List Triangles = null; 155 | public bool visable = true; 156 | public bool listsInitalized = false; 157 | 158 | public void Reset() 159 | { 160 | if (!listsInitalized) 161 | { 162 | Vertices = ListPool.Get(); 163 | UVs = ListPool.Get(); 164 | Colors = ListPool.Get(); 165 | Triangles = ListPool.Get(); 166 | 167 | listsInitalized = true; 168 | } 169 | 170 | if (Vertices != null) 171 | Vertices.Clear(); 172 | if (UVs != null) 173 | UVs.Clear(); 174 | if (Colors != null) 175 | Colors.Clear(); 176 | if (Triangles != null) 177 | Triangles.Clear(); 178 | } 179 | 180 | public void Release() 181 | { 182 | if (listsInitalized) 183 | { 184 | ListPool.Release(Vertices); 185 | ListPool.Release(UVs); 186 | ListPool.Release(Colors); 187 | ListPool.Release(Triangles); 188 | Pool.Release(this); 189 | 190 | Vertices = null; 191 | UVs = null; 192 | Colors = null; 193 | Triangles = null; 194 | 195 | listsInitalized = false; 196 | } 197 | } 198 | } 199 | #endregion 200 | } 201 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/InlineManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ae7019e071d5fe4e9d442887a3ac0de 3 | timeCreated: 1498308655 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/InlineText.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using System.Text.RegularExpressions; 6 | using System.Text; 7 | using UnityEngine.EventSystems; 8 | using UnityEngine.Events; 9 | using System; 10 | namespace Wanderer.EmojiText 11 | { 12 | [ExecuteInEditMode] 13 | public class InlineText : Text, IPointerClickHandler 14 | { 15 | #region 属性 16 | // 用正则取 [图集ID#表情Tag] ID值==-1 ,表示为超链接 17 | private static readonly Regex _inputTagRegex = new Regex(@"\[(\-{0,1}\d{0,})#(.+?)\]", RegexOptions.Singleline); 18 | //文本表情管理器 19 | private InlineManager _inlineManager; 20 | 21 | //表情位置索引信息 22 | private List _spriteInfo = new List(); 23 | //计算定点信息的缓存数组 24 | private readonly UIVertex[] m_TempVerts = new UIVertex[4]; 25 | 26 | private StringBuilder _textBuilder = new StringBuilder(); 27 | 28 | UIVertex _tempVertex = UIVertex.simpleVert; 29 | private List _lastRenderIndexs = new List(); 30 | #region 超链接 31 | [System.Serializable] 32 | public class HrefClickEvent : UnityEvent { } 33 | //点击事件监听 34 | public HrefClickEvent OnHrefClick = new HrefClickEvent(); 35 | // 超链接信息列表 36 | private readonly List _listHrefInfos = new List(); 37 | #endregion 38 | 39 | #endregion 40 | 41 | #region 重写函数 42 | [TextArea(3, 10)] 43 | [SerializeField] 44 | protected string _text = string.Empty; 45 | 46 | public override string text 47 | { 48 | get 49 | { 50 | return m_Text; 51 | } 52 | set 53 | { 54 | if (String.IsNullOrEmpty(value)) 55 | { 56 | if (String.IsNullOrEmpty(m_Text)) 57 | return; 58 | //m_Text = ""; 59 | m_Text = GetOutputText(value); 60 | SetVerticesDirty(); 61 | } 62 | else if (_text != value) 63 | { 64 | m_Text = GetOutputText(value); 65 | //m_Text = value; 66 | SetVerticesDirty(); 67 | SetLayoutDirty(); 68 | } 69 | #if UNITY_EDITOR 70 | //编辑器赋值 如果是一样的 也可以刷新一下 71 | else 72 | { 73 | m_Text = GetOutputText(value); 74 | SetVerticesDirty(); 75 | SetLayoutDirty(); 76 | } 77 | #endif 78 | //输入字符备份 79 | _text = value; 80 | } 81 | } 82 | 83 | protected override void OnEnable() 84 | { 85 | base.OnEnable(); 86 | supportRichText = true; 87 | alignByGeometry = true; 88 | if (_inlineManager == null) 89 | _inlineManager = GetComponentInParent(); 90 | UpdateDrawSprite(true); 91 | } 92 | 93 | protected override void OnDisable() 94 | { 95 | base.OnDisable(); 96 | UpdateDrawSprite(false); 97 | } 98 | 99 | protected override void Start() 100 | { 101 | base.Start(); 102 | 103 | if (_inlineManager == null) 104 | _inlineManager = GetComponentInParent(); 105 | m_Text = GetOutputText(_text); 106 | SetVerticesDirty(); 107 | SetLayoutDirty(); 108 | } 109 | 110 | protected override void OnPopulateMesh(VertexHelper toFill) 111 | { 112 | if (font == null) 113 | return; 114 | base.OnPopulateMesh(toFill); 115 | 116 | m_DisableFontTextureRebuiltCallback = true; 117 | //更新顶点位置&去掉乱码uv 118 | DealSpriteTagInfo(toFill); 119 | //处理超链接的信息 120 | DealHrefInfo(toFill); 121 | m_DisableFontTextureRebuiltCallback = false; 122 | 123 | //更新表情绘制 124 | UpdateDrawSprite(true); 125 | } 126 | 127 | // 重写文本所占的长宽 128 | //文本的宽度计算好像有bug,超过sizeDelta就取sizeDelta 129 | public override float preferredWidth 130 | { 131 | get 132 | { 133 | var settings = GetGenerationSettings(Vector2.zero); 134 | float width = cachedTextGeneratorForLayout.GetPreferredWidth(m_Text, settings) / pixelsPerUnit; 135 | return width < rectTransform.sizeDelta.x || horizontalOverflow == HorizontalWrapMode.Overflow ? width : rectTransform.sizeDelta.x; 136 | } 137 | } 138 | public override float preferredHeight 139 | { 140 | get 141 | { 142 | var settings = GetGenerationSettings(new Vector2(rectTransform.rect.size.x, 0.0f)); 143 | float height = cachedTextGeneratorForLayout.GetPreferredHeight(m_Text, settings) / pixelsPerUnit; 144 | return height < rectTransform.sizeDelta.y || verticalOverflow == VerticalWrapMode.Overflow ? height : rectTransform.sizeDelta.y; 145 | } 146 | } 147 | #endregion 148 | 149 | #region 事件回调 150 | //响应点击事件-->检测是否在超链接的范围内 151 | public void OnPointerClick(PointerEventData eventData) 152 | { 153 | Vector2 lp; 154 | RectTransformUtility.ScreenPointToLocalPointInRectangle( 155 | rectTransform, eventData.position, eventData.pressEventCamera, out lp); 156 | 157 | foreach (var hrefInfo in _listHrefInfos) 158 | { 159 | var boxes = hrefInfo.Boxes; 160 | for (var i = 0; i < boxes.Count; ++i) 161 | { 162 | if (boxes[i].Contains(lp)) 163 | { 164 | OnHrefClick.Invoke(hrefInfo.HrefValue, hrefInfo.Id); 165 | return; 166 | } 167 | } 168 | } 169 | } 170 | #endregion 171 | 172 | #region 内部函数 173 | //根据正则规则更新文本 174 | private string GetOutputText(string inputText) 175 | { 176 | //回收各种对象 177 | ReleaseSpriteTageInfo(); 178 | ReleaseHrefInfos(); 179 | 180 | if (string.IsNullOrEmpty(inputText)) 181 | return ""; 182 | 183 | _textBuilder.Remove(0, _textBuilder.Length); 184 | int textIndex = 0; 185 | int newIndex = 0; 186 | string part = ""; 187 | 188 | foreach (Match match in _inputTagRegex.Matches(inputText)) 189 | { 190 | int tempId = 0; 191 | if (!string.IsNullOrEmpty(match.Groups[1].Value) && !match.Groups[1].Value.Equals("-")) 192 | tempId = int.Parse(match.Groups[1].Value); 193 | string tempTag = match.Groups[2].Value; 194 | //更新超链接 195 | if (tempId < 0) 196 | { 197 | part = inputText.Substring(textIndex, match.Index - textIndex); 198 | _textBuilder.Append(part); 199 | _textBuilder.Append(""); 200 | int startIndex = _textBuilder.Length * 4; 201 | _textBuilder.Append("[" + match.Groups[2].Value + "]"); 202 | int endIndex = _textBuilder.Length * 4 - 1; 203 | _textBuilder.Append(""); 204 | #if UNITY_2019_1_OR_NEWER 205 | newIndex += ReplaceRichText(part).Length * 4; 206 | int newStartIndex = newIndex; 207 | newIndex += match.Groups[2].Value.Length * 4 + 8; 208 | #endif 209 | 210 | var hrefInfo = Pool.Get(); 211 | hrefInfo.Id = Mathf.Abs(tempId); 212 | hrefInfo.StartIndex = startIndex;// 超链接里的文本起始顶点索引 213 | hrefInfo.EndIndex = endIndex; 214 | #if UNITY_2019_1_OR_NEWER 215 | hrefInfo.NewStartIndex = newStartIndex; 216 | hrefInfo.NewEndIndex = newIndex - 1; 217 | #endif 218 | hrefInfo.Name = match.Groups[2].Value; 219 | hrefInfo.HrefValue = match.Groups[3].Value; 220 | _listHrefInfos.Add(hrefInfo); 221 | } 222 | //更新表情 223 | else 224 | { 225 | if (_inlineManager == null || !_inlineManager.IndexSpriteInfo.ContainsKey(tempId) 226 | || !_inlineManager.IndexSpriteInfo[tempId].ContainsKey(tempTag)) 227 | continue; 228 | 229 | SpriteInforGroup tempGroup = _inlineManager.IndexSpriteInfo[tempId][tempTag]; 230 | 231 | part = inputText.Substring(textIndex, match.Index - textIndex); 232 | _textBuilder.Append(part); 233 | int tempIndex = _textBuilder.Length * 4; 234 | #if UNITY_2019_1_OR_NEWER 235 | newIndex += ReplaceRichText(part).Length * 4; 236 | #endif 237 | _textBuilder.Append(@""); 238 | 239 | //清理标签 240 | SpriteTagInfo tempSpriteTag = Pool.Get(); 241 | tempSpriteTag.Index = tempIndex; 242 | #if UNITY_2019_1_OR_NEWER 243 | tempSpriteTag.NewIndex = newIndex; 244 | #endif 245 | tempSpriteTag.Id = tempId; 246 | tempSpriteTag.Tag = tempTag; 247 | tempSpriteTag.Size = new Vector2(tempGroup.Size * tempGroup.Width, tempGroup.Size); 248 | tempSpriteTag.UVs = tempGroup.ListSpriteInfor[0].Uv; 249 | 250 | //添加正则表达式的信息 251 | _spriteInfo.Add(tempSpriteTag); 252 | #if UNITY_2019_1_OR_NEWER 253 | newIndex += 4; 254 | #endif 255 | } 256 | textIndex = match.Index + match.Length; 257 | } 258 | 259 | _textBuilder.Append(inputText.Substring(textIndex, inputText.Length - textIndex)); 260 | return _textBuilder.ToString(); 261 | } 262 | //处理表情信息 263 | private void DealSpriteTagInfo(VertexHelper toFill) 264 | { 265 | int index = -1; 266 | #if UNITY_2019_1_OR_NEWER 267 | bool autoLF = AutoLF(); 268 | #endif 269 | //emoji 270 | for (int i = 0; i < _spriteInfo.Count; i++) 271 | { 272 | #if UNITY_2019_1_OR_NEWER 273 | index = autoLF ? _spriteInfo[i].Index : _spriteInfo[i].NewIndex; 274 | #else 275 | index = _spriteInfo[i].Index; 276 | #endif 277 | if ((index + 4) <= toFill.currentVertCount) 278 | { 279 | for (int j = index; j < index + 4; j++) 280 | { 281 | toFill.PopulateUIVertex(ref _tempVertex, j); 282 | //清理多余的乱码uv 283 | _tempVertex.uv0 = Vector2.zero; 284 | //获取quad的位置 --> 转为世界坐标 285 | _spriteInfo[i].Pos[j - index] = Utility.TransformPoint2World(transform, _tempVertex.position); 286 | toFill.SetUIVertex(_tempVertex, j); 287 | } 288 | } 289 | } 290 | } 291 | //处理超链接的信息 292 | private void DealHrefInfo(VertexHelper toFill) 293 | { 294 | if (_listHrefInfos.Count > 0) 295 | { 296 | #if UNITY_2019_1_OR_NEWER 297 | bool autoLF = AutoLF(); 298 | #endif 299 | // 处理超链接包围框 300 | for (int i = 0; i < _listHrefInfos.Count; i++) 301 | { 302 | _listHrefInfos[i].Boxes.Clear(); 303 | #if UNITY_2019_1_OR_NEWER 304 | int startIndex = autoLF ? _listHrefInfos[i].StartIndex : _listHrefInfos[i].NewStartIndex; 305 | int endIndex = autoLF ? _listHrefInfos[i].EndIndex : _listHrefInfos[i].NewEndIndex; 306 | #else 307 | int startIndex = _listHrefInfos[i].StartIndex; 308 | int endIndex = _listHrefInfos[i].EndIndex; 309 | #endif 310 | if (startIndex >= toFill.currentVertCount) 311 | continue; 312 | 313 | toFill.PopulateUIVertex(ref _tempVertex, startIndex); 314 | // 将超链接里面的文本顶点索引坐标加入到包围框 315 | var pos = _tempVertex.position; 316 | var bounds = new Bounds(pos, Vector3.zero); 317 | for (int j = startIndex + 1; j < endIndex; j++) 318 | { 319 | if (j >= toFill.currentVertCount) 320 | { 321 | break; 322 | } 323 | toFill.PopulateUIVertex(ref _tempVertex, j); 324 | pos = _tempVertex.position; 325 | if (pos.x < bounds.min.x) 326 | { 327 | // 换行重新添加包围框 328 | _listHrefInfos[i].Boxes.Add(new Rect(bounds.min, bounds.size)); 329 | bounds = new Bounds(pos, Vector3.zero); 330 | } 331 | else 332 | { 333 | bounds.Encapsulate(pos); // 扩展包围框 334 | } 335 | } 336 | //添加包围盒 337 | _listHrefInfos[i].Boxes.Add(new Rect(bounds.min, bounds.size)); 338 | } 339 | 340 | //添加下划线 341 | Vector2 extents = rectTransform.rect.size; 342 | var settings = GetGenerationSettings(extents); 343 | TextGenerator underlineText = Pool.Get(); 344 | underlineText.Populate("_", settings); 345 | IList tut = underlineText.verts; 346 | for (int m = 0; m < _listHrefInfos.Count; m++) 347 | { 348 | for (int i = 0; i < _listHrefInfos[m].Boxes.Count; i++) 349 | { 350 | //计算下划线的位置 351 | Vector3[] ulPos = new Vector3[4]; 352 | ulPos[0] = _listHrefInfos[m].Boxes[i].position + new Vector2(0.0f, fontSize * 0.2f); 353 | ulPos[1] = ulPos[0] + new Vector3(_listHrefInfos[m].Boxes[i].width, 0.0f); 354 | ulPos[2] = _listHrefInfos[m].Boxes[i].position + new Vector2(_listHrefInfos[m].Boxes[i].width, 0.0f); 355 | ulPos[3] = _listHrefInfos[m].Boxes[i].position; 356 | //绘制下划线 357 | for (int j = 0; j < 4; j++) 358 | { 359 | m_TempVerts[j] = tut[j]; 360 | m_TempVerts[j].color = Color.blue; 361 | m_TempVerts[j].position = ulPos[j]; 362 | if (j == 3) 363 | toFill.AddUIVertexQuad(m_TempVerts); 364 | } 365 | } 366 | } 367 | //回收下划线的对象 368 | Pool.Release(underlineText); 369 | } 370 | } 371 | 372 | //表情绘制 373 | private void UpdateDrawSprite(bool visable) 374 | { 375 | //记录之前的信息 376 | if ((_spriteInfo == null || _spriteInfo.Count == 0) && _lastRenderIndexs.Count > 0) 377 | { 378 | for (int i = 0; i < _lastRenderIndexs.Count; i++) 379 | { 380 | _inlineManager.UpdateTextInfo(this, _lastRenderIndexs[i], null, visable); 381 | } 382 | _lastRenderIndexs.Clear(); 383 | } 384 | else 385 | { 386 | _lastRenderIndexs.Clear(); 387 | for (int i = 0; i < _spriteInfo.Count; i++) 388 | { 389 | //添加渲染id索引 390 | if (!_lastRenderIndexs.Contains(_spriteInfo[i].Id)) 391 | { 392 | _inlineManager.UpdateTextInfo(this, _spriteInfo[i].Id, _spriteInfo.FindAll(x => x.Id == _spriteInfo[i].Id), visable); 393 | _lastRenderIndexs.Add(_spriteInfo[i].Id); 394 | } 395 | } 396 | } 397 | } 398 | //回收SpriteTagInfo 399 | private void ReleaseSpriteTageInfo() 400 | { 401 | //记录之前的信息 402 | for (int i = 0; i < _spriteInfo.Count; i++) 403 | { 404 | //回收信息到对象池 405 | Pool.Release(_spriteInfo[i]); 406 | } 407 | _spriteInfo.Clear(); 408 | } 409 | //回收超链接的信息 410 | private void ReleaseHrefInfos() 411 | { 412 | for (int i = 0; i < _listHrefInfos.Count; i++) 413 | { 414 | Pool.Release(_listHrefInfos[i]); 415 | } 416 | _listHrefInfos.Clear(); 417 | } 418 | //是否换行 419 | private bool AutoLF() 420 | { 421 | //width 422 | var settings = GetGenerationSettings(Vector2.zero); 423 | float width = cachedTextGeneratorForLayout.GetPreferredWidth(m_Text, settings) / pixelsPerUnit; 424 | bool widthResult = width < rectTransform.sizeDelta.x || horizontalOverflow == HorizontalWrapMode.Overflow; 425 | //height 426 | settings = GetGenerationSettings(new Vector2(rectTransform.rect.size.x, 0.0f)); 427 | float height = cachedTextGeneratorForLayout.GetPreferredHeight(m_Text, settings) / pixelsPerUnit; 428 | bool heightResult = height < rectTransform.sizeDelta.y || verticalOverflow == VerticalWrapMode.Overflow; 429 | return !widthResult || !heightResult; 430 | } 431 | 432 | //换掉富文本 433 | private string ReplaceRichText(string str) 434 | { 435 | str = Regex.Replace(str, @"", ""); 436 | str = str.Replace("", ""); 437 | str = str.Replace("", ""); 438 | str = str.Replace("", ""); 439 | str = str.Replace("", ""); 440 | str = str.Replace("", ""); 441 | str = str.Replace("\n", ""); 442 | str = str.Replace("\t", ""); 443 | str = str.Replace("\r", ""); 444 | str = str.Replace(" ", ""); 445 | 446 | return str; 447 | } 448 | #endregion 449 | 450 | 451 | #region UNITY_EDITOR 452 | #if UNITY_EDITOR 453 | protected override void OnValidate() 454 | { 455 | base.OnValidate(); 456 | m_Text = GetOutputText(_text); 457 | SetVerticesDirty(); 458 | SetLayoutDirty(); 459 | } 460 | 461 | //辅助线框 462 | Vector3[] _textWolrdVertexs = new Vector3[4]; 463 | private void OnDrawGizmos() 464 | { 465 | //text 466 | rectTransform.GetWorldCorners(_textWolrdVertexs); 467 | GizmosDrawLine(Color.white, _textWolrdVertexs); 468 | 469 | //preferred size 470 | Vector2 pivot = GetTextAnchorPivot(alignment); 471 | Rect rect = new Rect(); 472 | Vector2 size = rectTransform.sizeDelta - new Vector2(preferredWidth, preferredHeight); 473 | rect.position = new Vector2(pivot.x * size.x, pivot.y * size.y) - new Vector2(rectTransform.sizeDelta.x * rectTransform.pivot.x, rectTransform.sizeDelta.y * rectTransform.pivot.y); 474 | rect.width = preferredWidth; 475 | rect.height = preferredHeight; 476 | _textWolrdVertexs[0] = Utility.TransformPoint2World(transform, new Vector3(rect.x, rect.y)); 477 | _textWolrdVertexs[1] = Utility.TransformPoint2World(transform, new Vector3(rect.x + rect.width, rect.y)); 478 | _textWolrdVertexs[2] = Utility.TransformPoint2World(transform, new Vector3(rect.x + rect.width, rect.y + rect.height)); 479 | _textWolrdVertexs[3] = Utility.TransformPoint2World(transform, new Vector3(rect.x, rect.y + rect.height)); 480 | GizmosDrawLine(Color.blue, _textWolrdVertexs); 481 | 482 | //href 483 | for (int i = 0; i < _listHrefInfos.Count; i++) 484 | { 485 | for (int j = 0; j < _listHrefInfos[i].Boxes.Count; j++) 486 | { 487 | rect = _listHrefInfos[i].Boxes[j]; 488 | _textWolrdVertexs[0] = Utility.TransformPoint2World(transform, rect.position); 489 | _textWolrdVertexs[1] = Utility.TransformPoint2World(transform, new Vector3(rect.x + rect.width, rect.y)); 490 | _textWolrdVertexs[2] = Utility.TransformPoint2World(transform, new Vector3(rect.x + rect.width, rect.y + rect.height)); 491 | _textWolrdVertexs[3] = Utility.TransformPoint2World(transform, new Vector3(rect.x, rect.y + rect.height)); 492 | 493 | GizmosDrawLine(Color.green, _textWolrdVertexs); 494 | } 495 | } 496 | 497 | //sprite 498 | for (int i = 0; i < _spriteInfo.Count; i++) 499 | { 500 | GizmosDrawLine(Color.yellow, _spriteInfo[i].Pos); 501 | } 502 | } 503 | //划线 504 | private void GizmosDrawLine(Color color, Vector3[] pos) 505 | { 506 | Gizmos.color = color; 507 | 508 | Gizmos.DrawLine(pos[0], pos[1]); 509 | Gizmos.DrawLine(pos[1], pos[2]); 510 | Gizmos.DrawLine(pos[2], pos[3]); 511 | Gizmos.DrawLine(pos[3], pos[0]); 512 | } 513 | #endif 514 | #endregion 515 | } 516 | 517 | #region Struct 518 | /// 519 | /// 图片的信息 520 | /// 521 | public class SpriteTagInfo 522 | { 523 | /// 524 | /// 顶点索引id 525 | /// 526 | public int Index; 527 | #if UNITY_2019_1_OR_NEWER 528 | /// 529 | /// 为了兼容unity2019 单行的顶点的索引 530 | /// 531 | public int NewIndex; 532 | #endif 533 | /// 534 | /// 图集id 535 | /// 536 | public int Id; 537 | /// 538 | /// 标签标签 539 | /// 540 | public string Tag; 541 | /// 542 | /// 标签大小 543 | /// 544 | public Vector2 Size; 545 | /// 546 | /// 表情位置 547 | /// 548 | public Vector3[] Pos = new Vector3[4]; 549 | /// 550 | /// uv 551 | /// 552 | public Vector2[] UVs = new Vector2[4]; 553 | } 554 | 555 | /// 556 | /// 超链接信息类 557 | /// 558 | public class HrefInfo 559 | { 560 | /// 561 | /// 超链接id 562 | /// 563 | public int Id; 564 | /// 565 | /// 顶点开始索引值 566 | /// 567 | public int StartIndex; 568 | /// 569 | /// 顶点结束索引值 570 | /// 571 | public int EndIndex; 572 | #if UNITY_2019_1_OR_NEWER 573 | /// 574 | /// 顶点开始索引值 575 | /// 576 | public int NewStartIndex; 577 | /// 578 | /// 顶点结束索引值 579 | /// 580 | public int NewEndIndex; 581 | #endif 582 | /// 583 | /// 名称 584 | /// 585 | public string Name; 586 | /// 587 | /// 超链接的值 588 | /// 589 | public string HrefValue; 590 | /// 591 | /// 碰撞盒范围 592 | /// 593 | public readonly List Boxes = new List(); 594 | } 595 | #endregion 596 | 597 | } 598 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/InlineText.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe91fb1d3926f5940bad17bb75cfd5fe 3 | timeCreated: 1498315505 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/Pool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | 6 | namespace Wanderer.EmojiText 7 | { 8 | //对象池 -- Unity-Technologies-UI 9 | public class ObjectPool where T : new() 10 | { 11 | private readonly Stack _stack = new Stack(); 12 | private readonly UnityAction _actionOnGet; 13 | private readonly UnityAction _actionOnRelease; 14 | 15 | public int CountAll { get; private set; } 16 | public int CountActive { get { return CountAll - CountInactive; } } 17 | public int CountInactive { get { return _stack.Count; } } 18 | 19 | public ObjectPool(UnityAction actionOnGet, UnityAction actionOnRelease) 20 | { 21 | _actionOnGet = actionOnGet; 22 | _actionOnRelease = actionOnRelease; 23 | } 24 | 25 | public T Get() 26 | { 27 | T element; 28 | if (_stack.Count == 0) 29 | { 30 | element = new T(); 31 | CountAll++; 32 | } 33 | else 34 | { 35 | element = _stack.Pop(); 36 | } 37 | if (_actionOnGet != null) 38 | _actionOnGet(element); 39 | return element; 40 | } 41 | 42 | public void Release(T element) 43 | { 44 | if (_stack.Count > 0 && ReferenceEquals(_stack.Peek(), element)) 45 | Debug.LogError("Internal error. Trying to destroy object that is already released to pool."); 46 | if (_actionOnRelease != null) 47 | _actionOnRelease(element); 48 | _stack.Push(element); 49 | } 50 | } 51 | 52 | 53 | //对象池 -- Unity-Technologies-UI 54 | public static class ListPool 55 | { 56 | // Object pool to avoid allocations. 57 | private static readonly ObjectPool> _listPool = new ObjectPool>(null, Clear); 58 | static void Clear(List l) { l.Clear(); } 59 | 60 | public static List Get() 61 | { 62 | return _listPool.Get(); 63 | } 64 | 65 | public static void Release(List toRelease) 66 | { 67 | _listPool.Release(toRelease); 68 | } 69 | } 70 | 71 | 72 | public static class Pool where T : new() 73 | { 74 | private static readonly ObjectPool _objectPool = new ObjectPool(null, null); 75 | 76 | public static T Get() 77 | { 78 | return _objectPool.Get(); 79 | } 80 | 81 | public static void Release(T element) 82 | { 83 | _objectPool.Release(element); 84 | } 85 | 86 | } 87 | 88 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/Pool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b328582bae0dbc647a1d0402da2c4d9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/SpriteAsset.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace Wanderer.EmojiText 6 | { 7 | public class SpriteAsset : ScriptableObject 8 | { 9 | /// 10 | /// 图集ID 11 | /// 12 | public int Id; 13 | /// 14 | /// 静态表情 15 | /// 16 | public bool IsStatic; 17 | /// 18 | /// 图片资源 19 | /// 20 | public Texture TexSource; 21 | /// 22 | /// 行 23 | /// 24 | public int Row; 25 | /// 26 | /// 列 27 | /// 28 | public int Column; 29 | /// 30 | /// 动态表情的切换速度 31 | /// 32 | public float Speed = 10; 33 | /// 34 | /// 所有sprite信息 SpriteAssetInfor类为具体的信息类 35 | /// 36 | public List ListSpriteGroup; 37 | } 38 | 39 | [System.Serializable] 40 | public class SpriteInfor 41 | { 42 | /// 43 | /// ID 44 | /// 45 | public int Id; 46 | ///// 47 | ///// 名称 48 | ///// 49 | //public string Name; 50 | ///// 51 | ///// 中心点 52 | ///// 53 | //public Vector2 Pivot; 54 | /// 55 | ///坐标&宽高 56 | /// 57 | public Rect Rect; 58 | 59 | /// 60 | /// 绘画参数 61 | /// 62 | public Rect DrawTexCoord; 63 | 64 | ///// 65 | ///// 精灵 66 | ///// 67 | //public Sprite Sprite; 68 | ///// 69 | ///// 标签 70 | ///// 71 | //public string Tag; 72 | /// 73 | /// uv 74 | /// 75 | public Vector2[] Uv; 76 | } 77 | 78 | [System.Serializable] 79 | public class SpriteInforGroup 80 | { 81 | public string Tag = ""; 82 | public List ListSpriteInfor = new List(); 83 | public float Width = 1.0f; 84 | public float Size = 24.0f; 85 | } 86 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/SpriteAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5efe682ead7eb154f97508822f9d073c 3 | timeCreated: 1458916192 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/SpriteGraphic.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | 7 | namespace Wanderer.EmojiText 8 | { 9 | [ExecuteInEditMode] 10 | public class SpriteGraphic : MaskableGraphic 11 | { 12 | #region 属性 13 | //默认shader 14 | private const string _defaultShader = "Hidden/UI/Emoji"; 15 | private Material _defaultMater = null; 16 | 17 | public SpriteAsset m_spriteAsset; 18 | 19 | ////分割数量 20 | //[SerializeField] 21 | //private int _cellAmount = 1; 22 | ////动画速度 23 | //[SerializeField] 24 | //private float _speed; 25 | //顶点缓存数据 26 | readonly UIVertex[] _tempVerts = new UIVertex[4]; 27 | 28 | //模型数据 29 | private MeshInfo _meshInfo; 30 | public MeshInfo MeshInfo 31 | { 32 | get { return _meshInfo; } 33 | set 34 | { 35 | if (value == null && _meshInfo != null) 36 | { 37 | _meshInfo.Reset(); 38 | } 39 | else 40 | _meshInfo = value; 41 | 42 | SetAllDirty(); 43 | } 44 | } 45 | 46 | public override Texture mainTexture 47 | { 48 | get 49 | { 50 | if (m_spriteAsset == null || m_spriteAsset.TexSource == null) 51 | return base.mainTexture; 52 | else 53 | return m_spriteAsset.TexSource; 54 | } 55 | } 56 | 57 | public override Material material 58 | { 59 | get 60 | { 61 | if (_defaultMater == null && m_spriteAsset != null) 62 | { 63 | _defaultMater = new Material(Shader.Find(_defaultShader)); 64 | //是否开启动画 65 | if (m_spriteAsset.IsStatic) 66 | _defaultMater.DisableKeyword("EMOJI_ANIMATION"); 67 | else 68 | { 69 | _defaultMater.EnableKeyword("EMOJI_ANIMATION"); 70 | _defaultMater.SetFloat("_CellAmount", m_spriteAsset.Column); 71 | _defaultMater.SetFloat("_Speed", m_spriteAsset.Speed); 72 | } 73 | } 74 | return _defaultMater; 75 | } 76 | } 77 | #endregion 78 | 79 | protected override void OnPopulateMesh(VertexHelper vh) 80 | { 81 | vh.Clear(); 82 | //在这里可以做一个数据判断,如果数据一样 就不再刷新 83 | if (_meshInfo != null) 84 | { 85 | for (int i = 0; i < _meshInfo.Vertices.Count; i++) 86 | { 87 | int tempVertsIndex = i & 3; 88 | _tempVerts[tempVertsIndex].position = _meshInfo.Vertices[i];// Utility.TransformWorld2Point(transform, _meshInfo.Vertices[i]); 89 | _tempVerts[tempVertsIndex].uv0 = _meshInfo.UVs[i]; 90 | _tempVerts[tempVertsIndex].color = color; 91 | if (tempVertsIndex == 3) 92 | vh.AddUIVertexQuad(_tempVerts); 93 | } 94 | } 95 | } 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/SpriteGraphic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d458b7b6876e23d4ca3b28c582b100a6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/Utility.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace Wanderer.EmojiText 7 | { 8 | public class Utility 9 | { 10 | 11 | /// 12 | /// 获取Transform的世界坐标 13 | /// 14 | /// 15 | /// 16 | /// 17 | public static Vector3 TransformPoint2World(Transform transform, Vector3 point) 18 | { 19 | return transform.localToWorldMatrix.MultiplyPoint(point); 20 | } 21 | 22 | /// 23 | /// 获取Transform的本地坐标 24 | /// 25 | /// 26 | /// 27 | /// 28 | public static Vector3 TransformWorld2Point(Transform transform, Vector3 point) 29 | { 30 | return transform.worldToLocalMatrix.MultiplyPoint(point); 31 | } 32 | 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /Assets/EmojiText/Scripts/Utility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ec706e34d489eb489e8023414e69ef2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f24a6c309c16e894eb360e7b4466cae8 3 | folderAsset: yes 4 | timeCreated: 1458915842 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/chatpopo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Texture/chatpopo.png -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/chatpopo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94f50dbb071afb144aa03373cd9a910d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 20, y: 36, z: 16, w: 17} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 922aed4d41c85864cb5b0b248f9c40f5 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 5efe682ead7eb154f97508822f9d073c, type: 3} 12 | m_Name: emoji 13 | m_EditorClassIdentifier: 14 | Id: 0 15 | IsStatic: 1 16 | TexSource: {fileID: 2800000, guid: 4d583ec90f85e0c45bfe51d798299336, type: 3} 17 | Row: 4 18 | Column: 5 19 | Speed: 10 20 | ListSpriteGroup: 21 | - Tag: emoji_0 22 | ListSpriteInfor: 23 | - Id: 0 24 | Rect: 25 | serializedVersion: 2 26 | x: 0 27 | y: 631.2 28 | width: 204.8 29 | height: 209 30 | DrawTexCoord: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0.75502396 34 | width: 0.2 35 | height: 0.25 36 | Uv: 37 | - {x: 0, y: 1.005024} 38 | - {x: 0.2, y: 1.005024} 39 | - {x: 0.2, y: 0.75502396} 40 | - {x: 0, y: 0.75502396} 41 | Width: 1 42 | Size: 24 43 | - Tag: emoji_1 44 | ListSpriteInfor: 45 | - Id: 1 46 | Rect: 47 | serializedVersion: 2 48 | x: 209 49 | y: 631.2 50 | width: 204.8 51 | height: 209 52 | DrawTexCoord: 53 | serializedVersion: 2 54 | x: 0.20410156 55 | y: 0.75502396 56 | width: 0.2 57 | height: 0.25 58 | Uv: 59 | - {x: 0.20410156, y: 1.005024} 60 | - {x: 0.40410155, y: 1.005024} 61 | - {x: 0.40410155, y: 0.75502396} 62 | - {x: 0.20410156, y: 0.75502396} 63 | Width: 1 64 | Size: 24 65 | - Tag: emoji_2 66 | ListSpriteInfor: 67 | - Id: 2 68 | Rect: 69 | serializedVersion: 2 70 | x: 418 71 | y: 631.2 72 | width: 204.8 73 | height: 209 74 | DrawTexCoord: 75 | serializedVersion: 2 76 | x: 0.40820312 77 | y: 0.75502396 78 | width: 0.2 79 | height: 0.25 80 | Uv: 81 | - {x: 0.40820312, y: 1.005024} 82 | - {x: 0.6082031, y: 1.005024} 83 | - {x: 0.6082031, y: 0.75502396} 84 | - {x: 0.40820312, y: 0.75502396} 85 | Width: 1 86 | Size: 24 87 | - Tag: emoji_3 88 | ListSpriteInfor: 89 | - Id: 3 90 | Rect: 91 | serializedVersion: 2 92 | x: 627 93 | y: 631.2 94 | width: 204.8 95 | height: 209 96 | DrawTexCoord: 97 | serializedVersion: 2 98 | x: 0.6123047 99 | y: 0.75502396 100 | width: 0.2 101 | height: 0.25 102 | Uv: 103 | - {x: 0.6123047, y: 1.005024} 104 | - {x: 0.8123047, y: 1.005024} 105 | - {x: 0.8123047, y: 0.75502396} 106 | - {x: 0.6123047, y: 0.75502396} 107 | Width: 1 108 | Size: 24 109 | - Tag: emoji_4 110 | ListSpriteInfor: 111 | - Id: 4 112 | Rect: 113 | serializedVersion: 2 114 | x: 836 115 | y: 631.2 116 | width: 204.8 117 | height: 209 118 | DrawTexCoord: 119 | serializedVersion: 2 120 | x: 0.81640625 121 | y: 0.75502396 122 | width: 0.2 123 | height: 0.25 124 | Uv: 125 | - {x: 0.81640625, y: 1.005024} 126 | - {x: 1.0164063, y: 1.005024} 127 | - {x: 1.0164063, y: 0.75502396} 128 | - {x: 0.81640625, y: 0.75502396} 129 | Width: 1 130 | Size: 24 131 | - Tag: emoji_5 132 | ListSpriteInfor: 133 | - Id: 5 134 | Rect: 135 | serializedVersion: 2 136 | x: 0 137 | y: 426.4 138 | width: 204.8 139 | height: 209 140 | DrawTexCoord: 141 | serializedVersion: 2 142 | x: 0 143 | y: 0.51004785 144 | width: 0.2 145 | height: 0.25 146 | Uv: 147 | - {x: 0, y: 0.76004785} 148 | - {x: 0.2, y: 0.76004785} 149 | - {x: 0.2, y: 0.51004785} 150 | - {x: 0, y: 0.51004785} 151 | Width: 1 152 | Size: 24 153 | - Tag: emoji_6 154 | ListSpriteInfor: 155 | - Id: 6 156 | Rect: 157 | serializedVersion: 2 158 | x: 209 159 | y: 426.4 160 | width: 204.8 161 | height: 209 162 | DrawTexCoord: 163 | serializedVersion: 2 164 | x: 0.20410156 165 | y: 0.51004785 166 | width: 0.2 167 | height: 0.25 168 | Uv: 169 | - {x: 0.20410156, y: 0.76004785} 170 | - {x: 0.40410155, y: 0.76004785} 171 | - {x: 0.40410155, y: 0.51004785} 172 | - {x: 0.20410156, y: 0.51004785} 173 | Width: 1 174 | Size: 24 175 | - Tag: emoji_7 176 | ListSpriteInfor: 177 | - Id: 7 178 | Rect: 179 | serializedVersion: 2 180 | x: 418 181 | y: 426.4 182 | width: 204.8 183 | height: 209 184 | DrawTexCoord: 185 | serializedVersion: 2 186 | x: 0.40820312 187 | y: 0.51004785 188 | width: 0.2 189 | height: 0.25 190 | Uv: 191 | - {x: 0.40820312, y: 0.76004785} 192 | - {x: 0.6082031, y: 0.76004785} 193 | - {x: 0.6082031, y: 0.51004785} 194 | - {x: 0.40820312, y: 0.51004785} 195 | Width: 1 196 | Size: 24 197 | - Tag: emoji_8 198 | ListSpriteInfor: 199 | - Id: 8 200 | Rect: 201 | serializedVersion: 2 202 | x: 627 203 | y: 426.4 204 | width: 204.8 205 | height: 209 206 | DrawTexCoord: 207 | serializedVersion: 2 208 | x: 0.6123047 209 | y: 0.51004785 210 | width: 0.2 211 | height: 0.25 212 | Uv: 213 | - {x: 0.6123047, y: 0.76004785} 214 | - {x: 0.8123047, y: 0.76004785} 215 | - {x: 0.8123047, y: 0.51004785} 216 | - {x: 0.6123047, y: 0.51004785} 217 | Width: 1 218 | Size: 24 219 | - Tag: emoji_9 220 | ListSpriteInfor: 221 | - Id: 9 222 | Rect: 223 | serializedVersion: 2 224 | x: 836 225 | y: 426.4 226 | width: 204.8 227 | height: 209 228 | DrawTexCoord: 229 | serializedVersion: 2 230 | x: 0.81640625 231 | y: 0.51004785 232 | width: 0.2 233 | height: 0.25 234 | Uv: 235 | - {x: 0.81640625, y: 0.76004785} 236 | - {x: 1.0164063, y: 0.76004785} 237 | - {x: 1.0164063, y: 0.51004785} 238 | - {x: 0.81640625, y: 0.51004785} 239 | Width: 1 240 | Size: 24 241 | - Tag: emoji_10 242 | ListSpriteInfor: 243 | - Id: 10 244 | Rect: 245 | serializedVersion: 2 246 | x: 0 247 | y: 221.59999 248 | width: 204.8 249 | height: 209 250 | DrawTexCoord: 251 | serializedVersion: 2 252 | x: 0 253 | y: 0.26507175 254 | width: 0.2 255 | height: 0.25 256 | Uv: 257 | - {x: 0, y: 0.51507175} 258 | - {x: 0.2, y: 0.51507175} 259 | - {x: 0.2, y: 0.26507175} 260 | - {x: 0, y: 0.26507175} 261 | Width: 1 262 | Size: 24 263 | - Tag: emoji_11 264 | ListSpriteInfor: 265 | - Id: 11 266 | Rect: 267 | serializedVersion: 2 268 | x: 209 269 | y: 221.59999 270 | width: 204.8 271 | height: 209 272 | DrawTexCoord: 273 | serializedVersion: 2 274 | x: 0.20410156 275 | y: 0.26507175 276 | width: 0.2 277 | height: 0.25 278 | Uv: 279 | - {x: 0.20410156, y: 0.51507175} 280 | - {x: 0.40410155, y: 0.51507175} 281 | - {x: 0.40410155, y: 0.26507175} 282 | - {x: 0.20410156, y: 0.26507175} 283 | Width: 1 284 | Size: 24 285 | - Tag: emoji_12 286 | ListSpriteInfor: 287 | - Id: 12 288 | Rect: 289 | serializedVersion: 2 290 | x: 418 291 | y: 221.59999 292 | width: 204.8 293 | height: 209 294 | DrawTexCoord: 295 | serializedVersion: 2 296 | x: 0.40820312 297 | y: 0.26507175 298 | width: 0.2 299 | height: 0.25 300 | Uv: 301 | - {x: 0.40820312, y: 0.51507175} 302 | - {x: 0.6082031, y: 0.51507175} 303 | - {x: 0.6082031, y: 0.26507175} 304 | - {x: 0.40820312, y: 0.26507175} 305 | Width: 1 306 | Size: 24 307 | - Tag: emoji_13 308 | ListSpriteInfor: 309 | - Id: 13 310 | Rect: 311 | serializedVersion: 2 312 | x: 627 313 | y: 221.59999 314 | width: 204.8 315 | height: 209 316 | DrawTexCoord: 317 | serializedVersion: 2 318 | x: 0.6123047 319 | y: 0.26507175 320 | width: 0.2 321 | height: 0.25 322 | Uv: 323 | - {x: 0.6123047, y: 0.51507175} 324 | - {x: 0.8123047, y: 0.51507175} 325 | - {x: 0.8123047, y: 0.26507175} 326 | - {x: 0.6123047, y: 0.26507175} 327 | Width: 1 328 | Size: 24 329 | - Tag: emoji_14 330 | ListSpriteInfor: 331 | - Id: 14 332 | Rect: 333 | serializedVersion: 2 334 | x: 836 335 | y: 221.59999 336 | width: 204.8 337 | height: 209 338 | DrawTexCoord: 339 | serializedVersion: 2 340 | x: 0.81640625 341 | y: 0.26507175 342 | width: 0.2 343 | height: 0.25 344 | Uv: 345 | - {x: 0.81640625, y: 0.51507175} 346 | - {x: 1.0164063, y: 0.51507175} 347 | - {x: 1.0164063, y: 0.26507175} 348 | - {x: 0.81640625, y: 0.26507175} 349 | Width: 1 350 | Size: 24 351 | - Tag: emoji_15 352 | ListSpriteInfor: 353 | - Id: 15 354 | Rect: 355 | serializedVersion: 2 356 | x: 0 357 | y: 16.799988 358 | width: 204.8 359 | height: 209 360 | DrawTexCoord: 361 | serializedVersion: 2 362 | x: 0 363 | y: 0.02009568 364 | width: 0.2 365 | height: 0.25 366 | Uv: 367 | - {x: 0, y: 0.27009568} 368 | - {x: 0.2, y: 0.27009568} 369 | - {x: 0.2, y: 0.02009568} 370 | - {x: 0, y: 0.02009568} 371 | Width: 1 372 | Size: 24 373 | - Tag: emoji_16 374 | ListSpriteInfor: 375 | - Id: 16 376 | Rect: 377 | serializedVersion: 2 378 | x: 209 379 | y: 16.799988 380 | width: 204.8 381 | height: 209 382 | DrawTexCoord: 383 | serializedVersion: 2 384 | x: 0.20410156 385 | y: 0.02009568 386 | width: 0.2 387 | height: 0.25 388 | Uv: 389 | - {x: 0.20410156, y: 0.27009568} 390 | - {x: 0.40410155, y: 0.27009568} 391 | - {x: 0.40410155, y: 0.02009568} 392 | - {x: 0.20410156, y: 0.02009568} 393 | Width: 1 394 | Size: 24 395 | - Tag: emoji_17 396 | ListSpriteInfor: 397 | - Id: 17 398 | Rect: 399 | serializedVersion: 2 400 | x: 418 401 | y: 16.799988 402 | width: 204.8 403 | height: 209 404 | DrawTexCoord: 405 | serializedVersion: 2 406 | x: 0.40820312 407 | y: 0.02009568 408 | width: 0.2 409 | height: 0.25 410 | Uv: 411 | - {x: 0.40820312, y: 0.27009568} 412 | - {x: 0.6082031, y: 0.27009568} 413 | - {x: 0.6082031, y: 0.02009568} 414 | - {x: 0.40820312, y: 0.02009568} 415 | Width: 1 416 | Size: 24 417 | - Tag: emoji_18 418 | ListSpriteInfor: 419 | - Id: 18 420 | Rect: 421 | serializedVersion: 2 422 | x: 627 423 | y: 16.799988 424 | width: 204.8 425 | height: 209 426 | DrawTexCoord: 427 | serializedVersion: 2 428 | x: 0.6123047 429 | y: 0.02009568 430 | width: 0.2 431 | height: 0.25 432 | Uv: 433 | - {x: 0.6123047, y: 0.27009568} 434 | - {x: 0.8123047, y: 0.27009568} 435 | - {x: 0.8123047, y: 0.02009568} 436 | - {x: 0.6123047, y: 0.02009568} 437 | Width: 1 438 | Size: 24 439 | - Tag: emoji_19 440 | ListSpriteInfor: 441 | - Id: 19 442 | Rect: 443 | serializedVersion: 2 444 | x: 836 445 | y: 16.799988 446 | width: 204.8 447 | height: 209 448 | DrawTexCoord: 449 | serializedVersion: 2 450 | x: 0.81640625 451 | y: 0.02009568 452 | width: 0.2 453 | height: 0.25 454 | Uv: 455 | - {x: 0.81640625, y: 0.27009568} 456 | - {x: 1.0164063, y: 0.27009568} 457 | - {x: 1.0164063, y: 0.02009568} 458 | - {x: 0.81640625, y: 0.02009568} 459 | Width: 1 460 | Size: 24 461 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d54a8ddeedd4f8b4eac3f365f086b8ab 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Texture/emoji.png -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d583ec90f85e0c45bfe51d798299336 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: emoji_0 6 | 21300002: emoji_1 7 | 21300004: emoji_2 8 | 21300006: emoji_3 9 | 21300008: emoji_4 10 | 21300010: emoji_5 11 | 21300012: emoji_6 12 | 21300014: emoji_7 13 | 21300016: emoji_8 14 | 21300018: emoji_9 15 | 21300020: emoji_10 16 | 21300022: emoji_11 17 | 21300024: emoji_12 18 | 21300026: emoji_13 19 | 21300028: emoji_14 20 | 21300030: emoji_15 21 | 21300032: emoji_16 22 | 21300034: emoji_17 23 | 21300036: emoji_18 24 | 21300038: emoji_19 25 | externalObjects: {} 26 | serializedVersion: 7 27 | mipmaps: 28 | mipMapMode: 0 29 | enableMipMap: 1 30 | sRGBTexture: 1 31 | linearTexture: 0 32 | fadeOut: 0 33 | borderMipMap: 0 34 | mipMapsPreserveCoverage: 0 35 | alphaTestReferenceValue: 0.5 36 | mipMapFadeDistanceStart: 1 37 | mipMapFadeDistanceEnd: 3 38 | bumpmap: 39 | convertToNormalMap: 0 40 | externalNormalMap: 0 41 | heightScale: 0.25 42 | normalMapFilter: 0 43 | isReadable: 0 44 | streamingMipmaps: 0 45 | streamingMipmapsPriority: 0 46 | grayScaleToAlpha: 0 47 | generateCubemap: 6 48 | cubemapConvolution: 0 49 | seamlessCubemap: 0 50 | textureFormat: -2 51 | maxTextureSize: 1024 52 | textureSettings: 53 | serializedVersion: 2 54 | filterMode: -1 55 | aniso: 16 56 | mipBias: -100 57 | wrapU: 1 58 | wrapV: 1 59 | wrapW: 1 60 | nPOTScale: 0 61 | lightmap: 0 62 | compressionQuality: 50 63 | spriteMode: 2 64 | spriteExtrude: 1 65 | spriteMeshType: 1 66 | alignment: 0 67 | spritePivot: {x: 0.5, y: 0.5} 68 | spritePixelsToUnits: 100 69 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 70 | spriteGenerateFallbackPhysicsShape: 1 71 | alphaUsage: 1 72 | alphaIsTransparency: 1 73 | spriteTessellationDetail: -1 74 | textureType: 0 75 | textureShape: 1 76 | singleChannelComponent: 0 77 | maxTextureSizeSet: 0 78 | compressionQualitySet: 0 79 | textureFormatSet: 0 80 | platformSettings: 81 | - serializedVersion: 2 82 | buildTarget: DefaultTexturePlatform 83 | maxTextureSize: 1024 84 | resizeAlgorithm: 0 85 | textureFormat: 2 86 | textureCompression: 1 87 | compressionQuality: 50 88 | crunchedCompression: 0 89 | allowsAlphaSplitting: 0 90 | overridden: 0 91 | androidETC2FallbackOverride: 0 92 | - serializedVersion: 2 93 | buildTarget: Standalone 94 | maxTextureSize: 1024 95 | resizeAlgorithm: 0 96 | textureFormat: 2 97 | textureCompression: 1 98 | compressionQuality: 50 99 | crunchedCompression: 0 100 | allowsAlphaSplitting: 0 101 | overridden: 0 102 | androidETC2FallbackOverride: 0 103 | - serializedVersion: 2 104 | buildTarget: WebGL 105 | maxTextureSize: 1024 106 | resizeAlgorithm: 0 107 | textureFormat: 2 108 | textureCompression: 1 109 | compressionQuality: 50 110 | crunchedCompression: 0 111 | allowsAlphaSplitting: 0 112 | overridden: 0 113 | androidETC2FallbackOverride: 0 114 | - serializedVersion: 2 115 | buildTarget: iPhone 116 | maxTextureSize: 1024 117 | resizeAlgorithm: 0 118 | textureFormat: 2 119 | textureCompression: 1 120 | compressionQuality: 50 121 | crunchedCompression: 0 122 | allowsAlphaSplitting: 0 123 | overridden: 0 124 | androidETC2FallbackOverride: 0 125 | - serializedVersion: 2 126 | buildTarget: Android 127 | maxTextureSize: 1024 128 | resizeAlgorithm: 0 129 | textureFormat: 2 130 | textureCompression: 1 131 | compressionQuality: 50 132 | crunchedCompression: 0 133 | allowsAlphaSplitting: 0 134 | overridden: 0 135 | androidETC2FallbackOverride: 0 136 | spriteSheet: 137 | serializedVersion: 2 138 | sprites: 139 | - serializedVersion: 2 140 | name: emoji_0 141 | rect: 142 | serializedVersion: 2 143 | x: 52 144 | y: 642 145 | width: 150 146 | height: 150 147 | alignment: 0 148 | pivot: {x: 0.5, y: 0.5} 149 | border: {x: 0, y: 0, z: 0, w: 0} 150 | outline: [] 151 | physicsShape: [] 152 | tessellationDetail: -1 153 | bones: [] 154 | spriteID: d58b159d931e05144b473aa111b89d59 155 | vertices: [] 156 | indices: 157 | edges: [] 158 | weights: [] 159 | - serializedVersion: 2 160 | name: emoji_1 161 | rect: 162 | serializedVersion: 2 163 | x: 236 164 | y: 642 165 | width: 150 166 | height: 150 167 | alignment: 0 168 | pivot: {x: 0.5, y: 0.5} 169 | border: {x: 0, y: 0, z: 0, w: 0} 170 | outline: [] 171 | physicsShape: [] 172 | tessellationDetail: -1 173 | bones: [] 174 | spriteID: d6007a73e4817024b8fe6918a904fada 175 | vertices: [] 176 | indices: 177 | edges: [] 178 | weights: [] 179 | - serializedVersion: 2 180 | name: emoji_2 181 | rect: 182 | serializedVersion: 2 183 | x: 466 184 | y: 633 185 | width: 154 186 | height: 165 187 | alignment: 0 188 | pivot: {x: 0.5, y: 0.5} 189 | border: {x: 0, y: 0, z: 0, w: 0} 190 | outline: [] 191 | physicsShape: [] 192 | tessellationDetail: -1 193 | bones: [] 194 | spriteID: fb0d56b8d02cffb41b01d89245025f3d 195 | vertices: [] 196 | indices: 197 | edges: [] 198 | weights: [] 199 | - serializedVersion: 2 200 | name: emoji_3 201 | rect: 202 | serializedVersion: 2 203 | x: 653 204 | y: 637 205 | width: 149 206 | height: 161 207 | alignment: 0 208 | pivot: {x: 0.5, y: 0.5} 209 | border: {x: 0, y: 0, z: 0, w: 0} 210 | outline: [] 211 | physicsShape: [] 212 | tessellationDetail: -1 213 | bones: [] 214 | spriteID: eaa4efbdfb26a2b4c8f10246fd405325 215 | vertices: [] 216 | indices: 217 | edges: [] 218 | weights: [] 219 | - serializedVersion: 2 220 | name: emoji_4 221 | rect: 222 | serializedVersion: 2 223 | x: 845 224 | y: 635 225 | width: 155 226 | height: 162 227 | alignment: 0 228 | pivot: {x: 0.5, y: 0.5} 229 | border: {x: 0, y: 0, z: 0, w: 0} 230 | outline: [] 231 | physicsShape: [] 232 | tessellationDetail: -1 233 | bones: [] 234 | spriteID: a957b7f795b74f64da659f8eed695e74 235 | vertices: [] 236 | indices: 237 | edges: [] 238 | weights: [] 239 | - serializedVersion: 2 240 | name: emoji_5 241 | rect: 242 | serializedVersion: 2 243 | x: 41 244 | y: 461 245 | width: 144 246 | height: 154 247 | alignment: 0 248 | pivot: {x: 0.5, y: 0.5} 249 | border: {x: 0, y: 0, z: 0, w: 0} 250 | outline: [] 251 | physicsShape: [] 252 | tessellationDetail: -1 253 | bones: [] 254 | spriteID: 262cae66c6292f143a0448c9ec0b7971 255 | vertices: [] 256 | indices: 257 | edges: [] 258 | weights: [] 259 | - serializedVersion: 2 260 | name: emoji_6 261 | rect: 262 | serializedVersion: 2 263 | x: 230 264 | y: 457 265 | width: 153 266 | height: 153 267 | alignment: 0 268 | pivot: {x: 0.5, y: 0.5} 269 | border: {x: 0, y: 0, z: 0, w: 0} 270 | outline: [] 271 | physicsShape: [] 272 | tessellationDetail: -1 273 | bones: [] 274 | spriteID: 49a841eeaf55ffb4892432bd409af56b 275 | vertices: [] 276 | indices: 277 | edges: [] 278 | weights: [] 279 | - serializedVersion: 2 280 | name: emoji_7 281 | rect: 282 | serializedVersion: 2 283 | x: 470 284 | y: 451 285 | width: 145 286 | height: 159 287 | alignment: 0 288 | pivot: {x: 0.5, y: 0.5} 289 | border: {x: 0, y: 0, z: 0, w: 0} 290 | outline: [] 291 | physicsShape: [] 292 | tessellationDetail: -1 293 | bones: [] 294 | spriteID: af6906b7fcb7a1f48b103eabaa600ea3 295 | vertices: [] 296 | indices: 297 | edges: [] 298 | weights: [] 299 | - serializedVersion: 2 300 | name: emoji_8 301 | rect: 302 | serializedVersion: 2 303 | x: 656 304 | y: 449 305 | width: 157 306 | height: 161 307 | alignment: 0 308 | pivot: {x: 0.5, y: 0.5} 309 | border: {x: 0, y: 0, z: 0, w: 0} 310 | outline: [] 311 | physicsShape: [] 312 | tessellationDetail: -1 313 | bones: [] 314 | spriteID: 6a7896593bbb215479c2301c6942e8f0 315 | vertices: [] 316 | indices: 317 | edges: [] 318 | weights: [] 319 | - serializedVersion: 2 320 | name: emoji_9 321 | rect: 322 | serializedVersion: 2 323 | x: 842 324 | y: 456 325 | width: 151 326 | height: 154 327 | alignment: 0 328 | pivot: {x: 0.5, y: 0.5} 329 | border: {x: 0, y: 0, z: 0, w: 0} 330 | outline: [] 331 | physicsShape: [] 332 | tessellationDetail: -1 333 | bones: [] 334 | spriteID: 741d6b5ac297a3142a1986852cb5e291 335 | vertices: [] 336 | indices: 337 | edges: [] 338 | weights: [] 339 | - serializedVersion: 2 340 | name: emoji_10 341 | rect: 342 | serializedVersion: 2 343 | x: 55 344 | y: 276 345 | width: 137 346 | height: 158 347 | alignment: 0 348 | pivot: {x: 0.5, y: 0.5} 349 | border: {x: 0, y: 0, z: 0, w: 0} 350 | outline: [] 351 | physicsShape: [] 352 | tessellationDetail: -1 353 | bones: [] 354 | spriteID: 87fc391bf207d444db45d003a9edff1b 355 | vertices: [] 356 | indices: 357 | edges: [] 358 | weights: [] 359 | - serializedVersion: 2 360 | name: emoji_11 361 | rect: 362 | serializedVersion: 2 363 | x: 245 364 | y: 278 365 | width: 130 366 | height: 154 367 | alignment: 0 368 | pivot: {x: 0.5, y: 0.5} 369 | border: {x: 0, y: 0, z: 0, w: 0} 370 | outline: [] 371 | physicsShape: [] 372 | tessellationDetail: -1 373 | bones: [] 374 | spriteID: f862990ddd99e734b9f5162e5a3b9a15 375 | vertices: [] 376 | indices: 377 | edges: [] 378 | weights: [] 379 | - serializedVersion: 2 380 | name: emoji_12 381 | rect: 382 | serializedVersion: 2 383 | x: 468 384 | y: 262 385 | width: 142 386 | height: 170 387 | alignment: 0 388 | pivot: {x: 0.5, y: 0.5} 389 | border: {x: 0, y: 0, z: 0, w: 0} 390 | outline: [] 391 | physicsShape: [] 392 | tessellationDetail: -1 393 | bones: [] 394 | spriteID: 892b412439be86846b45850f7a7ced16 395 | vertices: [] 396 | indices: 397 | edges: [] 398 | weights: [] 399 | - serializedVersion: 2 400 | name: emoji_13 401 | rect: 402 | serializedVersion: 2 403 | x: 654 404 | y: 267 405 | width: 153 406 | height: 169 407 | alignment: 0 408 | pivot: {x: 0.5, y: 0.5} 409 | border: {x: 0, y: 0, z: 0, w: 0} 410 | outline: [] 411 | physicsShape: [] 412 | tessellationDetail: -1 413 | bones: [] 414 | spriteID: 3cf491544c78f2848a92258e1cefcc62 415 | vertices: [] 416 | indices: 417 | edges: [] 418 | weights: [] 419 | - serializedVersion: 2 420 | name: emoji_14 421 | rect: 422 | serializedVersion: 2 423 | x: 852 424 | y: 263 425 | width: 131 426 | height: 171 427 | alignment: 0 428 | pivot: {x: 0.5, y: 0.5} 429 | border: {x: 0, y: 0, z: 0, w: 0} 430 | outline: [] 431 | physicsShape: [] 432 | tessellationDetail: -1 433 | bones: [] 434 | spriteID: 03b6b2b52c4b6934a8a3924dc70c35cd 435 | vertices: [] 436 | indices: 437 | edges: [] 438 | weights: [] 439 | - serializedVersion: 2 440 | name: emoji_15 441 | rect: 442 | serializedVersion: 2 443 | x: 66 444 | y: 80 445 | width: 141 446 | height: 151 447 | alignment: 0 448 | pivot: {x: 0.5, y: 0.5} 449 | border: {x: 0, y: 0, z: 0, w: 0} 450 | outline: [] 451 | physicsShape: [] 452 | tessellationDetail: -1 453 | bones: [] 454 | spriteID: c4dde96e0df1d094f97bae6b5c88a950 455 | vertices: [] 456 | indices: 457 | edges: [] 458 | weights: [] 459 | - serializedVersion: 2 460 | name: emoji_16 461 | rect: 462 | serializedVersion: 2 463 | x: 261 464 | y: 82 465 | width: 134 466 | height: 155 467 | alignment: 0 468 | pivot: {x: 0.5, y: 0.5} 469 | border: {x: 0, y: 0, z: 0, w: 0} 470 | outline: [] 471 | physicsShape: [] 472 | tessellationDetail: -1 473 | bones: [] 474 | spriteID: e51cff67aef5673479cbb883b251323c 475 | vertices: [] 476 | indices: 477 | edges: [] 478 | weights: [] 479 | - serializedVersion: 2 480 | name: emoji_17 481 | rect: 482 | serializedVersion: 2 483 | x: 466 484 | y: 61 485 | width: 149 486 | height: 169 487 | alignment: 0 488 | pivot: {x: 0.5, y: 0.5} 489 | border: {x: 0, y: 0, z: 0, w: 0} 490 | outline: [] 491 | physicsShape: [] 492 | tessellationDetail: -1 493 | bones: [] 494 | spriteID: 8d412d1eaecc37c438d27beee2f7a537 495 | vertices: [] 496 | indices: 497 | edges: [] 498 | weights: [] 499 | - serializedVersion: 2 500 | name: emoji_18 501 | rect: 502 | serializedVersion: 2 503 | x: 661 504 | y: 67 505 | width: 142 506 | height: 166 507 | alignment: 0 508 | pivot: {x: 0.5, y: 0.5} 509 | border: {x: 0, y: 0, z: 0, w: 0} 510 | outline: [] 511 | physicsShape: [] 512 | tessellationDetail: -1 513 | bones: [] 514 | spriteID: 7622bf7ca52123b4681db79d48aae999 515 | vertices: [] 516 | indices: 517 | edges: [] 518 | weights: [] 519 | - serializedVersion: 2 520 | name: emoji_19 521 | rect: 522 | serializedVersion: 2 523 | x: 843 524 | y: 68 525 | width: 151 526 | height: 163 527 | alignment: 0 528 | pivot: {x: 0.5, y: 0.5} 529 | border: {x: 0, y: 0, z: 0, w: 0} 530 | outline: [] 531 | physicsShape: [] 532 | tessellationDetail: -1 533 | bones: [] 534 | spriteID: d9e55725e0d541d4ab811d38f9212a1e 535 | vertices: [] 536 | indices: 537 | edges: [] 538 | weights: [] 539 | outline: [] 540 | physicsShape: [] 541 | bones: [] 542 | spriteID: 543 | vertices: [] 544 | indices: 545 | edges: [] 546 | weights: [] 547 | spritePackingTag: 548 | pSDRemoveMatte: 0 549 | pSDShowRemoveMatteOption: 0 550 | userData: 551 | assetBundleName: 552 | assetBundleVariant: 553 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji.png~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Texture/emoji.png~ -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji_lxh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 448421e4fa7e96a48aad0c3882565341 3 | timeCreated: 1527846344 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/emoji_lxh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Texture/emoji_lxh.png -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/Assets/EmojiText/Texture/player.png -------------------------------------------------------------------------------- /Assets/EmojiText/Texture/player.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b81eca5edfb98444f8b5051a08f61011 3 | timeCreated: 1474956250 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -2 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /Packages/manifest.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d79362b59bd04160b9419df0fe2e870 3 | timeCreated: 1578723731 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 0 9 | path: 10 | guid: 00000000000000000000000000000000 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 34 | m_PreloadedShaders: [] 35 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 36 | type: 0} 37 | m_CustomRenderPipeline: {fileID: 0} 38 | m_TransparencySortMode: 0 39 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 40 | m_DefaultRenderingPath: 1 41 | m_DefaultMobileRenderingPath: 1 42 | m_TierSettings: [] 43 | m_LightmapStripping: 0 44 | m_FogStripping: 0 45 | m_InstancingStripping: 0 46 | m_LightmapKeepPlain: 1 47 | m_LightmapKeepDirCombined: 1 48 | m_LightmapKeepDynamicPlain: 1 49 | m_LightmapKeepDynamicDirCombined: 1 50 | m_LightmapKeepShadowMask: 1 51 | m_LightmapKeepSubtractive: 1 52 | m_FogKeepLinear: 1 53 | m_FogKeepExp: 1 54 | m_FogKeepExp2: 1 55 | m_AlbedoSwatchInfos: [] 56 | m_LightsUseLinearIntensity: 0 57 | m_LightsUseColorTemperature: 0 58 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 0150057f1f891b44984b2175dac8188b 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: TextInlineSprite 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidBlitType: 0 67 | defaultIsNativeResolution: 1 68 | macRetinaSupport: 1 69 | runInBackground: 0 70 | captureSingleScreen: 0 71 | muteOtherAudioSources: 0 72 | Prepare IOS For Recording: 0 73 | Force IOS Speakers When Recording: 0 74 | deferSystemGesturesMode: 0 75 | hideHomeButton: 0 76 | submitAnalytics: 1 77 | usePlayerLog: 1 78 | bakeCollisionMeshes: 0 79 | forceSingleInstance: 0 80 | resizableWindow: 0 81 | useMacAppStoreValidation: 0 82 | macAppStoreCategory: public.app-category.games 83 | gpuSkinning: 0 84 | graphicsJobs: 0 85 | xboxPIXTextureCapture: 0 86 | xboxEnableAvatar: 0 87 | xboxEnableKinect: 0 88 | xboxEnableKinectAutoTracking: 0 89 | xboxEnableFitness: 0 90 | visibleInBackground: 1 91 | allowFullscreenSwitch: 1 92 | graphicsJobMode: 0 93 | fullscreenMode: 1 94 | xboxSpeechDB: 0 95 | xboxEnableHeadOrientation: 0 96 | xboxEnableGuest: 0 97 | xboxEnablePIXSampling: 0 98 | metalFramebufferOnly: 0 99 | n3dsDisableStereoscopicView: 0 100 | n3dsEnableSharedListOpt: 1 101 | n3dsEnableVSync: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOnePresentImmediateThreshold: 0 109 | switchQueueCommandMemory: 0 110 | videoMemoryForVertexBuffers: 0 111 | psp2PowerMode: 0 112 | psp2AcquireBGM: 1 113 | vulkanEnableSetSRGBWrite: 0 114 | vulkanUseSWCommandBuffers: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 1 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | enableVideoLayer: 0 136 | useProtectedVideoMemory: 0 137 | minimumSupportedHeadTracking: 0 138 | maximumSupportedHeadTracking: 1 139 | hololens: 140 | depthFormat: 1 141 | depthBufferSharingEnabled: 0 142 | oculus: 143 | sharedDepthBuffer: 0 144 | dashSupport: 0 145 | enable360StereoCapture: 0 146 | protectGraphicsMemory: 0 147 | useHDRDisplay: 0 148 | m_ColorGamuts: 00000000 149 | targetPixelDensity: 30 150 | resolutionScalingMode: 0 151 | androidSupportedAspectRatio: 1 152 | androidMaxAspectRatio: 2.1 153 | applicationIdentifier: {} 154 | buildNumber: {} 155 | AndroidBundleVersionCode: 1 156 | AndroidMinSdkVersion: 16 157 | AndroidTargetSdkVersion: 0 158 | AndroidPreferredInstallLocation: 1 159 | aotOptions: 160 | stripEngineCode: 1 161 | iPhoneStrippingLevel: 0 162 | iPhoneScriptCallOptimization: 0 163 | ForceInternetPermission: 0 164 | ForceSDCardPermission: 0 165 | CreateWallpaper: 0 166 | APKExpansionFiles: 0 167 | keepLoadedShadersAlive: 0 168 | StripUnusedMeshComponents: 0 169 | VertexChannelCompressionMask: 4054 170 | iPhoneSdkVersion: 988 171 | iOSTargetOSVersionString: 8.0 172 | tvOSSdkVersion: 0 173 | tvOSRequireExtendedGameController: 0 174 | tvOSTargetOSVersionString: 9.0 175 | uIPrerenderedIcon: 0 176 | uIRequiresPersistentWiFi: 0 177 | uIRequiresFullScreen: 1 178 | uIStatusBarHidden: 1 179 | uIExitOnSuspend: 0 180 | uIStatusBarStyle: 0 181 | iPhoneSplashScreen: {fileID: 0} 182 | iPhoneHighResSplashScreen: {fileID: 0} 183 | iPhoneTallHighResSplashScreen: {fileID: 0} 184 | iPhone47inSplashScreen: {fileID: 0} 185 | iPhone55inPortraitSplashScreen: {fileID: 0} 186 | iPhone55inLandscapeSplashScreen: {fileID: 0} 187 | iPhone58inPortraitSplashScreen: {fileID: 0} 188 | iPhone58inLandscapeSplashScreen: {fileID: 0} 189 | iPadPortraitSplashScreen: {fileID: 0} 190 | iPadHighResPortraitSplashScreen: {fileID: 0} 191 | iPadLandscapeSplashScreen: {fileID: 0} 192 | iPadHighResLandscapeSplashScreen: {fileID: 0} 193 | appleTVSplashScreen: {fileID: 0} 194 | appleTVSplashScreen2x: {fileID: 0} 195 | tvOSSmallIconLayers: [] 196 | tvOSSmallIconLayers2x: [] 197 | tvOSLargeIconLayers: [] 198 | tvOSLargeIconLayers2x: [] 199 | tvOSTopShelfImageLayers: [] 200 | tvOSTopShelfImageLayers2x: [] 201 | tvOSTopShelfImageWideLayers: [] 202 | tvOSTopShelfImageWideLayers2x: [] 203 | iOSLaunchScreenType: 0 204 | iOSLaunchScreenPortrait: {fileID: 0} 205 | iOSLaunchScreenLandscape: {fileID: 0} 206 | iOSLaunchScreenBackgroundColor: 207 | serializedVersion: 2 208 | rgba: 0 209 | iOSLaunchScreenFillPct: 100 210 | iOSLaunchScreenSize: 100 211 | iOSLaunchScreenCustomXibPath: 212 | iOSLaunchScreeniPadType: 0 213 | iOSLaunchScreeniPadImage: {fileID: 0} 214 | iOSLaunchScreeniPadBackgroundColor: 215 | serializedVersion: 2 216 | rgba: 0 217 | iOSLaunchScreeniPadFillPct: 100 218 | iOSLaunchScreeniPadSize: 100 219 | iOSLaunchScreeniPadCustomXibPath: 220 | iOSUseLaunchScreenStoryboard: 0 221 | iOSLaunchScreenCustomStoryboardPath: 222 | iOSDeviceRequirements: [] 223 | iOSURLSchemes: [] 224 | iOSBackgroundModes: 0 225 | iOSMetalForceHardShadows: 0 226 | metalEditorSupport: 1 227 | metalAPIValidation: 1 228 | iOSRenderExtraFrameOnPause: 0 229 | appleDeveloperTeamID: 230 | iOSManualSigningProvisioningProfileID: 231 | tvOSManualSigningProvisioningProfileID: 232 | iOSManualSigningProvisioningProfileType: 0 233 | tvOSManualSigningProvisioningProfileType: 0 234 | appleEnableAutomaticSigning: 0 235 | iOSRequireARKit: 0 236 | appleEnableProMotion: 0 237 | vulkanEditorSupport: 0 238 | clonedFromGUID: 00000000000000000000000000000000 239 | templatePackageId: 240 | templateDefaultScene: 241 | AndroidTargetArchitectures: 1 242 | AndroidSplashScreenScale: 0 243 | androidSplashScreen: {fileID: 0} 244 | AndroidKeystoreName: 245 | AndroidKeyaliasName: 246 | AndroidBuildApkPerCpuArchitecture: 0 247 | AndroidTVCompatibility: 1 248 | AndroidIsGame: 1 249 | AndroidEnableTango: 0 250 | androidEnableBanner: 1 251 | androidUseLowAccuracyLocation: 0 252 | m_AndroidBanners: 253 | - width: 320 254 | height: 180 255 | banner: {fileID: 0} 256 | androidGamepadSupportLevel: 0 257 | resolutionDialogBanner: {fileID: 0} 258 | m_BuildTargetIcons: [] 259 | m_BuildTargetPlatformIcons: [] 260 | m_BuildTargetBatching: [] 261 | m_BuildTargetGraphicsAPIs: [] 262 | m_BuildTargetVRSettings: [] 263 | m_BuildTargetEnableVuforiaSettings: [] 264 | openGLRequireES31: 0 265 | openGLRequireES31AEP: 0 266 | m_TemplateCustomTags: {} 267 | mobileMTRendering: 268 | Android: 1 269 | iPhone: 1 270 | tvOS: 1 271 | m_BuildTargetGroupLightmapEncodingQuality: [] 272 | m_BuildTargetGroupLightmapSettings: [] 273 | playModeTestRunnerEnabled: 0 274 | runPlayModeTestAsEditModeTest: 0 275 | actionOnDotNetUnhandledException: 1 276 | enableInternalProfiler: 0 277 | logObjCUncaughtExceptions: 1 278 | enableCrashReportAPI: 0 279 | cameraUsageDescription: 280 | locationUsageDescription: 281 | microphoneUsageDescription: 282 | switchNetLibKey: 283 | switchSocketMemoryPoolSize: 6144 284 | switchSocketAllocatorPoolSize: 128 285 | switchSocketConcurrencyLimit: 14 286 | switchScreenResolutionBehavior: 2 287 | switchUseCPUProfiler: 0 288 | switchApplicationID: 0x01004b9000490000 289 | switchNSODependencies: 290 | switchTitleNames_0: 291 | switchTitleNames_1: 292 | switchTitleNames_2: 293 | switchTitleNames_3: 294 | switchTitleNames_4: 295 | switchTitleNames_5: 296 | switchTitleNames_6: 297 | switchTitleNames_7: 298 | switchTitleNames_8: 299 | switchTitleNames_9: 300 | switchTitleNames_10: 301 | switchTitleNames_11: 302 | switchTitleNames_12: 303 | switchTitleNames_13: 304 | switchTitleNames_14: 305 | switchPublisherNames_0: 306 | switchPublisherNames_1: 307 | switchPublisherNames_2: 308 | switchPublisherNames_3: 309 | switchPublisherNames_4: 310 | switchPublisherNames_5: 311 | switchPublisherNames_6: 312 | switchPublisherNames_7: 313 | switchPublisherNames_8: 314 | switchPublisherNames_9: 315 | switchPublisherNames_10: 316 | switchPublisherNames_11: 317 | switchPublisherNames_12: 318 | switchPublisherNames_13: 319 | switchPublisherNames_14: 320 | switchIcons_0: {fileID: 0} 321 | switchIcons_1: {fileID: 0} 322 | switchIcons_2: {fileID: 0} 323 | switchIcons_3: {fileID: 0} 324 | switchIcons_4: {fileID: 0} 325 | switchIcons_5: {fileID: 0} 326 | switchIcons_6: {fileID: 0} 327 | switchIcons_7: {fileID: 0} 328 | switchIcons_8: {fileID: 0} 329 | switchIcons_9: {fileID: 0} 330 | switchIcons_10: {fileID: 0} 331 | switchIcons_11: {fileID: 0} 332 | switchIcons_12: {fileID: 0} 333 | switchIcons_13: {fileID: 0} 334 | switchIcons_14: {fileID: 0} 335 | switchSmallIcons_0: {fileID: 0} 336 | switchSmallIcons_1: {fileID: 0} 337 | switchSmallIcons_2: {fileID: 0} 338 | switchSmallIcons_3: {fileID: 0} 339 | switchSmallIcons_4: {fileID: 0} 340 | switchSmallIcons_5: {fileID: 0} 341 | switchSmallIcons_6: {fileID: 0} 342 | switchSmallIcons_7: {fileID: 0} 343 | switchSmallIcons_8: {fileID: 0} 344 | switchSmallIcons_9: {fileID: 0} 345 | switchSmallIcons_10: {fileID: 0} 346 | switchSmallIcons_11: {fileID: 0} 347 | switchSmallIcons_12: {fileID: 0} 348 | switchSmallIcons_13: {fileID: 0} 349 | switchSmallIcons_14: {fileID: 0} 350 | switchManualHTML: 351 | switchAccessibleURLs: 352 | switchLegalInformation: 353 | switchMainThreadStackSize: 1048576 354 | switchPresenceGroupId: 355 | switchLogoHandling: 0 356 | switchReleaseVersion: 0 357 | switchDisplayVersion: 1.0.0 358 | switchStartupUserAccount: 0 359 | switchTouchScreenUsage: 0 360 | switchSupportedLanguagesMask: 0 361 | switchLogoType: 0 362 | switchApplicationErrorCodeCategory: 363 | switchUserAccountSaveDataSize: 0 364 | switchUserAccountSaveDataJournalSize: 0 365 | switchApplicationAttribute: 0 366 | switchCardSpecSize: -1 367 | switchCardSpecClock: -1 368 | switchRatingsMask: 0 369 | switchRatingsInt_0: 0 370 | switchRatingsInt_1: 0 371 | switchRatingsInt_2: 0 372 | switchRatingsInt_3: 0 373 | switchRatingsInt_4: 0 374 | switchRatingsInt_5: 0 375 | switchRatingsInt_6: 0 376 | switchRatingsInt_7: 0 377 | switchRatingsInt_8: 0 378 | switchRatingsInt_9: 0 379 | switchRatingsInt_10: 0 380 | switchRatingsInt_11: 0 381 | switchLocalCommunicationIds_0: 382 | switchLocalCommunicationIds_1: 383 | switchLocalCommunicationIds_2: 384 | switchLocalCommunicationIds_3: 385 | switchLocalCommunicationIds_4: 386 | switchLocalCommunicationIds_5: 387 | switchLocalCommunicationIds_6: 388 | switchLocalCommunicationIds_7: 389 | switchParentalControl: 0 390 | switchAllowsScreenshot: 1 391 | switchAllowsVideoCapturing: 1 392 | switchAllowsRuntimeAddOnContentInstall: 0 393 | switchDataLossConfirmation: 0 394 | switchSupportedNpadStyles: 3 395 | switchNativeFsCacheSize: 32 396 | switchIsHoldTypeHorizontal: 0 397 | switchSupportedNpadCount: 8 398 | switchSocketConfigEnabled: 0 399 | switchTcpInitialSendBufferSize: 32 400 | switchTcpInitialReceiveBufferSize: 64 401 | switchTcpAutoSendBufferSizeMax: 256 402 | switchTcpAutoReceiveBufferSizeMax: 256 403 | switchUdpSendBufferSize: 9 404 | switchUdpReceiveBufferSize: 42 405 | switchSocketBufferEfficiency: 4 406 | switchSocketInitializeEnabled: 1 407 | switchNetworkInterfaceManagerInitializeEnabled: 1 408 | switchPlayerConnectionEnabled: 1 409 | ps4NPAgeRating: 12 410 | ps4NPTitleSecret: 411 | ps4NPTrophyPackPath: 412 | ps4ParentalLevel: 11 413 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 414 | ps4Category: 0 415 | ps4MasterVersion: 01.00 416 | ps4AppVersion: 01.00 417 | ps4AppType: 0 418 | ps4ParamSfxPath: 419 | ps4VideoOutPixelFormat: 0 420 | ps4VideoOutInitialWidth: 1920 421 | ps4VideoOutBaseModeInitialWidth: 1920 422 | ps4VideoOutReprojectionRate: 60 423 | ps4PronunciationXMLPath: 424 | ps4PronunciationSIGPath: 425 | ps4BackgroundImagePath: 426 | ps4StartupImagePath: 427 | ps4StartupImagesFolder: 428 | ps4IconImagesFolder: 429 | ps4SaveDataImagePath: 430 | ps4SdkOverride: 431 | ps4BGMPath: 432 | ps4ShareFilePath: 433 | ps4ShareOverlayImagePath: 434 | ps4PrivacyGuardImagePath: 435 | ps4NPtitleDatPath: 436 | ps4RemotePlayKeyAssignment: -1 437 | ps4RemotePlayKeyMappingDir: 438 | ps4PlayTogetherPlayerCount: 0 439 | ps4EnterButtonAssignment: 2 440 | ps4ApplicationParam1: 0 441 | ps4ApplicationParam2: 0 442 | ps4ApplicationParam3: 0 443 | ps4ApplicationParam4: 0 444 | ps4DownloadDataSize: 0 445 | ps4GarlicHeapSize: 2048 446 | ps4ProGarlicHeapSize: 2560 447 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 448 | ps4pnSessions: 1 449 | ps4pnPresence: 1 450 | ps4pnFriends: 1 451 | ps4pnGameCustomData: 1 452 | playerPrefsSupport: 0 453 | enableApplicationExit: 0 454 | restrictedAudioUsageRights: 0 455 | ps4UseResolutionFallback: 0 456 | ps4ReprojectionSupport: 0 457 | ps4UseAudio3dBackend: 0 458 | ps4SocialScreenEnabled: 0 459 | ps4ScriptOptimizationLevel: 2 460 | ps4Audio3dVirtualSpeakerCount: 14 461 | ps4attribCpuUsage: 0 462 | ps4PatchPkgPath: 463 | ps4PatchLatestPkgPath: 464 | ps4PatchChangeinfoPath: 465 | ps4PatchDayOne: 0 466 | ps4attribUserManagement: 0 467 | ps4attribMoveSupport: 0 468 | ps4attrib3DSupport: 0 469 | ps4attribShareSupport: 0 470 | ps4attribExclusiveVR: 0 471 | ps4disableAutoHideSplash: 0 472 | ps4videoRecordingFeaturesUsed: 0 473 | ps4contentSearchFeaturesUsed: 0 474 | ps4attribEyeToEyeDistanceSettingVR: 0 475 | ps4IncludedModules: [] 476 | monoEnv: 477 | psp2Splashimage: {fileID: 0} 478 | psp2NPTrophyPackPath: 479 | psp2NPSupportGBMorGJP: 0 480 | psp2NPAgeRating: 12 481 | psp2NPTitleDatPath: 482 | psp2NPCommsID: 483 | psp2NPCommunicationsID: 484 | psp2NPCommsPassphrase: 485 | psp2NPCommsSig: 486 | psp2ParamSfxPath: 487 | psp2ManualPath: 488 | psp2LiveAreaGatePath: 489 | psp2LiveAreaBackroundPath: 490 | psp2LiveAreaPath: 491 | psp2LiveAreaTrialPath: 492 | psp2PatchChangeInfoPath: 493 | psp2PatchOriginalPackage: 494 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 495 | psp2KeystoneFile: 496 | psp2MemoryExpansionMode: 0 497 | psp2DRMType: 0 498 | psp2StorageType: 0 499 | psp2MediaCapacity: 0 500 | psp2DLCConfigPath: 501 | psp2ThumbnailPath: 502 | psp2BackgroundPath: 503 | psp2SoundPath: 504 | psp2TrophyCommId: 505 | psp2TrophyPackagePath: 506 | psp2PackagedResourcesPath: 507 | psp2SaveDataQuota: 10240 508 | psp2ParentalLevel: 1 509 | psp2ShortTitle: Not Set 510 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 511 | psp2Category: 0 512 | psp2MasterVersion: 01.00 513 | psp2AppVersion: 01.00 514 | psp2TVBootMode: 0 515 | psp2EnterButtonAssignment: 2 516 | psp2TVDisableEmu: 0 517 | psp2AllowTwitterDialog: 1 518 | psp2Upgradable: 0 519 | psp2HealthWarning: 0 520 | psp2UseLibLocation: 0 521 | psp2InfoBarOnStartup: 0 522 | psp2InfoBarColor: 0 523 | psp2ScriptOptimizationLevel: 2 524 | splashScreenBackgroundSourceLandscape: {fileID: 0} 525 | splashScreenBackgroundSourcePortrait: {fileID: 0} 526 | spritePackerPolicy: 527 | webGLMemorySize: 256 528 | webGLExceptionSupport: 1 529 | webGLNameFilesAsHashes: 0 530 | webGLDataCaching: 1 531 | webGLDebugSymbols: 0 532 | webGLEmscriptenArgs: 533 | webGLModulesDirectory: 534 | webGLTemplate: APPLICATION:Default 535 | webGLAnalyzeBuildSize: 0 536 | webGLUseEmbeddedResources: 0 537 | webGLCompressionFormat: 1 538 | webGLLinkerTarget: 1 539 | scriptingDefineSymbols: {} 540 | platformArchitecture: {} 541 | scriptingBackend: {} 542 | il2cppCompilerConfiguration: {} 543 | incrementalIl2cppBuild: {} 544 | allowUnsafeCode: 0 545 | additionalIl2CppArgs: 546 | scriptingRuntimeVersion: 0 547 | apiCompatibilityLevelPerPlatform: {} 548 | m_RenderingPath: 1 549 | m_MobileRenderingPath: 1 550 | metroPackageName: TextInlineSprite 551 | metroPackageVersion: 552 | metroCertificatePath: 553 | metroCertificatePassword: 554 | metroCertificateSubject: 555 | metroCertificateIssuer: 556 | metroCertificateNotAfter: 0000000000000000 557 | metroApplicationDescription: TextInlineSprite 558 | wsaImages: {} 559 | metroTileShortName: 560 | metroTileShowName: 0 561 | metroMediumTileShowName: 0 562 | metroLargeTileShowName: 0 563 | metroWideTileShowName: 0 564 | metroDefaultTileSize: 1 565 | metroTileForegroundText: 2 566 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 567 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 568 | a: 1} 569 | metroSplashScreenUseBackgroundColor: 0 570 | platformCapabilities: {} 571 | metroFTAName: 572 | metroFTAFileTypes: [] 573 | metroProtocolName: 574 | metroCompilationOverrides: 1 575 | n3dsUseExtSaveData: 0 576 | n3dsCompressStaticMem: 1 577 | n3dsExtSaveDataNumber: 0x12345 578 | n3dsStackSize: 131072 579 | n3dsTargetPlatform: 2 580 | n3dsRegion: 7 581 | n3dsMediaSize: 0 582 | n3dsLogoStyle: 3 583 | n3dsTitle: GameName 584 | n3dsProductCode: 585 | n3dsApplicationId: 0xFF3FF 586 | XboxOneProductId: 587 | XboxOneUpdateKey: 588 | XboxOneSandboxId: 589 | XboxOneContentId: 590 | XboxOneTitleId: 591 | XboxOneSCId: 592 | XboxOneGameOsOverridePath: 593 | XboxOnePackagingOverridePath: 594 | XboxOneAppManifestOverridePath: 595 | XboxOneVersion: 1.0.0.0 596 | XboxOnePackageEncryption: 0 597 | XboxOnePackageUpdateGranularity: 2 598 | XboxOneDescription: 599 | XboxOneLanguage: 600 | - enus 601 | XboxOneCapability: [] 602 | XboxOneGameRating: {} 603 | XboxOneIsContentPackage: 0 604 | XboxOneEnableGPUVariability: 1 605 | XboxOneSockets: {} 606 | XboxOneSplashScreen: {fileID: 0} 607 | XboxOneAllowedProductIds: [] 608 | XboxOnePersistentLocalStorageSize: 0 609 | XboxOneXTitleMemory: 8 610 | xboxOneScriptCompiler: 0 611 | vrEditorSettings: 612 | daydream: 613 | daydreamIconForeground: {fileID: 0} 614 | daydreamIconBackground: {fileID: 0} 615 | cloudServicesEnabled: {} 616 | facebookSdkVersion: 7.9.4 617 | apiCompatibilityLevel: 2 618 | cloudProjectId: 619 | projectName: 620 | organizationId: 621 | cloudEnabled: 0 622 | enableNativePlatformBackendsForNewInputSystem: 0 623 | disableOldInputManagerSupport: 0 624 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.2.0f3 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 4 41 | resolutionScalingFixedDPIFactor: 1 42 | excludedTargetPlatforms: [] 43 | - serializedVersion: 2 44 | name: Low 45 | pixelLightCount: 0 46 | shadows: 0 47 | shadowResolution: 0 48 | shadowProjection: 1 49 | shadowCascades: 1 50 | shadowDistance: 20 51 | shadowNearPlaneOffset: 3 52 | shadowCascade2Split: 0.33333334 53 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 54 | shadowmaskMode: 0 55 | blendWeights: 2 56 | textureQuality: 0 57 | anisotropicTextures: 0 58 | antiAliasing: 0 59 | softParticles: 0 60 | softVegetation: 0 61 | realtimeReflectionProbes: 0 62 | billboardsFaceCameraPosition: 0 63 | vSyncCount: 0 64 | lodBias: 0.4 65 | maximumLODLevel: 0 66 | streamingMipmapsActive: 0 67 | streamingMipmapsAddAllCameras: 1 68 | streamingMipmapsMemoryBudget: 512 69 | streamingMipmapsRenderersPerFrame: 512 70 | streamingMipmapsMaxLevelReduction: 2 71 | streamingMipmapsMaxFileIORequests: 1024 72 | particleRaycastBudget: 16 73 | asyncUploadTimeSlice: 2 74 | asyncUploadBufferSize: 4 75 | resolutionScalingFixedDPIFactor: 1 76 | excludedTargetPlatforms: [] 77 | - serializedVersion: 2 78 | name: Medium 79 | pixelLightCount: 1 80 | shadows: 1 81 | shadowResolution: 0 82 | shadowProjection: 1 83 | shadowCascades: 1 84 | shadowDistance: 20 85 | shadowNearPlaneOffset: 3 86 | shadowCascade2Split: 0.33333334 87 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 88 | shadowmaskMode: 0 89 | blendWeights: 2 90 | textureQuality: 0 91 | anisotropicTextures: 1 92 | antiAliasing: 0 93 | softParticles: 0 94 | softVegetation: 0 95 | realtimeReflectionProbes: 0 96 | billboardsFaceCameraPosition: 0 97 | vSyncCount: 1 98 | lodBias: 0.7 99 | maximumLODLevel: 0 100 | streamingMipmapsActive: 0 101 | streamingMipmapsAddAllCameras: 1 102 | streamingMipmapsMemoryBudget: 512 103 | streamingMipmapsRenderersPerFrame: 512 104 | streamingMipmapsMaxLevelReduction: 2 105 | streamingMipmapsMaxFileIORequests: 1024 106 | particleRaycastBudget: 64 107 | asyncUploadTimeSlice: 2 108 | asyncUploadBufferSize: 4 109 | resolutionScalingFixedDPIFactor: 1 110 | excludedTargetPlatforms: [] 111 | - serializedVersion: 2 112 | name: High 113 | pixelLightCount: 2 114 | shadows: 2 115 | shadowResolution: 1 116 | shadowProjection: 1 117 | shadowCascades: 2 118 | shadowDistance: 40 119 | shadowNearPlaneOffset: 3 120 | shadowCascade2Split: 0.33333334 121 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 122 | shadowmaskMode: 1 123 | blendWeights: 2 124 | textureQuality: 0 125 | anisotropicTextures: 1 126 | antiAliasing: 0 127 | softParticles: 0 128 | softVegetation: 1 129 | realtimeReflectionProbes: 1 130 | billboardsFaceCameraPosition: 1 131 | vSyncCount: 1 132 | lodBias: 1 133 | maximumLODLevel: 0 134 | streamingMipmapsActive: 0 135 | streamingMipmapsAddAllCameras: 1 136 | streamingMipmapsMemoryBudget: 512 137 | streamingMipmapsRenderersPerFrame: 512 138 | streamingMipmapsMaxLevelReduction: 2 139 | streamingMipmapsMaxFileIORequests: 1024 140 | particleRaycastBudget: 256 141 | asyncUploadTimeSlice: 2 142 | asyncUploadBufferSize: 4 143 | resolutionScalingFixedDPIFactor: 1 144 | excludedTargetPlatforms: [] 145 | - serializedVersion: 2 146 | name: Very High 147 | pixelLightCount: 3 148 | shadows: 2 149 | shadowResolution: 2 150 | shadowProjection: 1 151 | shadowCascades: 2 152 | shadowDistance: 70 153 | shadowNearPlaneOffset: 3 154 | shadowCascade2Split: 0.33333334 155 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 156 | shadowmaskMode: 1 157 | blendWeights: 4 158 | textureQuality: 0 159 | anisotropicTextures: 2 160 | antiAliasing: 2 161 | softParticles: 1 162 | softVegetation: 1 163 | realtimeReflectionProbes: 1 164 | billboardsFaceCameraPosition: 1 165 | vSyncCount: 1 166 | lodBias: 1.5 167 | maximumLODLevel: 0 168 | streamingMipmapsActive: 0 169 | streamingMipmapsAddAllCameras: 1 170 | streamingMipmapsMemoryBudget: 512 171 | streamingMipmapsRenderersPerFrame: 512 172 | streamingMipmapsMaxLevelReduction: 2 173 | streamingMipmapsMaxFileIORequests: 1024 174 | particleRaycastBudget: 1024 175 | asyncUploadTimeSlice: 2 176 | asyncUploadBufferSize: 4 177 | resolutionScalingFixedDPIFactor: 1 178 | excludedTargetPlatforms: [] 179 | - serializedVersion: 2 180 | name: Ultra 181 | pixelLightCount: 4 182 | shadows: 2 183 | shadowResolution: 2 184 | shadowProjection: 1 185 | shadowCascades: 4 186 | shadowDistance: 150 187 | shadowNearPlaneOffset: 3 188 | shadowCascade2Split: 0.33333334 189 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 190 | shadowmaskMode: 1 191 | blendWeights: 4 192 | textureQuality: 0 193 | anisotropicTextures: 2 194 | antiAliasing: 2 195 | softParticles: 1 196 | softVegetation: 1 197 | realtimeReflectionProbes: 1 198 | billboardsFaceCameraPosition: 1 199 | vSyncCount: 1 200 | lodBias: 2 201 | maximumLODLevel: 0 202 | streamingMipmapsActive: 0 203 | streamingMipmapsAddAllCameras: 1 204 | streamingMipmapsMemoryBudget: 512 205 | streamingMipmapsRenderersPerFrame: 512 206 | streamingMipmapsMaxLevelReduction: 2 207 | streamingMipmapsMaxFileIORequests: 1024 208 | particleRaycastBudget: 4096 209 | asyncUploadTimeSlice: 2 210 | asyncUploadBufferSize: 4 211 | resolutionScalingFixedDPIFactor: 1 212 | excludedTargetPlatforms: [] 213 | m_PerPlatformDefaultQuality: 214 | Android: 2 215 | Nintendo 3DS: 5 216 | Nintendo Switch: 5 217 | PS4: 5 218 | PSP2: 2 219 | Standalone: 5 220 | WebGL: 3 221 | Windows Store Apps: 5 222 | XboxOne: 5 223 | iPhone: 2 224 | tvOS: 2 225 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 1 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /README - 01.md: -------------------------------------------------------------------------------- 1 | ### **功能介绍** 2 | 1. 此插件是基于UGUI所做的图文混排功能,常用于聊天系统的表情嵌入; 3 | 2. 可支持静/动态表情,支持超链接; 4 | 3. 实现原理,是基于UGUI的富文本,使用quad标签进行占位; 5 | 4. 使用了Asset文件来存储本地的表情信息; 6 | 5. Text根据正则表达式,解析文本,读取相应的表情信息,并在相应位置绘制相应的Sprite; 7 | 6. 正则表达式为[图集ID#表情标签],图集ID为-ID时,表示此标签为超链接,如-1,图集ID为0时,可省略不写; 8 | 7. 有同学提过想支持移动端系统自带的表情,我这里只提一个简单的实现思路,集成不看自己的实际需求了,自己备好系统表情的图集,再解析一下当前系统输入表情的正则表达式,然后跟插件一样的嵌入到Text中(这算是正常的集成实现思路么?); 9 | --- 10 | ### **使用步骤** 11 | 1. 选择一张表情图片,导入在unity里,并设置为Texture Type为Sprite(2D and UI); 12 | 2. 右键选择图片,点击Create/Sprite Asset,创建图集资源; 13 | 3. 针对Asset文件,可以设置图集的ID、是否为静态表情,和标签等属性,同为一个动态表情的Sprite应该设置为同一个标签; 14 | 4. 点击菜单栏GameObject/UI/Textline,即可创建UI; 15 | 5. 在InlineText组件中输入[#emoji_0],即可显示表情; 16 | --- 17 | ### **截图展示** 18 | ![ 标签对应表情](https://github.com/coding2233/TextInlineSprite/blob/master/ShotScreens/tw04_01.gif) 19 | ![聊天示例](https://github.com/coding2233/TextInlineSprite/blob/master/ShotScreens/tw04_02.gif) 20 | ![更新后,功能展示](https://github.com/coding2233/TextInlineSprite/blob/master/ShotScreens/text01.gif) 21 | ![更新后,聊天测试](https://github.com/coding2233/TextInlineSprite/blob/master/ShotScreens/text02.jpg) 22 | --- 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### **2020-01-27** 2 | 0. 支持`unity2019+` 3 | 1. `unity2019`的文本的模型数据有所改动,具体的计算代码在c++代码底层,没有追踪到具体的信息,暂时测试出来的信息,如果Text文本,长度足够自动换行,模型顶点的数据信息跟`unity2017`一样,如果长度保持在一行以内或者手动换行,`unity2019`会不再计算`富文本标签`的顶点信息,所以需要手动替换`富文本标签`。 4 | 2. 替换富文本示例`(InlineText :429)`: 5 | ```csharp 6 | //换掉富文本 7 | private string ReplaceRichText(string str) 8 | { 9 | str = Regex.Replace(str, @"", ""); 10 | str = str.Replace("", ""); 11 | str = str.Replace("", ""); 12 | str = str.Replace("", ""); 13 | str = str.Replace("", ""); 14 | str = str.Replace("", ""); 15 | str = str.Replace("\n", ""); 16 | str = str.Replace("\t", ""); 17 | str = str.Replace("\r", ""); 18 | str = str.Replace(" ", ""); 19 | 20 | return str; 21 | } 22 | ``` 23 | 3. 如果使用中,有多余的`富文本标签`,建议自己在上述代码中添加/修改。 24 | 4. `unity2019`的底层更改,增加了此插件不少必要的计算,导致维护难度上升不少,尽是一些吃力不讨好的事,坐等下次大更新。 25 | 26 | --- 27 | 28 | ### **新增功能** 29 | 0. 重写了配置文件编辑工具,可快速生成表情配置文件 30 | 1. 使用shader渲染表情动画,取消了在update中循环更新模型数据 31 | 2. 支持在编辑器中直接预览(支持不完全) 32 | 3. 在编辑中增加了线框辅助调试 33 | 4. 利用了对象池对部分比较明显的GC问题进行了优化 34 | 5. 重新更换了坐标系转换的计算,更好的支持Canvas Render Mode的切换 35 | 6. 精简整理了代码 36 | 7. 简单优化了编辑器的操作 37 | 38 | --- 39 | 40 | ### **强行解释** 41 | 0. 性能优化会在后面持续进行 42 | 1. 利用shader渲染表情动画,可以更好的利用设备的性能。一开始是准备利用UGUI的Mesh支持uv0-uv3,存下多个数据,来做表情动画。在使用了uv移动来做动画后,感觉uv0-uv3四层不够用,于是坚持老方法。 43 | 2. 在选择使用uv移动来做动画,对表情图集有一定的要求:建议每个表情的规格一致,动态表情需要放成一排。具体参考demo自带图集。 44 | 3. 现在所有的参数都已经在配置文件中, 请根据需求自行调整。 45 | 4. 之前也提过,写这个插件并没有实际的使用机会,难免考虑不周,收集的意见,大部分都有自己的想法,比较杂乱,所以建议如果能直接使用,那是最好的。如果跟自己的需求有偏差,希望能作个参考,自己更改,欢迎提交pr。然后我会再尽力写成通用的。 46 | 5. 提交的pr,改动小,我会检查合并,如果改动太大,我会单独新建分支留存,以便有需要的人查看。 47 | 48 | --- 49 | 50 | ### **功能介绍** 51 | 1. 此插件是基于UGUI所做的图文混排功能,常用于聊天系统的表情嵌入; 52 | 2. 可支持静/动态表情,支持超链接; 53 | 3. 实现原理,是基于UGUI的富文本,使用quad标签进行占位; 54 | 4. 使用了Asset文件来存储本地的表情信息; 55 | 5. Text根据正则表达式,解析文本,读取相应的表情信息,并在相应位置绘制相应的Sprite; 56 | 6. 正则表达式为[图集ID#表情标签],图集ID为-ID时,表示此标签为超链接,如-1,图集ID为 0时,可省略不写; 57 | 7. 有同学提过想支持移动端系统自带的表情,我这里只提一个简单的实现思路,集成不看自己的实际需求了,自己备好系统表情的图集,再解析一下当前系统输入表情的正则表达式,然后跟插件一样的嵌入到Text中(这算是正常的集成实现思路么?); 58 | --- 59 | ### **使用步骤** 60 | 1. 选择一张表情图片,导入在unity里,为了支持透明通道,记得在图片属性中勾选`Alpha Is Transparent` 61 | 2. 右键选择图片,点击`Create/Sprite Asset`,打开资源窗口编辑器,点击`Save`来保存配置文件 62 | ![](ShotScreens/editor_01.png) 63 | 3. 在保存配置文件后,首先为图集设置一个唯一Id,然后设置图集表情的行列数,来自动切分表情,动态表情会自动将一排的Sprite自动归纳为一个表情,最后为每个表情设置一个可读的Tag,后续提供给Text调用。 64 | ![](ShotScreens/editor_02.png) 65 | 4. 配置文件创建完成后,在编辑器中,也可以预览,操作与资源窗口编辑器类型,并且点击`Open Asset Window`也可以打开编辑器窗口 66 | ![](ShotScreens/editor_03.png) 67 | 5. 文字使用方式,参考demo场景'Text',输入`NewText[1#rock]`即可显示表情 68 | 69 | --- 70 | 71 | ### **截图展示** 72 | ![ 标签对应表情](ShotScreens/tw04_01.gif) 73 | ![聊天示例](ShotScreens/tw05_01.gif) 74 | ![更新后,功能展示](ShotScreens/tw05_00.png) 75 | -------------------------------------------------------------------------------- /ShotScreens/editor_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/editor_01.png -------------------------------------------------------------------------------- /ShotScreens/editor_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/editor_02.png -------------------------------------------------------------------------------- /ShotScreens/editor_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/editor_03.png -------------------------------------------------------------------------------- /ShotScreens/text01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/text01.gif -------------------------------------------------------------------------------- /ShotScreens/text02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/text02.jpg -------------------------------------------------------------------------------- /ShotScreens/tw04_01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/tw04_01.gif -------------------------------------------------------------------------------- /ShotScreens/tw04_02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/tw04_02.gif -------------------------------------------------------------------------------- /ShotScreens/tw04_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/tw04_03.png -------------------------------------------------------------------------------- /ShotScreens/tw05_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/tw05_00.png -------------------------------------------------------------------------------- /ShotScreens/tw05_01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/ShotScreens/tw05_01.gif -------------------------------------------------------------------------------- /UnityPackageManager/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/obj/Debug/Assembly-CSharp-Editor.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding2233/TextInlineSprite/469e6f4939a77fd12b903fbe2a20531f44fc701b/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache --------------------------------------------------------------------------------