├── .gitignore ├── Assets ├── Editor.meta ├── Editor │ ├── EmojiBuilder.cs │ └── EmojiBuilder.cs.meta ├── Emoji.meta ├── Emoji │ ├── Input.meta │ ├── Input │ │ ├── dizzy_1.png │ │ ├── dizzy_1.png.meta │ │ ├── dizzy_2.png │ │ ├── dizzy_2.png.meta │ │ ├── dizzy_3.png │ │ ├── dizzy_3.png.meta │ │ ├── dizzy_4.png │ │ ├── dizzy_4.png.meta │ │ ├── kiss_1.png │ │ ├── kiss_1.png.meta │ │ ├── kiss_2.png │ │ ├── kiss_2.png.meta │ │ ├── kiss_3.png │ │ ├── kiss_3.png.meta │ │ ├── kiss_4.png │ │ ├── kiss_4.png.meta │ │ ├── kiss_5.png │ │ ├── kiss_5.png.meta │ │ ├── kiss_6.png │ │ ├── kiss_6.png.meta │ │ ├── smile.png │ │ └── smile.png.meta │ ├── Output.meta │ └── Output │ │ ├── emoji.txt │ │ ├── emoji.txt.meta │ │ ├── emoji_data.png │ │ ├── emoji_data.png.meta │ │ ├── emoji_tex.png │ │ └── emoji_tex.png.meta ├── Material.meta ├── Material │ ├── UGUIEmoji.mat │ └── UGUIEmoji.mat.meta ├── Resources.meta ├── Resources │ ├── emoji.txt │ └── emoji.txt.meta ├── Scenes.meta ├── Scenes │ ├── Main.unity │ └── Main.unity.meta ├── Scripts.meta ├── Scripts │ ├── EmojiText.cs │ └── EmojiText.cs.meta ├── Shader.meta └── Shader │ ├── UI-EmojiFont.shader │ └── UI-EmojiFont.shader.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.csproj 3 | *.userprefs 4 | Library 5 | Temp 6 | *.sln 7 | .vs 8 | obj 9 | Logs -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a57bd8213452ba24ab5b93cc9d62fb15 3 | folderAsset: yes 4 | timeCreated: 1453127194 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/EmojiBuilder.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Description:Create the Atlas of emojis and its data texture. 4 | 5 | How to use? 6 | 1) 7 | Put all emojies in Asset/Framework/Resource/Emoji/Input. 8 | Multi-frame emoji name format : Name_Index.png , Single frame emoji format: Name.png 9 | 2) 10 | Excute EmojiText->Build Emoji from menu in Unity. 11 | 3) 12 | It will outputs two textures and a txt in Emoji/Output. 13 | Drag emoji_tex to "Emoji Texture" and emoji_data to "Emoji Data" in UGUIEmoji material. 14 | 4) 15 | Repair the value of "Emoji count of every line" base on emoji_tex.png. 16 | 5) 17 | It will auto copys emoji.txt to Resources, and you can overwrite relevant functions base on your project. 18 | 19 | Author:zouchunyi 20 | E-mail:zouchunyi@kingsoft.com 21 | */ 22 | 23 | using UnityEngine; 24 | using UnityEditor; 25 | using System.Collections; 26 | using System.Collections.Generic; 27 | using System.IO; 28 | 29 | public class EmojiBuilder { 30 | 31 | private const string OutputPath = "Assets/Emoji/Output/"; 32 | private const string InputPath = "/Emoji/Input/"; 33 | 34 | private static readonly Vector2[] AtlasSize = new Vector2[]{ 35 | new Vector2(32,32), 36 | new Vector2(64,64), 37 | new Vector2(128,128), 38 | new Vector2(256,256), 39 | new Vector2(512,512), 40 | new Vector2(1024,1024), 41 | new Vector2(2048,2048) 42 | }; 43 | 44 | struct EmojiInfo 45 | { 46 | public string key; 47 | public string x; 48 | public string y; 49 | public string size; 50 | } 51 | private const int EmojiSize = 32;//the size of emoji. 52 | 53 | [MenuItem("EmojiText/Build Emoji")] 54 | public static void BuildEmoji() 55 | { 56 | // List keylist = new List (); 57 | // for(int i = 0; i<100; i++) 58 | // { 59 | // keylist.Add(i.ToString()); 60 | // } 61 | // for (int i = 48; i <= 57; i++) { 62 | // keylist.Add (System.Convert.ToChar(i));//0-9 63 | // } 64 | // for (int i = 65; i <= 90; i++) { 65 | // keylist.Add (System.Convert.ToChar(i));//A-Z 66 | // } 67 | // for (int i = 97; i <= 122; i++) { 68 | // keylist.Add (System.Convert.ToChar(i));//a-z 69 | // } 70 | 71 | //search all emojis and compute they frames. 72 | Dictionary sourceDic = new Dictionary (); 73 | string[] files = Directory.GetFiles (Application.dataPath + InputPath,"*.png"); 74 | for (int i = 0; i < files.Length; i++) { 75 | string[] strs = files [i].Split ('/'); 76 | string[] strs2 = strs [strs.Length - 1].Split ('.'); 77 | string filename = strs2 [0]; 78 | 79 | string[] t = filename.Split('_'); 80 | string id = t [0]; 81 | if (sourceDic.ContainsKey(id)) { 82 | sourceDic[id]++; 83 | } else { 84 | sourceDic.Add (id, 1); 85 | } 86 | } 87 | 88 | //create the directory if it is not exist. 89 | if (!Directory.Exists (OutputPath)) { 90 | Directory.CreateDirectory (OutputPath); 91 | } 92 | 93 | Dictionary emojiDic = new Dictionary (); 94 | 95 | int totalFrames = 0; 96 | foreach (int value in sourceDic.Values) { 97 | totalFrames += value; 98 | } 99 | Vector2 texSize = ComputeAtlasSize (totalFrames); 100 | Texture2D newTex = new Texture2D ((int)texSize.x, (int)texSize.y, TextureFormat.ARGB32, false); 101 | Texture2D dataTex = new Texture2D ((int)texSize.x / EmojiSize, (int)texSize.y / EmojiSize, TextureFormat.ARGB32, false); 102 | int x = 0; 103 | int y = 0; 104 | int keyindex = 0; 105 | foreach (string key in sourceDic.Keys) { 106 | 107 | for (int index = 0; index < sourceDic[key]; index++) { 108 | 109 | string path = "Assets" + InputPath + key; 110 | if (sourceDic[key] == 1) { 111 | path += ".png"; 112 | } else { 113 | path += "_" + (index + 1).ToString() + ".png"; 114 | } 115 | 116 | Texture2D asset = AssetDatabase.LoadAssetAtPath (path); 117 | Color[] colors = asset.GetPixels (0); 118 | 119 | for (int i = 0; i < EmojiSize; i++) { 120 | for (int j = 0; j < EmojiSize; j++) { 121 | newTex.SetPixel (x + i, y + j, colors [i + j * EmojiSize]); 122 | } 123 | } 124 | 125 | string t = System.Convert.ToString (sourceDic [key] - 1, 2); 126 | float r = 0, g = 0, b = 0; 127 | if (t.Length >= 3) { 128 | r = t [2] == '1' ? 0.5f : 0; 129 | g = t [1] == '1' ? 0.5f : 0; 130 | b = t [0] == '1' ? 0.5f : 0; 131 | } else if (t.Length >= 2) { 132 | r = t [1] == '1' ? 0.5f : 0; 133 | g = t [0] == '1' ? 0.5f : 0; 134 | } else { 135 | r = t [0] == '1' ? 0.5f : 0; 136 | } 137 | 138 | dataTex.SetPixel (x / EmojiSize, y / EmojiSize, new Color (r, g, b, 1)); 139 | 140 | if (! emojiDic.ContainsKey (key)) { 141 | EmojiInfo info; 142 | // if (keyindex < keylist.Count) 143 | // { 144 | // info.key = "[" + char.ToString(keylist[keyindex]) + "]"; 145 | // }else 146 | // { 147 | // info.key = "[" + char.ToString(keylist[keyindex / keylist.Count]) + char.ToString(keylist[keyindex % keylist.Count]) + "]"; 148 | // } 149 | info.key = "[" + keyindex + "]"; 150 | info.x = (x * 1.0f / texSize.x).ToString(); 151 | info.y = (y * 1.0f / texSize.y).ToString(); 152 | info.size = (EmojiSize * 1.0f / texSize.x).ToString (); 153 | 154 | emojiDic.Add (key, info); 155 | keyindex ++; 156 | } 157 | 158 | x += EmojiSize; 159 | if (x >= texSize.x) { 160 | x = 0; 161 | y += EmojiSize; 162 | } 163 | } 164 | } 165 | 166 | byte[] bytes1 = newTex.EncodeToPNG (); 167 | string outputfile1 = OutputPath + "emoji_tex.png"; 168 | File.WriteAllBytes (outputfile1, bytes1); 169 | 170 | byte[] bytes2 = dataTex.EncodeToPNG (); 171 | string outputfile2 = OutputPath + "emoji_data.png"; 172 | File.WriteAllBytes (outputfile2, bytes2); 173 | 174 | using (StreamWriter sw = new StreamWriter (OutputPath + "emoji.txt",false)) { 175 | sw.WriteLine ("Name\tKey\tFrames\tX\tY\tSize"); 176 | foreach (string key in emojiDic.Keys) { 177 | sw.WriteLine ("{" + key + "}\t" + emojiDic[key].key + "\t" + sourceDic[key] + "\t" + emojiDic[key].x + "\t" + emojiDic[key].y + "\t" + emojiDic[key].size); 178 | } 179 | sw.Close (); 180 | } 181 | 182 | File.Copy (OutputPath + "emoji.txt","Assets/Resources/emoji.txt",true); 183 | 184 | AssetDatabase.Refresh (); 185 | FormatTexture (); 186 | 187 | EditorUtility.DisplayDialog ("Success", "Generate Emoji Successful!", "OK"); 188 | } 189 | 190 | private static Vector2 ComputeAtlasSize(int count) 191 | { 192 | long total = count * EmojiSize * EmojiSize; 193 | for (int i = 0; i < AtlasSize.Length; i++) { 194 | if (total <= AtlasSize [i].x * AtlasSize [i].y) { 195 | return AtlasSize [i]; 196 | } 197 | } 198 | return Vector2.zero; 199 | } 200 | 201 | private static void FormatTexture() { 202 | TextureImporter emojiTex = AssetImporter.GetAtPath (OutputPath + "emoji_tex.png") as TextureImporter; 203 | emojiTex.filterMode = FilterMode.Point; 204 | emojiTex.mipmapEnabled = false; 205 | emojiTex.sRGBTexture = true; 206 | emojiTex.alphaSource = TextureImporterAlphaSource.FromInput; 207 | emojiTex.textureCompression = TextureImporterCompression.Uncompressed; 208 | emojiTex.SaveAndReimport (); 209 | 210 | TextureImporter emojiData = AssetImporter.GetAtPath (OutputPath + "emoji_data.png") as TextureImporter; 211 | emojiData.filterMode = FilterMode.Point; 212 | emojiData.mipmapEnabled = false; 213 | emojiData.sRGBTexture = false; 214 | emojiData.alphaSource = TextureImporterAlphaSource.None; 215 | emojiData.textureCompression = TextureImporterCompression.Uncompressed; 216 | emojiData.SaveAndReimport (); 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /Assets/Editor/EmojiBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf8dacb1bd242cf4a9b72bf11135009f 3 | timeCreated: 1475218758 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/Emoji.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac8a81125fcdb66438f1d5137bc16c8f 3 | folderAsset: yes 4 | timeCreated: 1477293301 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Emoji/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62a6b56fa67368c4187293f6941adb4b 3 | folderAsset: yes 4 | timeCreated: 1477298321 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/dizzy_1.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a72eaddb640391e4385a7531b660dc33 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/dizzy_2.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc80b9b87b4b7cd44825838faec355f3 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/dizzy_3.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_3.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 481124a778fbd7f4282eb0e3df31a4fa 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/dizzy_4.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/dizzy_4.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3c8da28896443e4e9a620bf6ab87b2b 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_1.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02a20dad1367adc45b2309c772a8ed39 3 | timeCreated: 1477293307 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_2.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d176a9f4a805cd4bad69cd17d4040db 3 | timeCreated: 1477293307 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_3.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_3.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16337ce2817ea3845bf1e435fcfba5e6 3 | timeCreated: 1477293307 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_4.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_4.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4cabedf87fe21348a065cb2baa8af30 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_5.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_5.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13c468a274ea467409b1d8926ad4a957 3 | timeCreated: 1477293307 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/kiss_6.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/kiss_6.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f499c383eb8031943bfb4f11790a6989 3 | timeCreated: 1477293310 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Input/smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Input/smile.png -------------------------------------------------------------------------------- /Assets/Emoji/Input/smile.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8853cb0cb0816a54f8dea2e7aa524c85 3 | timeCreated: 1477293308 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 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: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: 5 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Emoji/Output.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54df0c24467f06e489650781588f1073 3 | folderAsset: yes 4 | timeCreated: 1477298337 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji.txt: -------------------------------------------------------------------------------- 1 | Name Key Frames X Y Size 2 | {dizzy} [0] 4 0 0 0.25 3 | {kiss} [1] 6 0 0.25 0.25 4 | {smile} [2] 1 0.5 0.5 0.25 5 | -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 520be482e1142d9418c26f9804726ce7 3 | timeCreated: 1502958228 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Output/emoji_data.png -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji_data.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df4d04d3192c4ba4eb339f11806b3798 3 | timeCreated: 1502958901 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 5 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 0 34 | aniso: 16 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 100 42 | spriteMode: 1 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 0 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 8 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 0 62 | compressionQuality: 100 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 0 70 | compressionQuality: 100 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: iPhone 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 0 78 | compressionQuality: 100 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: Android 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 0 86 | compressionQuality: 100 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji_tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Emoji/Output/emoji_tex.png -------------------------------------------------------------------------------- /Assets/Emoji/Output/emoji_tex.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50012eb723662994dbd6261d0b95d2d7 3 | timeCreated: 1502958229 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 0 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 1 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 8 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | spriteSheet: 67 | serializedVersion: 2 68 | sprites: [] 69 | outline: [] 70 | physicsShape: [] 71 | spritePackingTag: 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Assets/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9106017b329ecc741b870ba7835349be 3 | folderAsset: yes 4 | timeCreated: 1476881488 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Material/UGUIEmoji.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Material/UGUIEmoji.mat -------------------------------------------------------------------------------- /Assets/Material/UGUIEmoji.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea02a8c7a6993804d9e33066bf140fba 3 | timeCreated: 1477882219 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd3894fd0d5c7144192f49372c32278a 3 | folderAsset: yes 4 | timeCreated: 1502848101 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/emoji.txt: -------------------------------------------------------------------------------- 1 | Name Key Frames X Y Size 2 | {dizzy} [0] 4 0 0 0.25 3 | {kiss} [1] 6 0 0.25 0.25 4 | {smile} [2] 1 0.5 0.5 0.25 5 | -------------------------------------------------------------------------------- /Assets/Resources/emoji.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3983d29bed298124f8766ae559684f18 3 | timeCreated: 1478004082 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8469c6de8fcb76f4ebd31950a93956c7 3 | folderAsset: yes 4 | timeCreated: 1471502106 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/Assets/Scenes/Main.unity -------------------------------------------------------------------------------- /Assets/Scenes/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1239d02057d721242b0b76a94291d115 3 | timeCreated: 1471506834 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 340bca7100420314d8cde6bde4e69bf6 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts/EmojiText.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections.Generic; 4 | using System.Text.RegularExpressions; 5 | 6 | public class EmojiText : Text 7 | { 8 | private const float ICON_SCALE_OF_DOUBLE_SYMBOLE = 0.7f; 9 | public override float preferredWidth => cachedTextGeneratorForLayout.GetPreferredWidth(emojiText, GetGenerationSettings(rectTransform.rect.size)) / pixelsPerUnit; 10 | public override float preferredHeight => cachedTextGeneratorForLayout.GetPreferredHeight(emojiText, GetGenerationSettings(rectTransform.rect.size)) / pixelsPerUnit; 11 | 12 | private string emojiText => Regex.Replace(text, "\\[[a-z0-9A-Z]+\\]", "%%"); 13 | private static Dictionary m_EmojiIndexDict = null; 14 | 15 | struct EmojiInfo 16 | { 17 | public float x; 18 | public float y; 19 | public float size; 20 | } 21 | 22 | readonly UIVertex[] m_TempVerts = new UIVertex[4]; 23 | 24 | protected override void OnPopulateMesh(VertexHelper toFill) 25 | { 26 | if (font == null) 27 | { 28 | return; 29 | } 30 | if (m_EmojiIndexDict == null) 31 | { 32 | m_EmojiIndexDict = new Dictionary(); 33 | 34 | //load emoji data, and you can overwrite this segment code base on your project. 35 | TextAsset emojiContent = Resources.Load ("emoji"); 36 | string[] lines = emojiContent.text.Split ('\n'); 37 | for(int i = 1 ; i < lines.Length; i ++) 38 | { 39 | if (! string.IsNullOrEmpty (lines [i])) { 40 | string[] strs = lines [i].Split ('\t'); 41 | EmojiInfo info; 42 | info.x = float.Parse (strs [3]); 43 | info.y = float.Parse (strs [4]); 44 | info.size = float.Parse (strs [5]); 45 | m_EmojiIndexDict.Add (strs [1], info); 46 | } 47 | } 48 | } 49 | 50 | Dictionary emojiDic = new Dictionary (); 51 | 52 | if (supportRichText) 53 | { 54 | int nParcedCount = 0; 55 | //[1] [123] 替换成#的下标偏移量 56 | int nOffset = 0; 57 | MatchCollection matches = Regex.Matches (text, "\\[[a-z0-9A-Z]+\\]"); 58 | for (int i = 0; i < matches.Count; i++) 59 | { 60 | EmojiInfo info; 61 | if (m_EmojiIndexDict.TryGetValue (matches[i].Value, out info)) 62 | { 63 | emojiDic.Add(matches[i].Index - nOffset + nParcedCount, info); 64 | nOffset += matches [i].Length - 1; 65 | nParcedCount++; 66 | } 67 | } 68 | } 69 | 70 | // We don't care if we the font Texture changes while we are doing our Update. 71 | // The end result of cachedTextGenerator will be valid for this instance. 72 | // Otherwise we can get issues like Case 619238. 73 | m_DisableFontTextureRebuiltCallback = true; 74 | 75 | Vector2 extents = rectTransform.rect.size; 76 | 77 | var settings = GetGenerationSettings(extents); 78 | cachedTextGenerator.Populate(emojiText, settings); 79 | 80 | Rect inputRect = rectTransform.rect; 81 | 82 | // get the text alignment anchor point for the text in local space 83 | Vector2 textAnchorPivot = GetTextAnchorPivot(alignment); 84 | Vector2 refPoint = Vector2.zero; 85 | refPoint.x = Mathf.Lerp(inputRect.xMin, inputRect.xMax, textAnchorPivot.x); 86 | refPoint.y = Mathf.Lerp(inputRect.yMin, inputRect.yMax, textAnchorPivot.y); 87 | 88 | // Apply the offset to the vertices 89 | IList verts = cachedTextGenerator.verts; 90 | float unitsPerPixel = 1 / pixelsPerUnit; 91 | int vertCount = verts.Count; 92 | 93 | // We have no verts to process just return (case 1037923) 94 | if (vertCount <= 0) 95 | { 96 | toFill.Clear(); 97 | return; 98 | } 99 | 100 | Vector2 roundingOffset = new Vector2(verts[0].position.x, verts[0].position.y) * unitsPerPixel; 101 | roundingOffset = PixelAdjustPoint(roundingOffset) - roundingOffset; 102 | toFill.Clear(); 103 | if (roundingOffset != Vector2.zero) 104 | { 105 | for (int i = 0; i < vertCount; ++i) 106 | { 107 | int tempVertsIndex = i & 3; 108 | m_TempVerts[tempVertsIndex] = verts[i]; 109 | m_TempVerts[tempVertsIndex].position *= unitsPerPixel; 110 | m_TempVerts[tempVertsIndex].position.x += roundingOffset.x; 111 | m_TempVerts[tempVertsIndex].position.y += roundingOffset.y; 112 | if (tempVertsIndex == 3) 113 | { 114 | toFill.AddUIVertexQuad(m_TempVerts); 115 | } 116 | } 117 | } 118 | else 119 | { 120 | for (int i = 0; i < vertCount; ++i) 121 | { 122 | EmojiInfo info; 123 | int index = i / 4; 124 | if (emojiDic.TryGetValue (index, out info)) 125 | { 126 | //compute the distance of '[' and get the distance of emoji 127 | //计算2个%%的距离 128 | float emojiSize = 2 * (verts[i + 1].position.x - verts[i].position.x) * ICON_SCALE_OF_DOUBLE_SYMBOLE; 129 | 130 | float fCharHeight = verts[i + 1].position.y - verts[i + 2].position.y; 131 | float fCharWidth = verts[i + 1].position.x - verts[i].position.x; 132 | 133 | float fHeightOffsetHalf = (emojiSize - fCharHeight) * 0.5f; 134 | float fStartOffset = emojiSize * (1 - ICON_SCALE_OF_DOUBLE_SYMBOLE); 135 | 136 | m_TempVerts [3] = verts [i];//1 137 | m_TempVerts [2] = verts [i + 1];//2 138 | m_TempVerts [1] = verts [i + 2];//3 139 | m_TempVerts [0] = verts [i + 3];//4 140 | 141 | m_TempVerts[0].position += new Vector3(fStartOffset, -fHeightOffsetHalf, 0); 142 | m_TempVerts[1].position += new Vector3(fStartOffset - fCharWidth + emojiSize, -fHeightOffsetHalf, 0); 143 | m_TempVerts[2].position += new Vector3(fStartOffset - fCharWidth + emojiSize, fHeightOffsetHalf, 0); 144 | m_TempVerts [3].position += new Vector3(fStartOffset, fHeightOffsetHalf, 0); 145 | 146 | m_TempVerts [0].position *= unitsPerPixel; 147 | m_TempVerts [1].position *= unitsPerPixel; 148 | m_TempVerts [2].position *= unitsPerPixel; 149 | m_TempVerts [3].position *= unitsPerPixel; 150 | 151 | float pixelOffset = emojiDic [index].size / 32 / 2; 152 | m_TempVerts [0].uv1 = new Vector2 (emojiDic [index].x + pixelOffset, emojiDic [index].y + pixelOffset); 153 | m_TempVerts [1].uv1 = new Vector2 (emojiDic [index].x - pixelOffset + emojiDic [index].size, emojiDic [index].y + pixelOffset); 154 | m_TempVerts [2].uv1 = new Vector2 (emojiDic [index].x - pixelOffset + emojiDic [index].size, emojiDic [index].y - pixelOffset + emojiDic [index].size); 155 | m_TempVerts [3].uv1 = new Vector2 (emojiDic [index].x + pixelOffset, emojiDic [index].y - pixelOffset + emojiDic [index].size); 156 | 157 | toFill.AddUIVertexQuad (m_TempVerts); 158 | 159 | i += 4 * 2 - 1; 160 | } 161 | else 162 | { 163 | int tempVertsIndex = i & 3; 164 | m_TempVerts [tempVertsIndex] = verts [i]; 165 | m_TempVerts [tempVertsIndex].position *= unitsPerPixel; 166 | if (tempVertsIndex == 3) 167 | { 168 | toFill.AddUIVertexQuad(m_TempVerts); 169 | } 170 | } 171 | } 172 | 173 | } 174 | m_DisableFontTextureRebuiltCallback = false; 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /Assets/Scripts/EmojiText.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6256e2d7818daf84189e4c021d959534 3 | timeCreated: 1477884820 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/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8da1a0ec640581740815eaf92002625d 3 | folderAsset: yes 4 | timeCreated: 1476264136 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shader/UI-EmojiFont.shader: -------------------------------------------------------------------------------- 1 | 2 | // Author:zouchunyi 3 | // E-mail:zouchunyi@kingsoft.com 4 | 5 | Shader "UI/EmojiFont" { 6 | Properties { 7 | [PerRendererData] _MainTex ("Font Texture", 2D) = "white" {} 8 | _Color ("Tint", Color) = (1,1,1,1) 9 | 10 | _StencilComp ("Stencil Comparison", Float) = 8 11 | _Stencil ("Stencil ID", Float) = 0 12 | _StencilOp ("Stencil Operation", Float) = 0 13 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 14 | _StencilReadMask ("Stencil Read Mask", Float) = 255 15 | 16 | _ColorMask ("Color Mask", Float) = 15 17 | 18 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 19 | 20 | _EmojiTex ("Emoji Texture", 2D) = "white" {} 21 | _EmojiDataTex ("Emoji Data", 2D) = "white" {} 22 | _EmojiSize ("Emoji count of every line",float) = 200 23 | _FrameSpeed ("FrameSpeed",Range(0,10)) = 3 24 | } 25 | 26 | SubShader 27 | { 28 | Tags 29 | { 30 | "Queue"="Transparent" 31 | "IgnoreProjector"="True" 32 | "RenderType"="Transparent" 33 | "PreviewType"="Plane" 34 | "CanUseSpriteAtlas"="True" 35 | } 36 | 37 | Stencil 38 | { 39 | Ref [_Stencil] 40 | Comp [_StencilComp] 41 | Pass [_StencilOp] 42 | ReadMask [_StencilReadMask] 43 | WriteMask [_StencilWriteMask] 44 | } 45 | 46 | Cull Off 47 | Lighting Off 48 | ZWrite Off 49 | ZTest [unity_GUIZTestMode] 50 | Blend SrcAlpha OneMinusSrcAlpha 51 | ColorMask [_ColorMask] 52 | 53 | Pass 54 | { 55 | Name "Default" 56 | CGPROGRAM 57 | #pragma vertex vert 58 | #pragma fragment frag 59 | #pragma target 2.0 60 | 61 | #include "UnityCG.cginc" 62 | #include "UnityUI.cginc" 63 | 64 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 65 | 66 | struct appdata_t 67 | { 68 | float4 vertex : POSITION; 69 | float4 color : COLOR; 70 | float2 texcoord : TEXCOORD0; 71 | float2 texcoord1 : TEXCOORD1; 72 | }; 73 | 74 | struct v2f 75 | { 76 | float4 vertex : SV_POSITION; 77 | fixed4 color : COLOR; 78 | half2 texcoord : TEXCOORD0; 79 | half2 texcoord1 : TEXCOORD1; 80 | }; 81 | 82 | fixed4 _Color; 83 | fixed4 _TextureSampleAdd; 84 | float4 _ClipRect; 85 | 86 | v2f vert(appdata_t IN) 87 | { 88 | v2f OUT; 89 | OUT.vertex = UnityObjectToClipPos(float4(IN.vertex.x, IN.vertex.y, IN.vertex.z, 1.0)); 90 | 91 | OUT.texcoord = IN.texcoord; 92 | OUT.texcoord1 = IN.texcoord1; 93 | 94 | #ifdef UNITY_HALF_TEXEL_OFFSET 95 | OUT.vertex.xy += (_ScreenParams.zw-1.0) * float2(-1,1) * OUT.vertex.w; 96 | #endif 97 | 98 | OUT.color = IN.color * _Color; 99 | return OUT; 100 | } 101 | 102 | sampler2D _MainTex; 103 | sampler2D _EmojiTex; 104 | sampler2D _EmojiDataTex; 105 | float _EmojiSize; 106 | float _FrameSpeed; 107 | 108 | fixed4 frag(v2f IN) : SV_Target 109 | { 110 | fixed4 color; 111 | if (IN.texcoord1.x >0 && IN.texcoord1.y > 0) 112 | { 113 | // it's an emoji 114 | 115 | // compute the size of emoji 116 | half size = (1 / _EmojiSize); 117 | // compute the center uv of per pixel in the emoji 118 | half2 uv = half2(floor(IN.texcoord1.x * _EmojiSize) * size + 0.5 * size,floor(IN.texcoord1.y * _EmojiSize) * size + 0.5 * size); 119 | // read data 120 | fixed4 data = tex2D(_EmojiDataTex, uv); 121 | // compute the frame count of emoji 122 | half frameCount = 1 + sign(data.r) + sign(data.g) * 2 + sign(data.b) * 4; 123 | // compute current frame index of emoji 124 | half index = abs(fmod(floor(_Time.x * _FrameSpeed * 50), frameCount)); 125 | // judge current frame is in the next line or not. 126 | half flag = (1 + sign(IN.texcoord1.x + index * size - 1)) * 0.5; 127 | // compute the final uv 128 | IN.texcoord1.x += index * size - flag; 129 | IN.texcoord1.y += size * flag; 130 | 131 | color = tex2D(_EmojiTex, IN.texcoord1); 132 | }else 133 | { 134 | // it's a text, and render it as normal ugui text 135 | color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 136 | } 137 | 138 | #ifdef UNITY_UI_ALPHACLIP 139 | clip (color.a - 0.001); 140 | #endif 141 | 142 | return color; 143 | } 144 | ENDCG 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /Assets/Shader/UI-EmojiFont.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bf52ea27cd9ff345b6e2e56deb64231 3 | timeCreated: 1476257393 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.1.0f3 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchunyi/EmojiText/820b29f7407e69e5bb39070325a2aad258dd0d02/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EmojiText 2 | Based on UGUI to support emoji system on Text component. 3 | 4 | Unity Version: 2017 5 | 6 | How to use? 7 | 1) 8 | Put all emojies in Asset/Framework/Resource/Emoji/Input. 9 | Multi-frame emoji name format : Name_Index.png , Single frame emoji format: Name.png 10 | 2) 11 | Excute EmojiText->Build Emoji from menu in Unity. 12 | 3) 13 | It will outputs two textures and a txt in Emoji/Output. 14 | Drag emoji_tex to "Emoji Texture" and emoji_data to "Emoji Data" in UGUIEmoji material. 15 | 4) 16 | Repair the value of "Emoji count of every line" base on emoji_tex.png. 17 | 5) 18 | It will auto copys emoji.txt to Resources, and you can overwrite relevant functions base on your project. 19 | 20 | Author:zouchunyi 21 | E-mail:zouchunyi@kingsoft.com 22 | --------------------------------------------------------------------------------