├── Assets ├── TextMesh Pro │ ├── Resources │ │ ├── LineBreaking Leading Characters.txt │ │ ├── LineBreaking Following Characters.txt │ │ ├── Shaders │ │ │ ├── TMPro.cginc.meta │ │ │ ├── TMP_Bitmap.shader.meta │ │ │ ├── TMP_SDF.shader.meta │ │ │ ├── TMP_SDF Overlay.shader.meta │ │ │ ├── TMP_SDF-Mobile.shader.meta │ │ │ ├── TMP_SDF-Surface.shader.meta │ │ │ ├── TMPro_Properties.cginc.meta │ │ │ ├── TMPro_Surface.cginc.meta │ │ │ ├── TMP_Bitmap-Mobile.shader.meta │ │ │ ├── TMP_Bitmap-Custom-Atlas.shader.meta │ │ │ ├── TMP_SDF-Mobile Overlay.shader.meta │ │ │ ├── TMP_SDF-Surface-Mobile.shader.meta │ │ │ ├── TMP_Sprite.shader.meta │ │ │ ├── TMP_SDF-Mobile Masking.shader.meta │ │ │ ├── TMPro.cginc │ │ │ ├── TMP_Sprite.shader │ │ │ ├── TMPro_Properties.cginc │ │ │ ├── TMP_SDF-Surface-Mobile.shader │ │ │ ├── TMP_Bitmap.shader │ │ │ ├── TMP_Bitmap-Custom-Atlas.shader │ │ │ ├── TMP_Bitmap-Mobile.shader │ │ │ ├── TMPro_Surface.cginc │ │ │ ├── TMP_SDF-Surface.shader │ │ │ ├── TMP_SDF-Mobile Overlay.shader │ │ │ ├── TMP_SDF-Mobile.shader │ │ │ ├── TMP_SDF-Mobile Masking.shader │ │ │ └── TMP_SDF Overlay.shader │ │ ├── TMP Settings.asset.meta │ │ ├── Sprite Assets │ │ │ └── EmojiOne.asset.meta │ │ ├── LineBreaking Following Characters.txt.meta │ │ ├── LineBreaking Leading Characters.txt.meta │ │ ├── Shaders.meta │ │ ├── Fonts & Materials │ │ │ ├── LiberationSans SDF.asset.meta │ │ │ ├── LiberationSans SDF - Outline.mat.meta │ │ │ ├── LiberationSans SDF - Drop Shadow.mat.meta │ │ │ ├── LiberationSans SDF - Outline.mat │ │ │ └── LiberationSans SDF - Drop Shadow.mat │ │ ├── Sprite Assets.meta │ │ ├── Style Sheets.meta │ │ ├── Style Sheets │ │ │ ├── Default Style Sheet.asset.meta │ │ │ └── Default Style Sheet.asset │ │ ├── Fonts & Materials.meta │ │ └── TMP Settings.asset │ ├── Sprites │ │ ├── EmojiOne.png │ │ ├── EmojiOne Attribution.txt.meta │ │ ├── EmojiOne Attribution.txt │ │ ├── EmojiOne.json.meta │ │ └── EmojiOne.json │ ├── Documentation │ │ ├── TextMesh Pro User Guide 2016.pdf │ │ └── TextMesh Pro User Guide 2016.pdf.meta │ ├── Resources.meta │ ├── Sprites.meta │ └── Documentation.meta ├── RedBlueGames │ ├── TextTyper │ │ ├── Examples │ │ │ ├── TextTyperExample.unity.meta │ │ │ ├── UITextDisplay.wav │ │ │ ├── TextTyperTester.cs.meta │ │ │ ├── ExampleCurveLibrary.asset.meta │ │ │ ├── ExampleShakeLibrary.asset.meta │ │ │ ├── UITextDisplay.wav.meta │ │ │ ├── ExampleShakeLibrary.asset │ │ │ ├── TextTyperTester.cs │ │ │ └── ExampleCurveLibrary.asset │ │ ├── Animation.meta │ │ ├── Examples.meta │ │ ├── RedBlueGames.TextTyper.asmdef.meta │ │ ├── Tests.meta │ │ ├── Tests │ │ │ ├── Editor.meta │ │ │ └── Editor │ │ │ │ ├── RedBlueGames.TextTyper.Tests.Editor.asmdef.meta │ │ │ │ ├── RichTextTagTests.cs.meta │ │ │ │ ├── TextTagParserTests.cs.meta │ │ │ │ ├── RedBlueGames.TextTyper.Tests.Editor.asmdef │ │ │ │ ├── RichTextTagTests.cs │ │ │ │ └── TextTagParserTests.cs │ │ ├── Animation │ │ │ ├── CurveLibrary.cs.meta │ │ │ ├── ShakeLibrary.cs.meta │ │ │ ├── TextAnimation.cs.meta │ │ │ ├── CurveAnimation.cs.meta │ │ │ ├── ShakeAnimation.cs.meta │ │ │ ├── ShakeLibrary.cs │ │ │ ├── ShakeAnimation.cs │ │ │ ├── CurveLibrary.cs │ │ │ ├── CurveAnimation.cs │ │ │ └── TextAnimation.cs │ │ ├── RichTextTag.cs.meta │ │ ├── TextTagParser.cs.meta │ │ ├── RedBlueGames.TextTyper.asmdef │ │ ├── TextTyper.cs.meta │ │ ├── TextTagParser.cs │ │ └── RichTextTag.cs │ └── TextTyper.meta ├── TextMesh Pro.meta ├── Editor.meta ├── RedBlueGames.meta └── Editor │ ├── RBPackageExporter.cs.meta │ └── RBPackageExporter.cs ├── ProjectSettings ├── ProjectVersion.txt ├── NavMeshLayers.asset ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── NetworkManager.asset ├── TimeManager.asset ├── XRSettings.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── DynamicsManager.asset ├── UnityConnectSettings.asset ├── PackageManagerSettings.asset ├── NavMeshAreas.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── Physics2DSettings.asset ├── QualitySettings.asset └── InputManager.asset ├── README-Images └── ss_chat_watermarked.gif ├── .gitignore ├── LICENSE ├── .vscode ├── launch.json └── settings.json ├── Logs └── Packages-Update.log ├── Packages └── manifest.json └── README.md /Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt: -------------------------------------------------------------------------------- 1 | ([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇〉》」$⦆¥₩ # -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.22f1 2 | m_EditorVersionWithRevision: 2019.4.22f1 (9fdda2fe27ad) 3 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redbluegames/unity-text-typer/HEAD/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /README-Images/ss_chat_watermarked.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redbluegames/unity-text-typer/HEAD/README-Images/ss_chat_watermarked.gif -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redbluegames/unity-text-typer/HEAD/Assets/TextMesh Pro/Sprites/EmojiOne.png -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt: -------------------------------------------------------------------------------- 1 | )]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,. -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/TextTyperExample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40aeae9d2c740cb48a4080f1b87ca99b 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/UITextDisplay.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redbluegames/unity-text-typer/HEAD/Assets/RedBlueGames/TextTyper/Examples/UITextDisplay.wav -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redbluegames/unity-text-typer/HEAD/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f54d1bd14bd3ca042bd867b519fee8cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 243e06394e614e5d99fab26083b707fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 407bc68d299748449bbf7f48ee690f8d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0603b6d5186471b96c778c3949c7ce2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Documentation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e7e8f5a82a3a134e91c54efd2274ea9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 128e987d567d4e2c824d754223b3f3b0 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68e6db2ebdc24f95958faec2be5558d6 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 381dcb09d5029d14897e55f98031fca5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18d5f287a3c797f4c947eca42ed31b38 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acaeb807e00744640b76fb971545cf60 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd89cf5b9246416f84610a006f916af7 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe393ace9b354375a9cb14cdbbc28be4 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7ada0af4f174f0694ca6a487b8f543d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3997e2241185407d80309a82f9148466 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro_Surface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d930090c0cd643c7b55f19a38538c162 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt: -------------------------------------------------------------------------------- 1 | This sample of beautiful emojis are provided by EmojiOne https://www.emojione.com/ 2 | 3 | Please visit their website to view the complete set of their emojis and review their licensing terms. -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e3b057af24249748ff873be7fafee47 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72ddb92a9915646dfa918e325e5b8a52 3 | folderAsset: yes 4 | timeCreated: 1480965209 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/RedBlueGames.TextTyper.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a9f6b3925c9a4ff6bcfff2fff874067 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b8d251f9af63b746bf2f7ffe00ebb9b 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48bb5f55d8670e349b6e614913f9d910 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02a7d8c237544f1962732b55a9aebf1 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85187c2149c549c5b33f0cdb02836b17 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f05276190cf498a8153f6cbe761d4e6 3 | timeCreated: 1480316860 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12e93958440064b4da1de934ebf865ed 3 | folderAsset: yes 4 | timeCreated: 1480964851 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/TMP Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f5b5dff67a942289a9defa416b206f3 3 | timeCreated: 1436653997 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6540f04dbeb3d4c799d91fc2a728bc19 3 | folderAsset: yes 4 | timeCreated: 1480964855 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/TextTyperTester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ece93e789392cab498408406d4438896 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa16fe06d59914d849d8082bc2cfbdc4 3 | folderAsset: yes 4 | timeCreated: 1480773231 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c41005c129ba4d66911b75229fd70b45 3 | timeCreated: 1480316912 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fade42e8bc714b018fac513c043d323b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d82c1b31c7e74239bff1220585707d2b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99f836c9cb9345dba2e72c4a1f2d0695 3 | folderAsset: yes 4 | timeCreated: 1436068007 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cf31917defde46cfb64978fb42bf8fa 3 | folderAsset: yes 4 | timeCreated: 1480773236 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests/Editor/RedBlueGames.TextTyper.Tests.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 300eb0d92cd3d41bc9de01f0356f5c87 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f586378b4e144a9851e7b34d9b748ee 3 | timeCreated: 1484171803 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Sprite Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512a49d95c0c4332bdd98131869c23c9 3 | folderAsset: yes 4 | timeCreated: 1441876896 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Style Sheets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4aecb92fff08436c8303b10eab8da368 3 | folderAsset: yes 4 | timeCreated: 1441876950 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f952c082cb03451daed3ee968ac6c63e 3 | timeCreated: 1432805430 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/ExampleCurveLibrary.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1807857dbc33603469f5046b18ae0aae 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/ExampleShakeLibrary.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a6156b25fcccac4e97ef1c8d23def06 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 731f1baa9d144a9897cb1d341c2092b8 3 | folderAsset: yes 4 | timeCreated: 1442040525 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79459efec17a4d00a321bdcc27bbc385 3 | timeCreated: 1484172856 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e73a58f6e2794ae7b1b7e50b7fb811b0 3 | timeCreated: 1484172806 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf81c85f95fe47e1a27f6ae460cf182c 3 | timeCreated: 1450517184 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Masking.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc1ede39bf3643ee8e493720e4259791 3 | timeCreated: 1463704911 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/RBPackageExporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83d87573060fb44fba118749ae2724c5 3 | timeCreated: 1480009765 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/RedBlueGames/TextTyper/Animation/CurveLibrary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b3c7f099297a574fb0c50c5811b9d8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/ShakeLibrary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 866de5792f341d54d8e3b55427645926 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/TextAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b562a45be4798c48bb8c912338a5485 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/RichTextTag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65fc1ffea80354d8886372d9be39e988 3 | timeCreated: 1480713558 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/RedBlueGames/TextTyper/TextTagParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 067e8034ef9f449c6bfb7b6fe26b0a3c 3 | timeCreated: 1488807547 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/RedBlueGames/TextTyper/Tests/Editor/RichTextTagTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c657a22146554595bab298c35a43f51 3 | timeCreated: 1480773242 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/RedBlueGames/TextTyper/Tests/Editor/TextTagParserTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa7143360c0f04e0ba96b18c8b979562 3 | timeCreated: 1488844575 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /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: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/CurveAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25949e0d00539a240bdf6993052f9936 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - curveLibrary: {fileID: 11400000, guid: 1807857dbc33603469f5046b18ae0aae, type: 2} 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/ShakeAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b49648f095d6e484394992ac11efba07 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - textMesh: {instanceID: 0} 8 | - shakeLibrary: {fileID: 11400000, guid: 9a6156b25fcccac4e97ef1c8d23def06, type: 2} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/RedBlueGames.TextTyper.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RedBlueGames.TextTyper", 3 | "references": [ 4 | "GUID:6055be8ebefd69e48b49212b09b47b2f" 5 | ], 6 | "includePlatforms": [], 7 | "excludePlatforms": [], 8 | "allowUnsafeCode": false, 9 | "overrideReferences": false, 10 | "precompiledReferences": [], 11 | "autoReferenced": true, 12 | "defineConstraints": [], 13 | "versionDefines": [], 14 | "noEngineReferences": false 15 | } -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/TextTyper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40868536fcc3c2c458788a1cd1298e8f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - shakeLibrary: {fileID: 11400000, guid: 9a6156b25fcccac4e97ef1c8d23def06, type: 2} 8 | - curveLibrary: {fileID: 11400000, guid: 1807857dbc33603469f5046b18ae0aae, type: 2} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/UITextDisplay.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4457c27178d8e4ec2aef0a0406b75e06 3 | timeCreated: 1480972864 4 | licenseType: Free 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | *.vs 17 | 18 | # Unity3D generated meta files 19 | *.pidb.meta 20 | 21 | # Unity3D Generated File On Crash Reports 22 | sysinfo.txt 23 | 24 | # MacOS ignores 25 | *.DS_Store 26 | 27 | # StyleCop local cache files 28 | *.Cache 29 | *.Cache.meta 30 | 31 | # Unity Packages 32 | *.unitypackage 33 | 34 | # VisualStudioCode 35 | .vscode/* 36 | !.vscode/settings.json 37 | !.vscode/tasks.json 38 | !.vscode/launch.json 39 | !.vscode/extensions.json -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests/Editor/RedBlueGames.TextTyper.Tests.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RedBlueGames.TextTyper.Tests.Editor", 3 | "references": [ 4 | "GUID:27619889b8ba8c24980f49ee34dbb44a", 5 | "GUID:0acc523941302664db1f4e527237feb3", 6 | "GUID:8a9f6b3925c9a4ff6bcfff2fff874067" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": true, 14 | "precompiledReferences": [ 15 | "nunit.framework.dll" 16 | ], 17 | "autoReferenced": false, 18 | "defineConstraints": [ 19 | "UNITY_INCLUDE_TESTS" 20 | ], 21 | "versionDefines": [], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/ExampleShakeLibrary.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 866de5792f341d54d8e3b55427645926, type: 3} 13 | m_Name: ExampleShakeLibrary 14 | m_EditorClassIdentifier: 15 | ShakePresets: 16 | - Name: LightPos 17 | xPosStrength: 2 18 | yPosStrength: 2 19 | RotationStrength: 0 20 | ScaleStrength: 0 21 | - Name: LightRot 22 | xPosStrength: 0 23 | yPosStrength: 0 24 | RotationStrength: 15 25 | ScaleStrength: 0 26 | - Name: FullShake 27 | xPosStrength: 3 28 | yPosStrength: 3 29 | RotationStrength: 20 30 | ScaleStrength: 0.3 31 | -------------------------------------------------------------------------------- /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: 0 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 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Woosung Jeon 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 | 23 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Unity Editor", 9 | "type": "unity", 10 | "path": "/Users/erowe/Development/unity-text-typer/Library/EditorInstance.json", 11 | "request": "launch" 12 | }, 13 | { 14 | "name": "Windows Player", 15 | "type": "unity", 16 | "request": "launch" 17 | }, 18 | { 19 | "name": "OSX Player", 20 | "type": "unity", 21 | "request": "launch" 22 | }, 23 | { 24 | "name": "Linux Player", 25 | "type": "unity", 26 | "request": "launch" 27 | }, 28 | { 29 | "name": "iOS Player", 30 | "type": "unity", 31 | "request": "launch" 32 | }, 33 | { 34 | "name": "Android Player", 35 | "type": "unity", 36 | "request": "launch" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 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 | -------------------------------------------------------------------------------- /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: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 2 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 0 16 | m_EtcTextureFastCompressor: 2 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 5 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Sat Jun 13 10:55:06 2020 3 | 4 | Packages were changed. 5 | Update Mode: updateDependencies 6 | 7 | The following packages were added: 8 | com.unity.2d.sprite@1.0.0 9 | com.unity.2d.tilemap@1.0.0 10 | com.unity.ide.rider@1.1.4 11 | com.unity.ide.vscode@1.1.4 12 | com.unity.modules.androidjni@1.0.0 13 | com.unity.multiplayer-hlapi@1.0.4 14 | com.unity.test-framework@1.1.13 15 | com.unity.timeline@1.2.6 16 | com.unity.ugui@1.0.0 17 | com.unity.xr.legacyinputhelpers@1.3.11 18 | The following packages were updated: 19 | com.unity.ads from version 2.0.8 to 3.4.4 20 | com.unity.analytics from version 3.2.2 to 3.3.5 21 | com.unity.collab-proxy from version 1.2.15 to 1.2.16 22 | com.unity.purchasing from version 2.0.3 to 2.0.6 23 | com.unity.textmeshpro from version 1.3.0 to 2.0.1 24 | The following packages were removed: 25 | com.unity.package-manager-ui@2.0.3 26 | 27 | === Sun Jul 18 12:54:27 2021 28 | 29 | Packages were changed. 30 | Update Mode: updateDependencies 31 | 32 | The following packages were updated: 33 | com.unity.ads from version 3.4.4 to 3.6.1 34 | com.unity.ide.vscode from version 1.1.4 to 1.2.3 35 | com.unity.multiplayer-hlapi from version 1.0.4 to 1.0.8 36 | com.unity.purchasing from version 2.0.6 to 2.2.2 37 | com.unity.test-framework from version 1.1.13 to 1.1.22 38 | com.unity.timeline from version 1.2.6 to 1.2.18 39 | com.unity.xr.legacyinputhelpers from version 1.3.11 to 2.1.7 40 | -------------------------------------------------------------------------------- /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: 5 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_LegacyDeferred: 14 | m_Mode: 1 15 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 16 | m_AlwaysIncludedShaders: 17 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 18 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 19 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 20 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 21 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 22 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 23 | m_PreloadedShaders: [] 24 | m_ShaderSettings: 25 | useScreenSpaceShadows: 1 26 | m_BuildTargetShaderSettings: [] 27 | m_LightmapStripping: 0 28 | m_FogStripping: 0 29 | m_LightmapKeepPlain: 1 30 | m_LightmapKeepDirCombined: 1 31 | m_LightmapKeepDirSeparate: 1 32 | m_LightmapKeepDynamicPlain: 1 33 | m_LightmapKeepDynamicDirCombined: 1 34 | m_LightmapKeepDynamicDirSeparate: 1 35 | m_FogKeepLinear: 1 36 | m_FogKeepExp: 1 37 | m_FogKeepExp2: 1 38 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.6.1", 6 | "com.unity.analytics": "3.3.5", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.ide.rider": "1.1.4", 9 | "com.unity.ide.vscode": "1.2.3", 10 | "com.unity.multiplayer-hlapi": "1.0.8", 11 | "com.unity.purchasing": "2.2.2", 12 | "com.unity.test-framework": "1.1.22", 13 | "com.unity.textmeshpro": "2.0.1", 14 | "com.unity.timeline": "1.2.18", 15 | "com.unity.ugui": "1.0.0", 16 | "com.unity.xr.legacyinputhelpers": "2.1.7", 17 | "com.unity.modules.ai": "1.0.0", 18 | "com.unity.modules.androidjni": "1.0.0", 19 | "com.unity.modules.animation": "1.0.0", 20 | "com.unity.modules.assetbundle": "1.0.0", 21 | "com.unity.modules.audio": "1.0.0", 22 | "com.unity.modules.cloth": "1.0.0", 23 | "com.unity.modules.director": "1.0.0", 24 | "com.unity.modules.imageconversion": "1.0.0", 25 | "com.unity.modules.imgui": "1.0.0", 26 | "com.unity.modules.jsonserialize": "1.0.0", 27 | "com.unity.modules.particlesystem": "1.0.0", 28 | "com.unity.modules.physics": "1.0.0", 29 | "com.unity.modules.physics2d": "1.0.0", 30 | "com.unity.modules.screencapture": "1.0.0", 31 | "com.unity.modules.terrain": "1.0.0", 32 | "com.unity.modules.terrainphysics": "1.0.0", 33 | "com.unity.modules.tilemap": "1.0.0", 34 | "com.unity.modules.ui": "1.0.0", 35 | "com.unity.modules.uielements": "1.0.0", 36 | "com.unity.modules.umbra": "1.0.0", 37 | "com.unity.modules.unityanalytics": "1.0.0", 38 | "com.unity.modules.unitywebrequest": "1.0.0", 39 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 40 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 41 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 42 | "com.unity.modules.unitywebrequestwww": "1.0.0", 43 | "com.unity.modules.vehicles": "1.0.0", 44 | "com.unity.modules.video": "1.0.0", 45 | "com.unity.modules.vr": "1.0.0", 46 | "com.unity.modules.wind": "1.0.0", 47 | "com.unity.modules.xr": "1.0.0" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/ShakeLibrary.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using UnityEngine; 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | 8 | [Serializable] 9 | public class ShakePreset 10 | { 11 | [Tooltip("Name identifying this preset. Can also be used as a ShakeLibrary indexer key.")] 12 | public string Name; 13 | 14 | [Range(0, 20)] 15 | [Tooltip("Amount of x-axis shake to apply during animation")] 16 | public float xPosStrength = 0f; 17 | 18 | [Range(0, 20)] 19 | [Tooltip("Amount of y-axis shake to apply during animation")] 20 | public float yPosStrength = 0f; 21 | 22 | [Range(0, 90)] 23 | [Tooltip("Amount of rotational shake to apply during animation")] 24 | public float RotationStrength = 0f; 25 | 26 | [Range(0, 10)] 27 | [Tooltip("Amount of scale shake to apply during animation")] 28 | public float ScaleStrength = 0f; 29 | } 30 | 31 | [CreateAssetMenu(fileName = "ShakeLibrary", menuName = "Text Typer/Shake Library", order = 1)] 32 | public class ShakeLibrary : ScriptableObject 33 | { 34 | public List ShakePresets; 35 | 36 | /// 37 | /// Get the ShakePreset from this library with the provided key/name 38 | /// 39 | /// Key/name identifying the desired ShakePreset 40 | /// Matching ShakePreset 41 | public ShakePreset this[string key] 42 | { 43 | get 44 | { 45 | var preset = this.FindPresetOrNull(key); 46 | if (preset == null) 47 | { 48 | throw new KeyNotFoundException(); 49 | } 50 | else 51 | { 52 | return preset; 53 | } 54 | } 55 | } 56 | 57 | public bool ContainsKey(string key) 58 | { 59 | return this.FindPresetOrNull(key) != null; 60 | } 61 | 62 | private ShakePreset FindPresetOrNull(string key) 63 | { 64 | foreach (var preset in this.ShakePresets) 65 | { 66 | if (preset.Name.ToUpper() == key.ToUpper()) 67 | { 68 | return preset; 69 | } 70 | } 71 | 72 | return null; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests/Editor/RichTextTagTests.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper.Tests 2 | { 3 | using NUnit.Framework; 4 | 5 | public class RichTextTagTests 6 | { 7 | [Test] 8 | public void Constructor_OpeningTag_Parses() 9 | { 10 | //Arrange 11 | var tag = ""; 12 | 13 | //Act 14 | var richTextTag = new RichTextTag(tag); 15 | 16 | //Assert 17 | Assert.AreEqual(tag, richTextTag.TagText); 18 | Assert.AreEqual("b", richTextTag.TagType); 19 | Assert.IsFalse(richTextTag.IsClosingTag); 20 | Assert.AreEqual("", richTextTag.ClosingTagText); 21 | Assert.AreEqual(string.Empty, richTextTag.Parameter); 22 | } 23 | 24 | [Test] 25 | public void Constructor_TagAndParameter_Parses() 26 | { 27 | //Arrange 28 | var tag = ""; 29 | 30 | //Act 31 | var richTextTag = new RichTextTag(tag); 32 | 33 | //Assert 34 | Assert.AreEqual(tag, richTextTag.TagText); 35 | Assert.AreEqual("color", richTextTag.TagType); 36 | Assert.IsFalse(richTextTag.IsClosingTag); 37 | Assert.AreEqual("", richTextTag.ClosingTagText); 38 | Assert.AreEqual("#FFFFFFFF", richTextTag.Parameter); 39 | } 40 | 41 | [Test] 42 | public void Constructor_TagAndParameterWithQuotes_Parses() 43 | { 44 | //Arrange 45 | var tag = ""; 46 | 47 | //Act 48 | var richTextTag = new RichTextTag(tag); 49 | 50 | //Assert 51 | Assert.AreEqual(tag, richTextTag.TagText); 52 | Assert.AreEqual("color", richTextTag.TagType); 53 | Assert.IsFalse(richTextTag.IsClosingTag); 54 | Assert.AreEqual("", richTextTag.ClosingTagText); 55 | Assert.AreEqual("red", richTextTag.Parameter); 56 | } 57 | 58 | [Test] 59 | public void Constructor_ClosingTag_Parses() 60 | { 61 | //Arrange 62 | var tag = ""; 63 | 64 | //Act 65 | var richTextTag = new RichTextTag(tag); 66 | 67 | //Assert 68 | Assert.AreEqual(tag, richTextTag.TagText); 69 | Assert.AreEqual("color", richTextTag.TagType); 70 | Assert.IsTrue(richTextTag.IsClosingTag); 71 | Assert.AreEqual("", richTextTag.ClosingTagText); 72 | Assert.AreEqual(string.Empty, richTextTag.Parameter); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc: -------------------------------------------------------------------------------- 1 | float2 UnpackUV(float uv) 2 | { 3 | float2 output; 4 | output.x = floor(uv / 4096); 5 | output.y = uv - 4096 * output.x; 6 | 7 | return output * 0.001953125; 8 | } 9 | 10 | fixed4 GetColor(half d, fixed4 faceColor, fixed4 outlineColor, half outline, half softness) 11 | { 12 | half faceAlpha = 1-saturate((d - outline * 0.5 + softness * 0.5) / (1.0 + softness)); 13 | half outlineAlpha = saturate((d + outline * 0.5)) * sqrt(min(1.0, outline)); 14 | 15 | faceColor.rgb *= faceColor.a; 16 | outlineColor.rgb *= outlineColor.a; 17 | 18 | faceColor = lerp(faceColor, outlineColor, outlineAlpha); 19 | 20 | faceColor *= faceAlpha; 21 | 22 | return faceColor; 23 | } 24 | 25 | float3 GetSurfaceNormal(float4 h, float bias) 26 | { 27 | bool raisedBevel = step(1, fmod(_ShaderFlags, 2)); 28 | 29 | h += bias+_BevelOffset; 30 | 31 | float bevelWidth = max(.01, _OutlineWidth+_BevelWidth); 32 | 33 | // Track outline 34 | h -= .5; 35 | h /= bevelWidth; 36 | h = saturate(h+.5); 37 | 38 | if(raisedBevel) h = 1 - abs(h*2.0 - 1.0); 39 | h = lerp(h, sin(h*3.141592/2.0), _BevelRoundness); 40 | h = min(h, 1.0-_BevelClamp); 41 | h *= _Bevel * bevelWidth * _GradientScale * -2.0; 42 | 43 | float3 va = normalize(float3(1.0, 0.0, h.y - h.x)); 44 | float3 vb = normalize(float3(0.0, -1.0, h.w - h.z)); 45 | 46 | return cross(va, vb); 47 | } 48 | 49 | float3 GetSurfaceNormal(float2 uv, float bias, float3 delta) 50 | { 51 | // Read "height field" 52 | float4 h = {tex2D(_MainTex, uv - delta.xz).a, 53 | tex2D(_MainTex, uv + delta.xz).a, 54 | tex2D(_MainTex, uv - delta.zy).a, 55 | tex2D(_MainTex, uv + delta.zy).a}; 56 | 57 | return GetSurfaceNormal(h, bias); 58 | } 59 | 60 | float3 GetSpecular(float3 n, float3 l) 61 | { 62 | float spec = pow(max(0.0, dot(n, l)), _Reflectivity); 63 | return _SpecularColor.rgb * spec * _SpecularPower; 64 | } 65 | 66 | float4 GetGlowColor(float d, float scale) 67 | { 68 | float glow = d - (_GlowOffset*_ScaleRatioB) * 0.5 * scale; 69 | float t = lerp(_GlowInner, (_GlowOuter * _ScaleRatioB), step(0.0, glow)) * 0.5 * scale; 70 | glow = saturate(abs(glow/(1.0 + t))); 71 | glow = 1.0-pow(glow, _GlowPower); 72 | glow *= sqrt(min(1.0, t)); // Fade off glow thinner than 1 screen pixel 73 | return float4(_GlowColor.rgb, saturate(_GlowColor.a * glow * 2)); 74 | } 75 | 76 | float4 BlendARGB(float4 overlying, float4 underlying) 77 | { 78 | overlying.rgb *= overlying.a; 79 | underlying.rgb *= underlying.a; 80 | float3 blended = overlying.rgb + ((1-overlying.a)*underlying.rgb); 81 | float alpha = underlying.a + (1-underlying.a)*overlying.a; 82 | return float4(blended, alpha); 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/ShakeAnimation.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using TMPro; 6 | using UnityEngine; 7 | using UnityEngine.Events; 8 | using UnityEngine.UI; 9 | 10 | [RequireComponent(typeof(TextMeshProUGUI))] 11 | public class ShakeAnimation : TextAnimation 12 | { 13 | [SerializeField] 14 | [Tooltip("The library of ShakePresets that can be used by this component.")] 15 | private ShakeLibrary shakeLibrary; 16 | 17 | [SerializeField] 18 | [Tooltip("The name (key) of the ShakePreset this animation should use.")] 19 | private string shakePresetKey; 20 | 21 | private ShakePreset shakePreset; 22 | 23 | /// 24 | /// Load a particular ShakePreset animation into this Component 25 | /// 26 | /// The library of ShakePresets that can be used by this component 27 | /// The name (key) of the ShakePreset this animation should use 28 | public void LoadPreset(ShakeLibrary library, string presetKey) 29 | { 30 | this.shakeLibrary = library; 31 | this.shakePresetKey = presetKey; 32 | this.shakePreset = library[presetKey]; 33 | } 34 | 35 | protected override void OnEnable() 36 | { 37 | if (this.shakeLibrary != null && !string.IsNullOrEmpty(this.shakePresetKey)) 38 | { 39 | LoadPreset(this.shakeLibrary, this.shakePresetKey); 40 | } 41 | 42 | base.OnEnable(); 43 | } 44 | 45 | protected override void Animate(int characterIndex, out Vector2 translation, out float rotation, out float scale) 46 | { 47 | translation = Vector2.zero; 48 | rotation = 0f; 49 | scale = 1f; 50 | 51 | // Do nothing if a ShakePreset has not been configured yet 52 | if (this.shakePreset == null) 53 | { 54 | return; 55 | } 56 | 57 | if (characterIndex >= this.FirstCharToAnimate && characterIndex <= this.LastCharToAnimate) 58 | { 59 | float randomX = Random.Range(-this.shakePreset.xPosStrength, this.shakePreset.xPosStrength); 60 | float randomY = Random.Range(-this.shakePreset.yPosStrength, this.shakePreset.yPosStrength); 61 | translation = new Vector2(randomX, randomY); 62 | 63 | rotation = Random.Range(-this.shakePreset.RotationStrength, this.shakePreset.RotationStrength); 64 | 65 | scale = 1f + Random.Range(-this.shakePreset.ScaleStrength, this.shakePreset.ScaleStrength); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Sprite" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 16 | 17 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 18 | } 19 | 20 | SubShader 21 | { 22 | Tags 23 | { 24 | "Queue"="Transparent" 25 | "IgnoreProjector"="True" 26 | "RenderType"="Transparent" 27 | "PreviewType"="Plane" 28 | "CanUseSpriteAtlas"="True" 29 | } 30 | 31 | Stencil 32 | { 33 | Ref [_Stencil] 34 | Comp [_StencilComp] 35 | Pass [_StencilOp] 36 | ReadMask [_StencilReadMask] 37 | WriteMask [_StencilWriteMask] 38 | } 39 | 40 | Cull Off 41 | Lighting Off 42 | ZWrite Off 43 | ZTest [unity_GUIZTestMode] 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask [_ColorMask] 46 | 47 | Pass 48 | { 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | 53 | #include "UnityCG.cginc" 54 | #include "UnityUI.cginc" 55 | 56 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 57 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 58 | 59 | struct appdata_t 60 | { 61 | float4 vertex : POSITION; 62 | float4 color : COLOR; 63 | float2 texcoord : TEXCOORD0; 64 | }; 65 | 66 | struct v2f 67 | { 68 | float4 vertex : SV_POSITION; 69 | fixed4 color : COLOR; 70 | half2 texcoord : TEXCOORD0; 71 | float4 worldPosition : TEXCOORD1; 72 | }; 73 | 74 | fixed4 _Color; 75 | fixed4 _TextureSampleAdd; 76 | float4 _ClipRect; 77 | 78 | v2f vert(appdata_t IN) 79 | { 80 | v2f OUT; 81 | OUT.worldPosition = IN.vertex; 82 | OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); 83 | 84 | OUT.texcoord = IN.texcoord; 85 | 86 | #ifdef UNITY_HALF_TEXEL_OFFSET 87 | OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1); 88 | #endif 89 | 90 | OUT.color = IN.color * _Color; 91 | return OUT; 92 | } 93 | 94 | sampler2D _MainTex; 95 | 96 | fixed4 frag(v2f IN) : SV_Target 97 | { 98 | half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 99 | 100 | #if UNITY_UI_CLIP_RECT 101 | color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); 102 | #endif 103 | 104 | #ifdef UNITY_UI_ALPHACLIP 105 | clip (color.a - 0.001); 106 | #endif 107 | 108 | return color; 109 | } 110 | ENDCG 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc: -------------------------------------------------------------------------------- 1 | // UI Editable properties 2 | uniform sampler2D _FaceTex; // Alpha : Signed Distance 3 | uniform float _FaceUVSpeedX; 4 | uniform float _FaceUVSpeedY; 5 | uniform fixed4 _FaceColor; // RGBA : Color + Opacity 6 | uniform float _FaceDilate; // v[ 0, 1] 7 | uniform float _OutlineSoftness; // v[ 0, 1] 8 | 9 | uniform sampler2D _OutlineTex; // RGBA : Color + Opacity 10 | uniform float _OutlineUVSpeedX; 11 | uniform float _OutlineUVSpeedY; 12 | uniform fixed4 _OutlineColor; // RGBA : Color + Opacity 13 | uniform float _OutlineWidth; // v[ 0, 1] 14 | 15 | uniform float _Bevel; // v[ 0, 1] 16 | uniform float _BevelOffset; // v[-1, 1] 17 | uniform float _BevelWidth; // v[-1, 1] 18 | uniform float _BevelClamp; // v[ 0, 1] 19 | uniform float _BevelRoundness; // v[ 0, 1] 20 | 21 | uniform sampler2D _BumpMap; // Normal map 22 | uniform float _BumpOutline; // v[ 0, 1] 23 | uniform float _BumpFace; // v[ 0, 1] 24 | 25 | uniform samplerCUBE _Cube; // Cube / sphere map 26 | uniform fixed4 _ReflectFaceColor; // RGB intensity 27 | uniform fixed4 _ReflectOutlineColor; 28 | //uniform float _EnvTiltX; // v[-1, 1] 29 | //uniform float _EnvTiltY; // v[-1, 1] 30 | uniform float3 _EnvMatrixRotation; 31 | uniform float4x4 _EnvMatrix; 32 | 33 | uniform fixed4 _SpecularColor; // RGB intensity 34 | uniform float _LightAngle; // v[ 0,Tau] 35 | uniform float _SpecularPower; // v[ 0, 1] 36 | uniform float _Reflectivity; // v[ 5, 15] 37 | uniform float _Diffuse; // v[ 0, 1] 38 | uniform float _Ambient; // v[ 0, 1] 39 | 40 | uniform fixed4 _UnderlayColor; // RGBA : Color + Opacity 41 | uniform float _UnderlayOffsetX; // v[-1, 1] 42 | uniform float _UnderlayOffsetY; // v[-1, 1] 43 | uniform float _UnderlayDilate; // v[-1, 1] 44 | uniform float _UnderlaySoftness; // v[ 0, 1] 45 | 46 | uniform fixed4 _GlowColor; // RGBA : Color + Intesity 47 | uniform float _GlowOffset; // v[-1, 1] 48 | uniform float _GlowOuter; // v[ 0, 1] 49 | uniform float _GlowInner; // v[ 0, 1] 50 | uniform float _GlowPower; // v[ 1, 1/(1+4*4)] 51 | 52 | // API Editable properties 53 | uniform float _ShaderFlags; 54 | uniform float _WeightNormal; 55 | uniform float _WeightBold; 56 | 57 | uniform float _ScaleRatioA; 58 | uniform float _ScaleRatioB; 59 | uniform float _ScaleRatioC; 60 | 61 | uniform float _VertexOffsetX; 62 | uniform float _VertexOffsetY; 63 | 64 | //uniform float _UseClipRect; 65 | uniform float _MaskID; 66 | uniform sampler2D _MaskTex; 67 | uniform float4 _MaskCoord; 68 | uniform float4 _ClipRect; // bottom left(x,y) : top right(z,w) 69 | //uniform float _MaskWipeControl; 70 | //uniform float _MaskEdgeSoftness; 71 | //uniform fixed4 _MaskEdgeColor; 72 | //uniform bool _MaskInverse; 73 | 74 | uniform float _MaskSoftnessX; 75 | uniform float _MaskSoftnessY; 76 | 77 | // Font Atlas properties 78 | uniform sampler2D _MainTex; 79 | uniform float _TextureWidth; 80 | uniform float _TextureHeight; 81 | uniform float _GradientScale; 82 | uniform float _ScaleX; 83 | uniform float _ScaleY; 84 | uniform float _PerspectiveFilter; 85 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/CurveLibrary.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using UnityEngine; 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | 8 | [Serializable] 9 | public class CurvePreset 10 | { 11 | [Tooltip("Name identifying this preset. Can also be used as a CurveLibrary indexer key.")] 12 | public string Name; 13 | 14 | [Tooltip("Time offset between each character when calculating animation transform. 0 makes all characters move together. Other values produce a 'wave' effect.")] 15 | [Range(0f, 0.5f)] 16 | public float timeOffsetPerChar = 0f; 17 | 18 | [Tooltip("Curve showing x-position delta over time")] 19 | public AnimationCurve xPosCurve; 20 | [Tooltip("x-position curve is multiplied by this value")] 21 | [Range(0, 20)] 22 | public float xPosMultiplier = 0f; 23 | 24 | [Tooltip("Curve showing y-position delta over time")] 25 | public AnimationCurve yPosCurve; 26 | [Tooltip("y-position curve is multiplied by this value")] 27 | [Range(0, 20)] 28 | public float yPosMultiplier = 0f; 29 | 30 | [Tooltip("Curve showing 2D rotation delta over time")] 31 | public AnimationCurve rotationCurve; 32 | [Tooltip("2D rotation curve is multiplied by this value")] 33 | [Range(0, 90)] 34 | public float rotationMultiplier = 0f; 35 | 36 | [Tooltip("Curve showing uniform scale delta over time")] 37 | public AnimationCurve scaleCurve; 38 | [Tooltip("Uniform scale curve is multiplied by this value")] 39 | [Range(0, 10)] 40 | public float scaleMultiplier = 0f; 41 | } 42 | 43 | [CreateAssetMenu(fileName = "CurveLibrary", menuName = "Text Typer/Curve Library", order = 1)] 44 | public class CurveLibrary : ScriptableObject 45 | { 46 | public List CurvePresets; 47 | 48 | /// 49 | /// Get the CurvePreset from this library with the provided key/name 50 | /// 51 | /// Key/name identifying the desired CurvePreset 52 | /// Matching CurvePreset 53 | public CurvePreset this[string key] 54 | { 55 | get 56 | { 57 | var preset = this.FindPresetOrNull(key); 58 | if (preset == null) 59 | { 60 | throw new KeyNotFoundException(); 61 | } 62 | else 63 | { 64 | return preset; 65 | } 66 | } 67 | } 68 | 69 | public bool ContainsKey(string key) 70 | { 71 | return this.FindPresetOrNull(key) != null; 72 | } 73 | 74 | private CurvePreset FindPresetOrNull(string key) 75 | { 76 | foreach (var preset in this.CurvePresets) 77 | { 78 | if (preset.Name.ToUpper() == key.ToUpper()) 79 | { 80 | return preset; 81 | } 82 | } 83 | 84 | return null; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/CurveAnimation.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using TMPro; 6 | using UnityEngine; 7 | using UnityEngine.Events; 8 | using UnityEngine.UI; 9 | 10 | [RequireComponent(typeof(TextMeshProUGUI))] 11 | public class CurveAnimation : TextAnimation 12 | { 13 | [SerializeField] 14 | [Tooltip("The library of CurvePresets that can be used by this component.")] 15 | private CurveLibrary curveLibrary; 16 | 17 | [SerializeField] 18 | [Tooltip("The name (key) of the CurvePreset this animation should use.")] 19 | private string curvePresetKey; 20 | 21 | private CurvePreset curvePreset; 22 | 23 | private float timeAnimationStarted; 24 | 25 | /// 26 | /// Load a particular CurvePreset animation into this Component 27 | /// 28 | /// The library of CurvePresets that can be used by this component 29 | /// The name (key) of the CurvePreset this animation should use 30 | public void LoadPreset(CurveLibrary library, string presetKey) 31 | { 32 | this.curveLibrary = library; 33 | this.curvePresetKey = presetKey; 34 | this.curvePreset = library[presetKey]; 35 | } 36 | 37 | protected override void OnEnable() 38 | { 39 | if (this.curveLibrary != null && !string.IsNullOrEmpty(this.curvePresetKey)) 40 | { 41 | LoadPreset(this.curveLibrary, this.curvePresetKey); 42 | } 43 | 44 | this.timeAnimationStarted = this.TimeForTimeScale; 45 | base.OnEnable(); 46 | } 47 | 48 | protected override void Animate(int characterIndex, out Vector2 translation, out float rotation, out float scale) 49 | { 50 | translation = Vector2.zero; 51 | rotation = 0f; 52 | scale = 1f; 53 | 54 | // Do nothing if a CurvePreset has not been configured yet 55 | if (this.curvePreset == null) 56 | { 57 | return; 58 | } 59 | 60 | if (characterIndex >= this.FirstCharToAnimate && characterIndex <= this.LastCharToAnimate) 61 | { 62 | // Calculate a t based on time since the animation started, 63 | // but offset per character (to produce wave effects) 64 | float t = this.TimeForTimeScale - this.timeAnimationStarted + (characterIndex * this.curvePreset.timeOffsetPerChar); 65 | 66 | float xPos = this.curvePreset.xPosCurve.Evaluate(t) * this.curvePreset.xPosMultiplier; 67 | float yPos = this.curvePreset.yPosCurve.Evaluate(t) * this.curvePreset.yPosMultiplier; 68 | 69 | translation = new Vector2(xPos, yPos); 70 | 71 | rotation = this.curvePreset.rotationCurve.Evaluate(t) * this.curvePreset.rotationMultiplier; 72 | scale += this.curvePreset.scaleCurve.Evaluate(t) * this.curvePreset.scaleMultiplier; 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: LiberationSans SDF - Outline 10 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 11 | m_ShaderKeywords: OUTLINE_ON 12 | m_LightmapFlags: 5 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: 3000 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _Cube: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _FaceTex: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _MainTex: 34 | m_Texture: {fileID: 2846298, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _OutlineTex: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | m_Floats: 42 | - _Ambient: 0.5 43 | - _Bevel: 0.5 44 | - _BevelClamp: 0 45 | - _BevelOffset: 0 46 | - _BevelRoundness: 0 47 | - _BevelWidth: 0 48 | - _BumpFace: 0 49 | - _BumpOutline: 0 50 | - _ColorMask: 15 51 | - _Diffuse: 0.5 52 | - _FaceDilate: 0.1 53 | - _FaceUVSpeedX: 0 54 | - _FaceUVSpeedY: 0 55 | - _GlowInner: 0.05 56 | - _GlowOffset: 0 57 | - _GlowOuter: 0.05 58 | - _GlowPower: 0.75 59 | - _GradientScale: 10 60 | - _LightAngle: 3.1416 61 | - _MaskSoftnessX: 0 62 | - _MaskSoftnessY: 0 63 | - _OutlineSoftness: 0 64 | - _OutlineUVSpeedX: 0 65 | - _OutlineUVSpeedY: 0 66 | - _OutlineWidth: 0.1 67 | - _PerspectiveFilter: 0.875 68 | - _Reflectivity: 10 69 | - _ScaleRatioA: 0.9 70 | - _ScaleRatioB: 0.73125 71 | - _ScaleRatioC: 0.64125 72 | - _ScaleX: 1 73 | - _ScaleY: 1 74 | - _ShaderFlags: 0 75 | - _SpecularPower: 2 76 | - _Stencil: 0 77 | - _StencilComp: 8 78 | - _StencilOp: 0 79 | - _StencilReadMask: 255 80 | - _StencilWriteMask: 255 81 | - _TextureHeight: 1024 82 | - _TextureWidth: 1024 83 | - _UnderlayDilate: 0 84 | - _UnderlayOffsetX: 0 85 | - _UnderlayOffsetY: 0 86 | - _UnderlaySoftness: 0 87 | - _VertexOffsetX: 0 88 | - _VertexOffsetY: 0 89 | - _WeightBold: 0.75 90 | - _WeightNormal: 0 91 | m_Colors: 92 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 93 | - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} 94 | - _FaceColor: {r: 1, g: 1, b: 1, a: 1} 95 | - _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} 96 | - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} 97 | - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} 98 | - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} 99 | - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} 100 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 101 | - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Unity-TextTyper 2 | ========================= 3 | 4 | TextTyper is a text typing effect component for Unity. TextTyper prints out characters one by one to a uGUI Text component. Adapted by RedBlueGames from synchrok's GitHub project (https://github.com/synchrok/TypeText). 5 | 6 | It's easy to find other examples of Text printing components, but TextTyper provides two major differences: 7 | * Correct wrapping as characters are printed 8 | * Support for Rich Text Tags 9 | 10 | **Note this verison of TextTyper requires TextMeshPro, which can be installed for free from the Package Manager in Unity 2018, or the Asset Store in older versions. If you want the version that is compatible with Unity's uGUI Text component, [this branch](https://github.com/redbluegames/unity-text-typer/tree/ugui-text-typer) or download [this release](https://github.com/redbluegames/unity-text-typer/releases/tag/v1.2).** 11 | 12 | How To Use 13 | -------- 14 | To start TextTyping all you need to do is add the `TextTyper` component to a unity Text widget: 15 | 16 | 1. Create a GameObject with a Unity UI Text Widget, as normal. 17 | 2. Add a TextTyper component to the GameObject. 18 | 3. Call the TextTyper component's public functions ```TypeText``` and ```Skip``` to print the desired text with the specified delay. We call these from a 3rd component we call `Talker`. 19 | 20 | You can optionally subscribe to the `PrintCompleted` and `CharacterPrinted` [UnityEvents](https://docs.unity3d.com/ScriptReference/Events.UnityEvent.AddListener.html) to add additional feedback like sounds and paging widgets. 21 | 22 | Features 23 | -------- 24 | - **Define Text Speed Per Character**: ```Mayday! S.O.S.``` 25 | - **Support for uGUI Rich Text Tags**: ```,,,,...``` 26 | - **Additional delay for punctuation** 27 | - **Skip to end** 28 | - **OnComplete Callback** 29 | - **OnCharacterPrinted Callback (for audio)** 30 | 31 | Screenshots 32 | -------- 33 | ![TypeText Screenshot GIF](https://github.com/redbluegames/unity-text-typer/blob/master/README-Images/ss_chat_watermarked.gif) 34 | Image of TextTyper in Sparklite (© RedBlueGames 2016) 35 | 36 | The Code 37 | -------- 38 | The core of our text typer is a coroutine that’s triggered via the TypeText method. The coroutine has the following steps: 39 | Check next character to see if it’s the start of a Rich Text tag 40 | - If It’s a tag, parse it and apply it. Right now “applying” a tag just means modifying the print delay, but other tags could be added. Add it to a list of tags that need to be closed (because we have not yet reached the corresponding closing tag in our string). Move to next character and repeat 41 | - If it’s not a tag, print it 42 | - Wait for the print delay 43 | - Check if we are complete 44 | 45 | The tool also uses RichTextTag.cs, a class that’s used to help with parsing. 46 | There are a few details I left out, but this should give you enough to start reading through the code if you want to know more. 47 | 48 | How to Help 49 | ------- 50 | The easiest way to help with the project is to just to use it! As you use it, you can submit bugs and feature requests through GitHub issues. 51 | 52 | Contributors 53 | ------- 54 | **Issue Resporters** 55 | - JonathanGorr 56 | 57 | License and Credits 58 | ------- 59 | - **TypeText** is under MIT license. See the [LICENSE](LICENSE) file for more info. 60 | - Typing sound effect (UITextDisplay.wav) provided by @kevinrmabie. Free for others to use, no attribution necessary. 61 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: LiberationSans SDF - Drop Shadow 10 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 11 | m_ShaderKeywords: OUTLINE_ON UNDERLAY_ON 12 | m_LightmapFlags: 5 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _Cube: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _FaceTex: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _MainTex: 34 | m_Texture: {fileID: 2846298, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _OutlineTex: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | m_Floats: 42 | - _Ambient: 0.5 43 | - _Bevel: 0.5 44 | - _BevelClamp: 0 45 | - _BevelOffset: 0 46 | - _BevelRoundness: 0 47 | - _BevelWidth: 0 48 | - _BumpFace: 0 49 | - _BumpOutline: 0 50 | - _ColorMask: 15 51 | - _Diffuse: 0.5 52 | - _DiffusePower: 1 53 | - _FaceDilate: 0.1 54 | - _FaceUVSpeedX: 0 55 | - _FaceUVSpeedY: 0 56 | - _GlowInner: 0.05 57 | - _GlowOffset: 0 58 | - _GlowOuter: 0.05 59 | - _GlowPower: 0.75 60 | - _GradientScale: 10 61 | - _LightAngle: 3.1416 62 | - _MaskSoftnessX: 0 63 | - _MaskSoftnessY: 0 64 | - _OutlineSoftness: 0 65 | - _OutlineUVSpeedX: 0 66 | - _OutlineUVSpeedY: 0 67 | - _OutlineWidth: 0.1 68 | - _PerspectiveFilter: 0.875 69 | - _Reflectivity: 10 70 | - _ScaleRatioA: 0.9 71 | - _ScaleRatioB: 0.73125 72 | - _ScaleRatioC: 0.64125 73 | - _ScaleX: 1 74 | - _ScaleY: 1 75 | - _ShaderFlags: 0 76 | - _SpecularPower: 2 77 | - _Stencil: 0 78 | - _StencilComp: 8 79 | - _StencilOp: 0 80 | - _StencilReadMask: 255 81 | - _StencilWriteMask: 255 82 | - _TextureHeight: 1024 83 | - _TextureWidth: 1024 84 | - _UnderlayDilate: 0 85 | - _UnderlayOffsetX: 0.5 86 | - _UnderlayOffsetY: -0.5 87 | - _UnderlaySoftness: 0.05 88 | - _VertexOffsetX: 0 89 | - _VertexOffsetY: 0 90 | - _WeightBold: 0.75 91 | - _WeightNormal: 0 92 | m_Colors: 93 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 94 | - _Color: {r: 1, g: 1, b: 1, a: 1} 95 | - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} 96 | - _FaceColor: {r: 1, g: 1, b: 1, a: 1} 97 | - _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} 98 | - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} 99 | - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} 100 | - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} 101 | - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} 102 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 103 | - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} 104 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Tests/Editor/TextTagParserTests.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper.Tests 2 | { 3 | using UnityEditor; 4 | using UnityEngine; 5 | //using RedBlueGames.Tools.TextTyper; 6 | using NUnit.Framework; 7 | 8 | public class TextTagParserTests 9 | { 10 | private static readonly string[] UnityTags = new string[] 11 | { 12 | "b", 13 | "i", 14 | "s", 15 | "u", 16 | "br", 17 | "nobr", 18 | "size", 19 | "color", 20 | "style", 21 | "width", 22 | "align", 23 | "alpha", 24 | "cspace", 25 | "font", 26 | "indent", 27 | "line-height", 28 | "line-indent", 29 | "link", 30 | "lowercase", 31 | "uppercase", 32 | "smallcaps", 33 | "margin", 34 | "mark", 35 | "mspace", 36 | "noparse", 37 | "page", 38 | "pos", 39 | "space", 40 | "sprite", 41 | "sup", 42 | "sub", 43 | "voffset", 44 | "gradient" 45 | }; 46 | 47 | [Test] 48 | public void RemoveCustomTags_EmptyString_ReturnsEmpty() 49 | { 50 | var textToType = string.Empty; 51 | var generatedText = TextTagParser.RemoveCustomTags(textToType); 52 | 53 | var expectedText = textToType; 54 | 55 | Assert.AreEqual(expectedText, generatedText); 56 | } 57 | 58 | [Test] 59 | public void RemoveCustomTags_OnlyUnityRichTextTags_ReturnsUnityTags() 60 | { 61 | var textToType = ""; 62 | var generatedText = TextTagParser.RemoveCustomTags(textToType); 63 | 64 | var expectedText = textToType; 65 | 66 | Assert.AreEqual(expectedText, generatedText); 67 | } 68 | 69 | [Test] 70 | public void RemoveCustomTags_OnlyCustomRichTextTags_ReturnsEmpty() 71 | { 72 | var textToType = ""; 73 | var generatedText = TextTagParser.RemoveCustomTags(textToType); 74 | 75 | var expectedText = string.Empty; 76 | 77 | Assert.AreEqual(expectedText, generatedText); 78 | } 79 | 80 | [Test] 81 | public void RemoveUnityTags_AllUnityTags_ReturnsNoTags() 82 | { 83 | var builder = new System.Text.StringBuilder(); 84 | var expectedTextBuilder = new System.Text.StringBuilder(); 85 | 86 | for (int i = 0; i < UnityTags.Length; ++i) 87 | { 88 | var tag = UnityTags[i]; 89 | builder.Append($"<{tag}>{i}"); 90 | expectedTextBuilder.Append($"{i}"); 91 | } 92 | 93 | var textToType = builder.ToString(); 94 | var generatedText = TextTagParser.RemoveUnityTags(textToType); 95 | 96 | var expectedText = expectedTextBuilder.ToString(); 97 | 98 | Assert.AreEqual(expectedText, generatedText); 99 | } 100 | 101 | [Test] 102 | public void RemoveUnityTags_SpriteTagWithValue_ReturnsTaglessText() 103 | { 104 | var builder = new System.Text.StringBuilder(); 105 | var textToType = "This string has a sprite."; 106 | var generatedText = TextTagParser.RemoveUnityTags(textToType); 107 | 108 | var expectedText = "This string has a sprite."; 109 | 110 | Assert.AreEqual(expectedText, generatedText); 111 | } 112 | } 113 | } -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/TMP Settings.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: 2705215ac5b84b70bacc50632be6e391, type: 3} 12 | m_Name: TMP Settings 13 | m_EditorClassIdentifier: 14 | m_enableWordWrapping: 1 15 | m_enableKerning: 1 16 | m_enableExtraPadding: 0 17 | m_enableTintAllSprites: 0 18 | m_enableParseEscapeCharacters: 1 19 | m_missingGlyphCharacter: 0 20 | m_warningsDisabled: 0 21 | m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 22 | m_defaultFontAssetPath: Fonts & Materials/ 23 | m_defaultFontSize: 36 24 | m_defaultAutoSizeMinRatio: 0.5 25 | m_defaultAutoSizeMaxRatio: 2 26 | m_defaultTextMeshProTextContainerSize: {x: 20, y: 5} 27 | m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50} 28 | m_autoSizeTextContainer: 0 29 | m_fallbackFontAssets: [] 30 | m_matchMaterialPreset: 1 31 | m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, 32 | type: 2} 33 | m_defaultSpriteAssetPath: Sprite Assets/ 34 | m_defaultColorGradientPresetsPath: Color Gradient Presets/ 35 | m_enableEmojiSupport: 1 36 | m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, 37 | type: 2} 38 | m_leadingCharacters: {fileID: 4900000, guid: d82c1b31c7e74239bff1220585707d2b, type: 3} 39 | m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b, 40 | type: 3} 41 | m_FontCreatorRecentSettings: 42 | - sourceFontFileName: 43 | sourceFontFileGUID: edcaa01543603ae4cb6b2edf25967e21 44 | pointSizeSamplingMode: 1 45 | pointSize: 109 46 | padding: 12 47 | packingMode: 0 48 | atlasWidth: 128 49 | atlasHeight: 128 50 | characterSetSelectionMode: 5 51 | characterSequence: 64 52 | fontStyle: 0 53 | fontStyleModifier: 2 54 | renderMode: 281 55 | includeFontFeatures: 0 56 | referenceFontAssetGUID: 903613a9fe4b65946aa20dfcce07abec 57 | - sourceFontFileName: 58 | sourceFontFileGUID: edcaa01543603ae4cb6b2edf25967e21 59 | pointSizeSamplingMode: 0 60 | pointSize: 108 61 | padding: 12 62 | packingMode: 0 63 | atlasWidth: 128 64 | atlasHeight: 128 65 | characterSetSelectionMode: 5 66 | characterSequence: 64 67 | fontStyle: 0 68 | fontStyleModifier: 2 69 | renderMode: 2090 70 | includeFontFeatures: 0 71 | referenceFontAssetGUID: 70cf10c1d306ada42aa6cd7268db990d 72 | - sourceFontFileName: 73 | sourceFontFileGUID: edcaa01543603ae4cb6b2edf25967e21 74 | pointSizeSamplingMode: 1 75 | pointSize: 109 76 | padding: 12 77 | packingMode: 0 78 | atlasWidth: 128 79 | atlasHeight: 128 80 | characterSetSelectionMode: 5 81 | characterSequence: 64 82 | fontStyle: 0 83 | fontStyleModifier: 2 84 | renderMode: 329 85 | includeFontFeatures: 0 86 | referenceFontAssetGUID: 396d465a5821ead47b589b228da7e980 87 | - sourceFontFileName: 88 | sourceFontFileGUID: edcaa01543603ae4cb6b2edf25967e21 89 | pointSizeSamplingMode: 1 90 | pointSize: 338 91 | padding: 36 92 | packingMode: 0 93 | atlasWidth: 4096 94 | atlasHeight: 4096 95 | characterSetSelectionMode: 1 96 | characterSequence: 32 - 126, 160 - 255, 8192 - 8303, 8364, 8482, 9633 97 | fontStyle: 0 98 | fontStyleModifier: 2 99 | renderMode: 329 100 | includeFontFeatures: 0 101 | referenceFontAssetGUID: 3a4171c252e1112499af739474d9f48e 102 | m_CreationSettingsSelectionIndex: 0 103 | m_CreationSettingsIndex: 0 104 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface-Mobile.shader: -------------------------------------------------------------------------------- 1 | // Simplified version of the SDF Surface shader : 2 | // - No support for Bevel, Bump or envmap 3 | // - Diffuse only lighting 4 | // - Fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field (Surface)" { 7 | 8 | Properties { 9 | _FaceTex ("Fill Texture", 2D) = "white" {} 10 | _FaceColor ("Fill Color", Color) = (1,1,1,1) 11 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 12 | 13 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 14 | _OutlineTex ("Outline Texture", 2D) = "white" {} 15 | _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 16 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 17 | 18 | _GlowColor ("Color", Color) = (0, 1, 0, 0.5) 19 | _GlowOffset ("Offset", Range(-1,1)) = 0 20 | _GlowInner ("Inner", Range(0,1)) = 0.05 21 | _GlowOuter ("Outer", Range(0,1)) = 0.05 22 | _GlowPower ("Falloff", Range(1, 0)) = 0.75 23 | 24 | _WeightNormal ("Weight Normal", float) = 0 25 | _WeightBold ("Weight Bold", float) = 0.5 26 | 27 | // Should not be directly exposed to the user 28 | _ShaderFlags ("Flags", float) = 0 29 | _ScaleRatioA ("Scale RatioA", float) = 1 30 | _ScaleRatioB ("Scale RatioB", float) = 1 31 | _ScaleRatioC ("Scale RatioC", float) = 1 32 | 33 | _MainTex ("Font Atlas", 2D) = "white" {} 34 | _TextureWidth ("Texture Width", float) = 512 35 | _TextureHeight ("Texture Height", float) = 512 36 | _GradientScale ("Gradient Scale", float) = 5.0 37 | _ScaleX ("Scale X", float) = 1.0 38 | _ScaleY ("Scale Y", float) = 1.0 39 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 40 | 41 | _VertexOffsetX ("Vertex OffsetX", float) = 0 42 | _VertexOffsetY ("Vertex OffsetY", float) = 0 43 | 44 | //_MaskCoord ("Mask Coords", vector) = (0,0,0,0) 45 | //_MaskSoftness ("Mask Softness", float) = 0 46 | } 47 | 48 | SubShader { 49 | 50 | Tags { 51 | "Queue"="Transparent" 52 | "IgnoreProjector"="True" 53 | "RenderType"="Transparent" 54 | } 55 | 56 | LOD 300 57 | Cull [_CullMode] 58 | 59 | CGPROGRAM 60 | #pragma surface PixShader Lambert alpha:blend vertex:VertShader noforwardadd nolightmap nodirlightmap 61 | #pragma target 3.0 62 | #pragma shader_feature __ GLOW_ON 63 | 64 | #include "TMPro_Properties.cginc" 65 | #include "TMPro.cginc" 66 | 67 | half _FaceShininess; 68 | half _OutlineShininess; 69 | 70 | struct Input 71 | { 72 | fixed4 color : COLOR; 73 | float2 uv_MainTex; 74 | float2 uv2_FaceTex; 75 | float2 uv2_OutlineTex; 76 | float2 param; // Weight, Scale 77 | float3 viewDirEnv; 78 | }; 79 | 80 | #include "TMPro_Surface.cginc" 81 | 82 | ENDCG 83 | 84 | // Pass to render object as a shadow caster 85 | Pass 86 | { 87 | Name "Caster" 88 | Tags { "LightMode" = "ShadowCaster" } 89 | Offset 1, 1 90 | 91 | Fog {Mode Off} 92 | ZWrite On ZTest LEqual Cull Off 93 | 94 | CGPROGRAM 95 | #pragma vertex vert 96 | #pragma fragment frag 97 | #pragma multi_compile_shadowcaster 98 | #include "UnityCG.cginc" 99 | 100 | struct v2f { 101 | V2F_SHADOW_CASTER; 102 | float2 uv : TEXCOORD1; 103 | float2 uv2 : TEXCOORD3; 104 | float alphaClip : TEXCOORD2; 105 | }; 106 | 107 | uniform float4 _MainTex_ST; 108 | uniform float4 _OutlineTex_ST; 109 | float _OutlineWidth; 110 | float _FaceDilate; 111 | float _ScaleRatioA; 112 | 113 | v2f vert( appdata_base v ) 114 | { 115 | v2f o; 116 | TRANSFER_SHADOW_CASTER(o) 117 | o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); 118 | o.uv2 = TRANSFORM_TEX(v.texcoord, _OutlineTex); 119 | o.alphaClip = o.alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _FaceDilate * _ScaleRatioA) / 2; 120 | return o; 121 | } 122 | 123 | uniform sampler2D _MainTex; 124 | 125 | float4 frag(v2f i) : COLOR 126 | { 127 | fixed4 texcol = tex2D(_MainTex, i.uv).a; 128 | clip(texcol.a - i.alphaClip); 129 | SHADOW_CASTER_FRAGMENT(i) 130 | } 131 | ENDCG 132 | } 133 | } 134 | 135 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 136 | } 137 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Bitmap" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _FaceTex ("Font Texture", 2D) = "white" {} 6 | _FaceColor ("Text Color", Color) = (1,1,1,1) 7 | 8 | _VertexOffsetX ("Vertex OffsetX", float) = 0 9 | _VertexOffsetY ("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | 15 | _StencilComp("Stencil Comparison", Float) = 8 16 | _Stencil("Stencil ID", Float) = 0 17 | _StencilOp("Stencil Operation", Float) = 0 18 | _StencilWriteMask("Stencil Write Mask", Float) = 255 19 | _StencilReadMask("Stencil Read Mask", Float) = 255 20 | 21 | _ColorMask("Color Mask", Float) = 15 22 | } 23 | 24 | SubShader{ 25 | 26 | Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 27 | 28 | Stencil 29 | { 30 | Ref[_Stencil] 31 | Comp[_StencilComp] 32 | Pass[_StencilOp] 33 | ReadMask[_StencilReadMask] 34 | WriteMask[_StencilWriteMask] 35 | } 36 | 37 | 38 | Lighting Off 39 | Cull [_CullMode] 40 | ZTest [unity_GUIZTestMode] 41 | ZWrite Off 42 | Fog { Mode Off } 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask[_ColorMask] 45 | 46 | Pass { 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | 51 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 52 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 53 | 54 | 55 | #include "UnityCG.cginc" 56 | 57 | struct appdata_t { 58 | float4 vertex : POSITION; 59 | fixed4 color : COLOR; 60 | float2 texcoord0 : TEXCOORD0; 61 | float2 texcoord1 : TEXCOORD1; 62 | }; 63 | 64 | struct v2f { 65 | float4 vertex : SV_POSITION; 66 | fixed4 color : COLOR; 67 | float2 texcoord0 : TEXCOORD0; 68 | float2 texcoord1 : TEXCOORD1; 69 | float4 mask : TEXCOORD2; 70 | }; 71 | 72 | uniform sampler2D _MainTex; 73 | uniform sampler2D _FaceTex; 74 | uniform float4 _FaceTex_ST; 75 | uniform fixed4 _FaceColor; 76 | 77 | uniform float _VertexOffsetX; 78 | uniform float _VertexOffsetY; 79 | uniform float4 _ClipRect; 80 | uniform float _MaskSoftnessX; 81 | uniform float _MaskSoftnessY; 82 | 83 | float2 UnpackUV(float uv) 84 | { 85 | float2 output; 86 | output.x = floor(uv / 4096); 87 | output.y = uv - 4096 * output.x; 88 | 89 | return output * 0.001953125; 90 | } 91 | 92 | v2f vert (appdata_t v) 93 | { 94 | float4 vert = v.vertex; 95 | vert.x += _VertexOffsetX; 96 | vert.y += _VertexOffsetY; 97 | 98 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 99 | 100 | float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); 101 | 102 | fixed4 faceColor = v.color; 103 | faceColor *= _FaceColor; 104 | 105 | v2f OUT; 106 | OUT.vertex = vPosition; 107 | OUT.color = faceColor; 108 | OUT.texcoord0 = v.texcoord0; 109 | OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex); 110 | float2 pixelSize = vPosition.w; 111 | pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 112 | 113 | // Clamp _ClipRect to 16bit. 114 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 115 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); 116 | 117 | return OUT; 118 | } 119 | 120 | fixed4 frag (v2f IN) : SV_Target 121 | { 122 | fixed4 color = tex2D(_MainTex, IN.texcoord0); 123 | color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, IN.color.a * color.a); 124 | 125 | // Alternative implementation to UnityGet2DClipping with support for softness. 126 | #if UNITY_UI_CLIP_RECT 127 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 128 | color *= m.x * m.y; 129 | #endif 130 | 131 | #if UNITY_UI_ALPHACLIP 132 | clip(color.a - 0.001); 133 | #endif 134 | 135 | return color; 136 | } 137 | ENDCG 138 | } 139 | } 140 | 141 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 142 | } 143 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Custom-Atlas.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Bitmap Custom Atlas" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _FaceTex ("Font Texture", 2D) = "white" {} 6 | _FaceColor ("Text Color", Color) = (1,1,1,1) 7 | 8 | _VertexOffsetX ("Vertex OffsetX", float) = 0 9 | _VertexOffsetY ("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | _Padding ("Padding", float) = 0 15 | 16 | _StencilComp("Stencil Comparison", Float) = 8 17 | _Stencil("Stencil ID", Float) = 0 18 | _StencilOp("Stencil Operation", Float) = 0 19 | _StencilWriteMask("Stencil Write Mask", Float) = 255 20 | _StencilReadMask("Stencil Read Mask", Float) = 255 21 | 22 | _ColorMask("Color Mask", Float) = 15 23 | } 24 | 25 | SubShader{ 26 | 27 | Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 28 | 29 | Stencil 30 | { 31 | Ref[_Stencil] 32 | Comp[_StencilComp] 33 | Pass[_StencilOp] 34 | ReadMask[_StencilReadMask] 35 | WriteMask[_StencilWriteMask] 36 | } 37 | 38 | 39 | Lighting Off 40 | Cull [_CullMode] 41 | ZTest [unity_GUIZTestMode] 42 | ZWrite Off 43 | Fog { Mode Off } 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask[_ColorMask] 46 | 47 | Pass { 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | 52 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 53 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 54 | 55 | 56 | #include "UnityCG.cginc" 57 | 58 | struct appdata_t { 59 | float4 vertex : POSITION; 60 | fixed4 color : COLOR; 61 | float2 texcoord0 : TEXCOORD0; 62 | float2 texcoord1 : TEXCOORD1; 63 | }; 64 | 65 | struct v2f { 66 | float4 vertex : SV_POSITION; 67 | fixed4 color : COLOR; 68 | float2 texcoord0 : TEXCOORD0; 69 | float2 texcoord1 : TEXCOORD1; 70 | float4 mask : TEXCOORD2; 71 | }; 72 | 73 | uniform sampler2D _MainTex; 74 | uniform sampler2D _FaceTex; 75 | uniform float4 _FaceTex_ST; 76 | uniform fixed4 _FaceColor; 77 | 78 | uniform float _VertexOffsetX; 79 | uniform float _VertexOffsetY; 80 | uniform float4 _ClipRect; 81 | uniform float _MaskSoftnessX; 82 | uniform float _MaskSoftnessY; 83 | 84 | float2 UnpackUV(float uv) 85 | { 86 | float2 output; 87 | output.x = floor(uv / 4096); 88 | output.y = uv - 4096 * output.x; 89 | 90 | return output * 0.001953125; 91 | } 92 | 93 | v2f vert (appdata_t v) 94 | { 95 | float4 vert = v.vertex; 96 | vert.x += _VertexOffsetX; 97 | vert.y += _VertexOffsetY; 98 | 99 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 100 | 101 | float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); 102 | 103 | fixed4 faceColor = v.color; 104 | faceColor *= _FaceColor; 105 | 106 | v2f OUT; 107 | OUT.vertex = vPosition; 108 | OUT.color = faceColor; 109 | OUT.texcoord0 = v.texcoord0; 110 | OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex); 111 | float2 pixelSize = vPosition.w; 112 | pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 113 | 114 | // Clamp _ClipRect to 16bit. 115 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 116 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); 117 | 118 | return OUT; 119 | } 120 | 121 | fixed4 frag (v2f IN) : SV_Target 122 | { 123 | fixed4 color = tex2D(_MainTex, IN.texcoord0) * tex2D(_FaceTex, IN.texcoord1) * IN.color; 124 | 125 | // Alternative implementation to UnityGet2DClipping with support for softness. 126 | #if UNITY_UI_CLIP_RECT 127 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 128 | color *= m.x * m.y; 129 | #endif 130 | 131 | #if UNITY_UI_ALPHACLIP 132 | clip(color.a - 0.001); 133 | #endif 134 | 135 | return color; 136 | } 137 | ENDCG 138 | } 139 | } 140 | 141 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 142 | } 143 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Mobile.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Mobile/Bitmap" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _Color ("Text Color", Color) = (1,1,1,1) 6 | _DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0 7 | 8 | _VertexOffsetX("Vertex OffsetX", float) = 0 9 | _VertexOffsetY("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | 15 | _StencilComp("Stencil Comparison", Float) = 8 16 | _Stencil("Stencil ID", Float) = 0 17 | _StencilOp("Stencil Operation", Float) = 0 18 | _StencilWriteMask("Stencil Write Mask", Float) = 255 19 | _StencilReadMask("Stencil Read Mask", Float) = 255 20 | 21 | _ColorMask("Color Mask", Float) = 15 22 | } 23 | 24 | SubShader { 25 | 26 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 27 | 28 | Stencil 29 | { 30 | Ref[_Stencil] 31 | Comp[_StencilComp] 32 | Pass[_StencilOp] 33 | ReadMask[_StencilReadMask] 34 | WriteMask[_StencilWriteMask] 35 | } 36 | 37 | 38 | Lighting Off 39 | Cull Off 40 | ZTest [unity_GUIZTestMode] 41 | ZWrite Off 42 | Fog { Mode Off } 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask[_ColorMask] 45 | 46 | Pass { 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #pragma fragmentoption ARB_precision_hint_fastest 51 | 52 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 53 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 54 | 55 | 56 | #include "UnityCG.cginc" 57 | 58 | struct appdata_t { 59 | float4 vertex : POSITION; 60 | fixed4 color : COLOR; 61 | float2 texcoord0 : TEXCOORD0; 62 | float2 texcoord1 : TEXCOORD1; 63 | }; 64 | 65 | struct v2f { 66 | float4 vertex : POSITION; 67 | fixed4 color : COLOR; 68 | float2 texcoord0 : TEXCOORD0; 69 | float4 mask : TEXCOORD2; 70 | }; 71 | 72 | sampler2D _MainTex; 73 | fixed4 _Color; 74 | float _DiffusePower; 75 | 76 | uniform float _VertexOffsetX; 77 | uniform float _VertexOffsetY; 78 | uniform float4 _ClipRect; 79 | uniform float _MaskSoftnessX; 80 | uniform float _MaskSoftnessY; 81 | 82 | v2f vert (appdata_t v) 83 | { 84 | v2f OUT; 85 | float4 vert = v.vertex; 86 | vert.x += _VertexOffsetX; 87 | vert.y += _VertexOffsetY; 88 | 89 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 90 | 91 | OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert)); 92 | OUT.color = v.color; 93 | OUT.color *= _Color; 94 | OUT.color.rgb *= _DiffusePower; 95 | OUT.texcoord0 = v.texcoord0; 96 | 97 | float2 pixelSize = OUT.vertex.w; 98 | //pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 99 | 100 | // Clamp _ClipRect to 16bit. 101 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 102 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)); 103 | 104 | return OUT; 105 | } 106 | 107 | fixed4 frag (v2f IN) : COLOR 108 | { 109 | fixed4 color = fixed4(IN.color.rgb, IN.color.a * tex2D(_MainTex, IN.texcoord0).a); 110 | 111 | // Alternative implementation to UnityGet2DClipping with support for softness. 112 | #if UNITY_UI_CLIP_RECT 113 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 114 | color *= m.x * m.y; 115 | #endif 116 | 117 | #if UNITY_UI_ALPHACLIP 118 | clip(color.a - 0.001); 119 | #endif 120 | 121 | return color; 122 | } 123 | ENDCG 124 | } 125 | } 126 | 127 | SubShader { 128 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 129 | Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off } 130 | Blend SrcAlpha OneMinusSrcAlpha 131 | BindChannels { 132 | Bind "Color", color 133 | Bind "Vertex", vertex 134 | Bind "TexCoord", texcoord0 135 | } 136 | Pass { 137 | SetTexture [_MainTex] { 138 | constantColor [_Color] combine constant * primary, constant * texture 139 | } 140 | } 141 | } 142 | 143 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 144 | } 145 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMPro_Surface.cginc: -------------------------------------------------------------------------------- 1 | void VertShader(inout appdata_full v, out Input data) 2 | { 3 | v.vertex.x += _VertexOffsetX; 4 | v.vertex.y += _VertexOffsetY; 5 | 6 | UNITY_INITIALIZE_OUTPUT(Input, data); 7 | 8 | float bold = step(v.texcoord1.y, 0); 9 | 10 | // Generate normal for backface 11 | float3 view = ObjSpaceViewDir(v.vertex); 12 | v.normal *= sign(dot(v.normal, view)); 13 | 14 | #if USE_DERIVATIVE 15 | data.param.y = 1; 16 | #else 17 | float4 vert = v.vertex; 18 | float4 vPosition = UnityObjectToClipPos(vert); 19 | float2 pixelSize = vPosition.w; 20 | 21 | pixelSize /= float2(_ScaleX, _ScaleY) * mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy); 22 | float scale = rsqrt(dot(pixelSize, pixelSize)); 23 | scale *= abs(v.texcoord1.y) * _GradientScale * 1.5; 24 | scale = lerp(scale * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(v.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 25 | data.param.y = scale; 26 | #endif 27 | 28 | //float opacity = v.color.a; 29 | 30 | data.param.x = (lerp(_WeightNormal, _WeightBold, bold) / 4.0 + _FaceDilate) * _ScaleRatioA * 0.5; // 31 | 32 | v.texcoord1.xy = UnpackUV(v.texcoord1.x); 33 | data.viewDirEnv = mul((float3x3)_EnvMatrix, WorldSpaceViewDir(v.vertex)); 34 | } 35 | 36 | void PixShader(Input input, inout SurfaceOutput o) 37 | { 38 | 39 | #if USE_DERIVATIVE | BEVEL_ON 40 | float3 delta = float3(1.0 / _TextureWidth, 1.0 / _TextureHeight, 0.0); 41 | 42 | float4 smp4x = { tex2D(_MainTex, input.uv_MainTex - delta.xz).a, 43 | tex2D(_MainTex, input.uv_MainTex + delta.xz).a, 44 | tex2D(_MainTex, input.uv_MainTex - delta.zy).a, 45 | tex2D(_MainTex, input.uv_MainTex + delta.zy).a }; 46 | #endif 47 | 48 | #if USE_DERIVATIVE 49 | // Screen space scaling reciprocal with anisotropic correction 50 | float2 edgeNormal = Normalize(float2(smp4x.x - smp4x.y, smp4x.z - smp4x.w)); 51 | float2 res = float2(_TextureWidth * input.param.y, _TextureHeight); 52 | float2 tdx = ddx(input.uv_MainTex)*res; 53 | float2 tdy = ddy(input.uv_MainTex)*res; 54 | float lx = length(tdx); 55 | float ly = length(tdy); 56 | float s = sqrt(min(lx, ly) / max(lx, ly)); 57 | s = lerp(1, s, abs(dot(normalize(tdx + tdy), edgeNormal))); 58 | float scale = rsqrt(abs(tdx.x * tdy.y - tdx.y * tdy.x)) * (_GradientScale * 2) * s; 59 | #else 60 | float scale = input.param.y; 61 | #endif 62 | 63 | // Signed distance 64 | float c = tex2D(_MainTex, input.uv_MainTex).a; 65 | float sd = (.5 - c - input.param.x) * scale + .5; 66 | float outline = _OutlineWidth*_ScaleRatioA * scale; 67 | float softness = _OutlineSoftness*_ScaleRatioA * scale; 68 | 69 | // Color & Alpha 70 | float4 faceColor = _FaceColor; 71 | float4 outlineColor = _OutlineColor; 72 | faceColor *= input.color; 73 | outlineColor.a *= input.color.a; 74 | faceColor *= tex2D(_FaceTex, float2(input.uv2_FaceTex.x + _FaceUVSpeedX * _Time.y, input.uv2_FaceTex.y + _FaceUVSpeedY * _Time.y)); 75 | outlineColor *= tex2D(_OutlineTex, float2(input.uv2_OutlineTex.x + _OutlineUVSpeedX * _Time.y, input.uv2_OutlineTex.y + _OutlineUVSpeedY * _Time.y)); 76 | faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); 77 | faceColor.rgb /= max(faceColor.a, 0.0001); 78 | 79 | 80 | #if BEVEL_ON 81 | // Face Normal 82 | float3 n = GetSurfaceNormal(smp4x, input.param.x); 83 | 84 | // Bumpmap 85 | float3 bump = UnpackNormal(tex2D(_BumpMap, input.uv2_FaceTex.xy)).xyz; 86 | bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5)); 87 | bump = lerp(float3(0, 0, 1), bump, faceColor.a); 88 | n = normalize(n - bump); 89 | 90 | // Cubemap reflection 91 | fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDirEnv, mul((float3x3)unity_ObjectToWorld, n))); 92 | float3 emission = reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; 93 | #else 94 | float3 n = float3(0, 0, -1); 95 | float3 emission = float3(0, 0, 0); 96 | #endif 97 | 98 | 99 | 100 | #if GLOW_ON 101 | float4 glowColor = GetGlowColor(sd, scale); 102 | glowColor.a *= input.color.a; 103 | emission += glowColor.rgb*glowColor.a; 104 | faceColor = BlendARGB(glowColor, faceColor); 105 | faceColor.rgb /= max(faceColor.a, 0.0001); 106 | #endif 107 | 108 | // Set Standard output structure 109 | o.Albedo = faceColor.rgb; 110 | o.Normal = -n; 111 | o.Emission = emission; 112 | o.Specular = lerp(_FaceShininess, _OutlineShininess, saturate(sd + outline * 0.5)); 113 | o.Gloss = 1; 114 | o.Alpha = faceColor.a; 115 | } 116 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.json: -------------------------------------------------------------------------------- 1 | {"frames": [ 2 | 3 | { 4 | "filename": "1f60a.png", 5 | "frame": {"x":0,"y":0,"w":128,"h":128}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 9 | "sourceSize": {"w":128,"h":128}, 10 | "pivot": {"x":0.5,"y":0.5} 11 | }, 12 | { 13 | "filename": "1f60b.png", 14 | "frame": {"x":128,"y":0,"w":128,"h":128}, 15 | "rotated": false, 16 | "trimmed": false, 17 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 18 | "sourceSize": {"w":128,"h":128}, 19 | "pivot": {"x":0.5,"y":0.5} 20 | }, 21 | { 22 | "filename": "1f60d.png", 23 | "frame": {"x":256,"y":0,"w":128,"h":128}, 24 | "rotated": false, 25 | "trimmed": false, 26 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 27 | "sourceSize": {"w":128,"h":128}, 28 | "pivot": {"x":0.5,"y":0.5} 29 | }, 30 | { 31 | "filename": "1f60e.png", 32 | "frame": {"x":384,"y":0,"w":128,"h":128}, 33 | "rotated": false, 34 | "trimmed": false, 35 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 36 | "sourceSize": {"w":128,"h":128}, 37 | "pivot": {"x":0.5,"y":0.5} 38 | }, 39 | { 40 | "filename": "1f600.png", 41 | "frame": {"x":0,"y":128,"w":128,"h":128}, 42 | "rotated": false, 43 | "trimmed": false, 44 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 45 | "sourceSize": {"w":128,"h":128}, 46 | "pivot": {"x":0.5,"y":0.5} 47 | }, 48 | { 49 | "filename": "1f601.png", 50 | "frame": {"x":128,"y":128,"w":128,"h":128}, 51 | "rotated": false, 52 | "trimmed": false, 53 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 54 | "sourceSize": {"w":128,"h":128}, 55 | "pivot": {"x":0.5,"y":0.5} 56 | }, 57 | { 58 | "filename": "1f602.png", 59 | "frame": {"x":256,"y":128,"w":128,"h":128}, 60 | "rotated": false, 61 | "trimmed": false, 62 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 63 | "sourceSize": {"w":128,"h":128}, 64 | "pivot": {"x":0.5,"y":0.5} 65 | }, 66 | { 67 | "filename": "1f603.png", 68 | "frame": {"x":384,"y":128,"w":128,"h":128}, 69 | "rotated": false, 70 | "trimmed": false, 71 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 72 | "sourceSize": {"w":128,"h":128}, 73 | "pivot": {"x":0.5,"y":0.5} 74 | }, 75 | { 76 | "filename": "1f604.png", 77 | "frame": {"x":0,"y":256,"w":128,"h":128}, 78 | "rotated": false, 79 | "trimmed": false, 80 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 81 | "sourceSize": {"w":128,"h":128}, 82 | "pivot": {"x":0.5,"y":0.5} 83 | }, 84 | { 85 | "filename": "1f605.png", 86 | "frame": {"x":128,"y":256,"w":128,"h":128}, 87 | "rotated": false, 88 | "trimmed": false, 89 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 90 | "sourceSize": {"w":128,"h":128}, 91 | "pivot": {"x":0.5,"y":0.5} 92 | }, 93 | { 94 | "filename": "1f606.png", 95 | "frame": {"x":256,"y":256,"w":128,"h":128}, 96 | "rotated": false, 97 | "trimmed": false, 98 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 99 | "sourceSize": {"w":128,"h":128}, 100 | "pivot": {"x":0.5,"y":0.5} 101 | }, 102 | { 103 | "filename": "1f609.png", 104 | "frame": {"x":384,"y":256,"w":128,"h":128}, 105 | "rotated": false, 106 | "trimmed": false, 107 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 108 | "sourceSize": {"w":128,"h":128}, 109 | "pivot": {"x":0.5,"y":0.5} 110 | }, 111 | { 112 | "filename": "1f618.png", 113 | "frame": {"x":0,"y":384,"w":128,"h":128}, 114 | "rotated": false, 115 | "trimmed": false, 116 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 117 | "sourceSize": {"w":128,"h":128}, 118 | "pivot": {"x":0.5,"y":0.5} 119 | }, 120 | { 121 | "filename": "1f923.png", 122 | "frame": {"x":128,"y":384,"w":128,"h":128}, 123 | "rotated": false, 124 | "trimmed": false, 125 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 126 | "sourceSize": {"w":128,"h":128}, 127 | "pivot": {"x":0.5,"y":0.5} 128 | }, 129 | { 130 | "filename": "263a.png", 131 | "frame": {"x":256,"y":384,"w":128,"h":128}, 132 | "rotated": false, 133 | "trimmed": false, 134 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 135 | "sourceSize": {"w":128,"h":128}, 136 | "pivot": {"x":0.5,"y":0.5} 137 | }, 138 | { 139 | "filename": "2639.png", 140 | "frame": {"x":384,"y":384,"w":128,"h":128}, 141 | "rotated": false, 142 | "trimmed": false, 143 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 144 | "sourceSize": {"w":128,"h":128}, 145 | "pivot": {"x":0.5,"y":0.5} 146 | }], 147 | "meta": { 148 | "app": "http://www.codeandweb.com/texturepacker", 149 | "version": "1.0", 150 | "image": "EmojiOne.png", 151 | "format": "RGBA8888", 152 | "size": {"w":512,"h":512}, 153 | "scale": "1", 154 | "smartupdate": "$TexturePacker:SmartUpdate:196a26a2e149d875b91ffc8fa3581e76:fc928c7e275404b7e0649307410475cb:424723c3774975ddb2053fd5c4b85f6e$" 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Distance Field (Surface)" { 2 | 3 | Properties { 4 | _FaceTex ("Fill Texture", 2D) = "white" {} 5 | _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 6 | _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 7 | _FaceColor ("Fill Color", Color) = (1,1,1,1) 8 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 9 | 10 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 11 | _OutlineTex ("Outline Texture", 2D) = "white" {} 12 | _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 13 | _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 14 | _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 15 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 16 | 17 | _Bevel ("Bevel", Range(0,1)) = 0.5 18 | _BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0 19 | _BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0 20 | _BevelClamp ("Bevel Clamp", Range(0,1)) = 0 21 | _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 22 | 23 | _BumpMap ("Normalmap", 2D) = "bump" {} 24 | _BumpOutline ("Bump Outline", Range(0,1)) = 0.5 25 | _BumpFace ("Bump Face", Range(0,1)) = 0.5 26 | 27 | _ReflectFaceColor ("Face Color", Color) = (0,0,0,1) 28 | _ReflectOutlineColor ("Outline Color", Color) = (0,0,0,1) 29 | _Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ } 30 | _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) 31 | _SpecColor ("Specular Color", Color) = (0,0,0,1) 32 | 33 | _FaceShininess ("Face Shininess", Range(0,1)) = 0 34 | _OutlineShininess ("Outline Shininess", Range(0,1)) = 0 35 | 36 | _GlowColor ("Color", Color) = (0, 1, 0, 0.5) 37 | _GlowOffset ("Offset", Range(-1,1)) = 0 38 | _GlowInner ("Inner", Range(0,1)) = 0.05 39 | _GlowOuter ("Outer", Range(0,1)) = 0.05 40 | _GlowPower ("Falloff", Range(1, 0)) = 0.75 41 | 42 | _WeightNormal ("Weight Normal", float) = 0 43 | _WeightBold ("Weight Bold", float) = 0.5 44 | 45 | // Should not be directly exposed to the user 46 | _ShaderFlags ("Flags", float) = 0 47 | _ScaleRatioA ("Scale RatioA", float) = 1 48 | _ScaleRatioB ("Scale RatioB", float) = 1 49 | _ScaleRatioC ("Scale RatioC", float) = 1 50 | 51 | _MainTex ("Font Atlas", 2D) = "white" {} 52 | _TextureWidth ("Texture Width", float) = 512 53 | _TextureHeight ("Texture Height", float) = 512 54 | _GradientScale ("Gradient Scale", float) = 5.0 55 | _ScaleX ("Scale X", float) = 1.0 56 | _ScaleY ("Scale Y", float) = 1.0 57 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 58 | 59 | _VertexOffsetX ("Vertex OffsetX", float) = 0 60 | _VertexOffsetY ("Vertex OffsetY", float) = 0 61 | //_MaskCoord ("Mask Coords", vector) = (0,0,0,0) 62 | //_MaskSoftness ("Mask Softness", float) = 0 63 | } 64 | 65 | SubShader { 66 | 67 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 68 | 69 | LOD 300 70 | Cull [_CullMode] 71 | 72 | CGPROGRAM 73 | #pragma surface PixShader BlinnPhong alpha:blend vertex:VertShader nolightmap nodirlightmap 74 | #pragma target 3.0 75 | #pragma shader_feature __ GLOW_ON 76 | #pragma glsl 77 | 78 | #include "TMPro_Properties.cginc" 79 | #include "TMPro.cginc" 80 | 81 | half _FaceShininess; 82 | half _OutlineShininess; 83 | 84 | struct Input 85 | { 86 | fixed4 color : COLOR; 87 | float2 uv_MainTex; 88 | float2 uv2_FaceTex; 89 | float2 uv2_OutlineTex; 90 | float2 param; // Weight, Scale 91 | float3 viewDirEnv; 92 | }; 93 | 94 | 95 | #define BEVEL_ON 1 96 | #include "TMPro_Surface.cginc" 97 | 98 | ENDCG 99 | 100 | // Pass to render object as a shadow caster 101 | Pass 102 | { 103 | Name "Caster" 104 | Tags { "LightMode" = "ShadowCaster" } 105 | Offset 1, 1 106 | 107 | Fog {Mode Off} 108 | ZWrite On 109 | ZTest LEqual 110 | Cull Off 111 | 112 | CGPROGRAM 113 | #pragma vertex vert 114 | #pragma fragment frag 115 | #pragma multi_compile_shadowcaster 116 | #include "UnityCG.cginc" 117 | 118 | struct v2f { 119 | V2F_SHADOW_CASTER; 120 | float2 uv : TEXCOORD1; 121 | float2 uv2 : TEXCOORD3; 122 | float alphaClip : TEXCOORD2; 123 | }; 124 | 125 | uniform float4 _MainTex_ST; 126 | uniform float4 _OutlineTex_ST; 127 | float _OutlineWidth; 128 | float _FaceDilate; 129 | float _ScaleRatioA; 130 | 131 | v2f vert( appdata_base v ) 132 | { 133 | v2f o; 134 | TRANSFER_SHADOW_CASTER(o) 135 | o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); 136 | o.uv2 = TRANSFORM_TEX(v.texcoord, _OutlineTex); 137 | o.alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _FaceDilate * _ScaleRatioA) / 2; 138 | return o; 139 | } 140 | 141 | uniform sampler2D _MainTex; 142 | 143 | float4 frag(v2f i) : COLOR 144 | { 145 | fixed4 texcol = tex2D(_MainTex, i.uv).a; 146 | clip(texcol.a - i.alphaClip); 147 | SHADOW_CASTER_FRAGMENT(i) 148 | } 149 | ENDCG 150 | } 151 | } 152 | 153 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 154 | } 155 | 156 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.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: ab2114bdc8544297b417dfefe9f1e410, type: 3} 12 | m_Name: Default Style Sheet 13 | m_EditorClassIdentifier: 14 | m_StyleList: 15 | - m_Name: H1 16 | m_HashCode: 2425 17 | m_OpeningDefinition: <#40ff80>* 18 | m_ClosingDefinition: '*' 19 | m_OpeningTagArray: 3c00000073000000690000007a000000650000003d00000032000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000660000006600000038000000300000003e0000002a000000 20 | m_ClosingTagArray: 2a0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000 21 | - m_Name: Quote 22 | m_HashCode: 92254330 23 | m_OpeningDefinition: 24 | m_ClosingDefinition: 25 | m_OpeningTagArray: 3c000000690000003e0000003c00000073000000690000007a000000650000003d0000003700000035000000250000003e0000003c0000006d000000610000007200000067000000690000006e0000003d0000003100000030000000250000003e000000 26 | m_ClosingTagArray: 3c0000002f000000690000003e0000003c0000002f00000073000000690000007a000000650000003e0000003c0000002f00000077000000690000006400000074000000680000003e0000003c0000002f0000006d000000610000007200000067000000690000006e0000003e000000 27 | - m_Name: Link 28 | m_HashCode: 2687968 29 | m_OpeningDefinition: <#40a0ff> 30 | m_ClosingDefinition: 31 | m_OpeningTagArray: 3c000000750000003e0000003c000000230000003400000030000000610000003000000066000000660000003e0000003c0000006c000000690000006e0000006b0000003d0000002200000049000000440000005f0000003000000031000000220000003e000000 32 | m_ClosingTagArray: 3c0000002f000000750000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f0000006c000000690000006e0000006b0000003e000000 33 | - m_Name: Title 34 | m_HashCode: 98732960 35 | m_OpeningDefinition: 36 | m_ClosingDefinition: 37 | m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e0000003c000000620000003e0000003c000000610000006c00000069000000670000006e0000003d00000063000000650000006e0000007400000065000000720000003e000000 38 | m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000610000006c00000069000000670000006e0000003e000000 39 | - m_Name: H2 40 | m_HashCode: 2426 41 | m_OpeningDefinition: <#4080FF> 42 | m_ClosingDefinition: 43 | m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000002e00000035000000650000006d0000003e0000003c000000620000003e0000003c000000230000003400000030000000380000003000000046000000460000003e000000 44 | m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000 45 | - m_Name: H3 46 | m_HashCode: 2427 47 | m_OpeningDefinition: <#FF8040> 48 | m_ClosingDefinition: 49 | m_OpeningTagArray: 3c00000073000000690000007a000000650000003d000000310000002e0000003100000037000000650000006d0000003e0000003c000000620000003e0000003c000000230000004600000046000000380000003000000034000000300000003e000000 50 | m_ClosingTagArray: 3c0000002f00000073000000690000007a000000650000003e0000003c0000002f000000620000003e0000003c0000002f000000630000006f0000006c0000006f000000720000003e000000 51 | - m_Name: C1 52 | m_HashCode: 2194 53 | m_OpeningDefinition: 54 | m_ClosingDefinition: 55 | m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000006600000066000000660000006600000034000000300000003e000000 56 | m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e000000 57 | - m_Name: C2 58 | m_HashCode: 2193 59 | m_OpeningDefinition: 60 | m_ClosingDefinition: 61 | m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000006600000066000000340000003000000046000000460000003e0000003c00000073000000690000007a000000650000003d000000310000003200000035000000250000003e000000 62 | m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f00000073000000690000007a000000650000003e000000 63 | - m_Name: C3 64 | m_HashCode: 2192 65 | m_OpeningDefinition: 66 | m_ClosingDefinition: 67 | m_OpeningTagArray: 3c000000630000006f0000006c0000006f000000720000003d000000230000003800000030000000410000003000000046000000460000003e0000003c000000620000003e000000 68 | m_ClosingTagArray: 3c0000002f000000630000006f0000006c0000006f000000720000003e0000003c0000002f000000620000003e000000 69 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/TextTyperTester.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using UnityEngine; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using RedBlueGames.Tools.TextTyper; 7 | using UnityEngine.UI; 8 | using TMPro; 9 | 10 | /// 11 | /// Class that tests TextTyper and shows how to interface with it. 12 | /// 13 | public class TextTyperTester : MonoBehaviour 14 | { 15 | #pragma warning disable 0649 // Ignore "Field is never assigned to" warning, as these are assigned in inspector 16 | [SerializeField] 17 | private AudioClip printSoundEffect; 18 | 19 | [Header("UI References")] 20 | 21 | [SerializeField] 22 | private Button printNextButton; 23 | 24 | [SerializeField] 25 | private Button printNoSkipButton; 26 | 27 | [SerializeField] 28 | private Toggle pauseGameToggle; 29 | 30 | private Queue dialogueLines = new Queue(); 31 | 32 | [SerializeField] 33 | [Tooltip("The text typer element to test typing with")] 34 | private TextTyper testTextTyper; 35 | 36 | #pragma warning restore 0649 37 | public void Start() 38 | { 39 | this.testTextTyper.PrintCompleted.AddListener(this.HandlePrintCompleted); 40 | this.testTextTyper.CharacterPrinted.AddListener(this.HandleCharacterPrinted); 41 | 42 | this.printNextButton.onClick.AddListener(this.HandlePrintNextClicked); 43 | this.printNoSkipButton.onClick.AddListener(this.HandlePrintNoSkipClicked); 44 | 45 | dialogueLines.Enqueue("Hello! My name is... NPC. Got it, bub?"); 46 | dialogueLines.Enqueue("You can use uGUI text tag and color tag like this."); 47 | dialogueLines.Enqueue("bold text test bold text test"); 48 | dialogueLines.Enqueue("Sprites!Isn't that neat?"); 49 | dialogueLines.Enqueue("You can size 40 and size 20"); 50 | dialogueLines.Enqueue("You can color tag like this."); 51 | dialogueLines.Enqueue("Sample Shake Animations: Light Rotation, Light Position, Full Shake\nSample Curve Animations: Slow Sine, Bounce Bounce, Crazy Flip"); 52 | ShowScript(); 53 | } 54 | 55 | public void Update() 56 | { 57 | UnityEngine.Time.timeScale = this.pauseGameToggle.isOn ? 0.0f : 1.0f; 58 | 59 | if (Input.GetKeyDown(KeyCode.Space)) 60 | { 61 | 62 | var tag = RichTextTag.ParseNext("blahbooblue"); 71 | LogTag(tag); 72 | } 73 | } 74 | 75 | private void HandlePrintNextClicked() 76 | { 77 | if (this.testTextTyper.IsSkippable() && this.testTextTyper.IsTyping) 78 | { 79 | this.testTextTyper.Skip(); 80 | } 81 | else 82 | { 83 | ShowScript(); 84 | } 85 | } 86 | 87 | private void HandlePrintNoSkipClicked() 88 | { 89 | ShowScript(); 90 | } 91 | 92 | private void ShowScript() 93 | { 94 | if (dialogueLines.Count <= 0) 95 | { 96 | return; 97 | } 98 | 99 | this.testTextTyper.TypeText(dialogueLines.Dequeue()); 100 | } 101 | 102 | private void LogTag(RichTextTag tag) 103 | { 104 | if (tag != null) 105 | { 106 | Debug.Log("Tag: " + tag.ToString()); 107 | } 108 | } 109 | 110 | private void HandleCharacterPrinted(string printedCharacter) 111 | { 112 | // Do not play a sound for whitespace 113 | if (printedCharacter == " " || printedCharacter == "\n") 114 | { 115 | return; 116 | } 117 | 118 | var audioSource = this.GetComponent(); 119 | if (audioSource == null) 120 | { 121 | audioSource = this.gameObject.AddComponent(); 122 | } 123 | 124 | audioSource.clip = this.printSoundEffect; 125 | audioSource.Play(); 126 | } 127 | 128 | private void HandlePrintCompleted() 129 | { 130 | Debug.Log("TypeText Complete"); 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /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: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 2 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 2 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 0 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 2 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 2 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 4 142 | shadows: 2 143 | shadowResolution: 2 144 | shadowProjection: 1 145 | shadowCascades: 4 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 2 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 150 | blendWeights: 4 151 | textureQuality: 0 152 | anisotropicTextures: 2 153 | antiAliasing: 2 154 | softParticles: 1 155 | softVegetation: 1 156 | realtimeReflectionProbes: 1 157 | billboardsFaceCameraPosition: 1 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: 166 | Android: 2 167 | BlackBerry: 2 168 | FlashPlayer: 3 169 | GLES Emulation: 3 170 | PS3: 3 171 | PS4: 3 172 | PSM: 3 173 | PSP2: 3 174 | Samsung TV: 2 175 | Standalone: 3 176 | Tizen: 2 177 | WP8: 3 178 | Web: 3 179 | Windows Store Apps: 3 180 | XBOX360: 3 181 | XboxOne: 3 182 | iPhone: 2 183 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/TextTagParser.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | /// 8 | /// "Utility class to assist with parsing HTML-style tags in strings 9 | /// 10 | public sealed class TextTagParser 11 | { 12 | /// 13 | /// Define custom tags here. These should also be added to the CustomTagTypes List below 14 | /// 15 | public struct CustomTags 16 | { 17 | public const string Delay = "delay"; 18 | public const string Anim = "anim"; 19 | public const string Animation = "animation"; 20 | } 21 | 22 | private static readonly string[] UnityTags = new string[] 23 | { 24 | "b", 25 | "i", 26 | "s", 27 | "u", 28 | "br", 29 | "nobr", 30 | "size", 31 | "color", 32 | "style", 33 | "width", 34 | "align", 35 | "alpha", 36 | "cspace", 37 | "font", 38 | "indent", 39 | "line-height", 40 | "line-indent", 41 | "link", 42 | "lowercase", 43 | "uppercase", 44 | "smallcaps", 45 | "margin", 46 | "mark", 47 | "mspace", 48 | "noparse", 49 | "page", 50 | "pos", 51 | "space", 52 | "sprite", 53 | "sup", 54 | "sub", 55 | "voffset", 56 | "gradient" 57 | }; 58 | 59 | private static readonly string[] CustomTagTypes = new string[] 60 | { 61 | CustomTags.Delay, 62 | CustomTags.Anim, 63 | CustomTags.Animation, 64 | }; 65 | 66 | public static List CreateSymbolListFromText(string text) 67 | { 68 | var symbolList = new List(); 69 | int parsedCharacters = 0; 70 | while (parsedCharacters < text.Length) 71 | { 72 | TextSymbol symbol = null; 73 | 74 | // Check for tags 75 | var remainingText = text.Substring(parsedCharacters, text.Length - parsedCharacters); 76 | if (RichTextTag.StringStartsWithTag(remainingText)) 77 | { 78 | var tag = RichTextTag.ParseNext(remainingText); 79 | symbol = new TextSymbol(tag); 80 | } 81 | else 82 | { 83 | symbol = new TextSymbol(remainingText.Substring(0, 1)); 84 | } 85 | 86 | parsedCharacters += symbol.Length; 87 | symbolList.Add(symbol); 88 | } 89 | 90 | return symbolList; 91 | } 92 | 93 | public static string RemoveAllTags(string textWithTags) 94 | { 95 | string textWithoutTags = textWithTags; 96 | textWithoutTags = RemoveUnityTags(textWithoutTags); 97 | textWithoutTags = RemoveCustomTags(textWithoutTags); 98 | 99 | return textWithoutTags; 100 | } 101 | 102 | public static string RemoveCustomTags(string textWithTags) 103 | { 104 | return RemoveTags(textWithTags, CustomTagTypes); 105 | } 106 | 107 | public static string RemoveUnityTags(string textWithTags) 108 | { 109 | return RemoveTags(textWithTags, UnityTags); 110 | } 111 | 112 | private static string RemoveTags(string textWithTags, params string[] tags) 113 | { 114 | string textWithoutTags = textWithTags; 115 | foreach (var tag in tags) 116 | { 117 | textWithoutTags = RichTextTag.RemoveTagsFromString(textWithoutTags, tag); 118 | } 119 | 120 | return textWithoutTags; 121 | } 122 | 123 | public class TextSymbol 124 | { 125 | public TextSymbol(string character) 126 | { 127 | this.Character = character[0]; 128 | } 129 | 130 | public TextSymbol(RichTextTag tag) 131 | { 132 | this.Tag = tag; 133 | } 134 | 135 | public char Character { get; private set; } 136 | 137 | public RichTextTag Tag { get; private set; } 138 | 139 | public int Length 140 | { 141 | get 142 | { 143 | return this.Text.Length; 144 | } 145 | } 146 | 147 | public string Text 148 | { 149 | get 150 | { 151 | if (this.IsTag) 152 | { 153 | return this.Tag.TagText; 154 | } 155 | else 156 | { 157 | return this.Character.ToString(); 158 | } 159 | } 160 | } 161 | 162 | public bool IsTag 163 | { 164 | get 165 | { 166 | return this.Tag != null; 167 | } 168 | } 169 | 170 | /// 171 | /// Gets a value indicating this Symbol represents a Sprite, which is treated 172 | /// as a visible character by TextMeshPro. 173 | /// See Issue #35 for details. 174 | /// 175 | /// 176 | public bool IsReplacedWithSprite 177 | { 178 | get 179 | { 180 | return this.IsTag && this.Tag.TagType == "sprite"; 181 | } 182 | } 183 | 184 | public float GetFloatParameter(float defaultValue = 0f) 185 | { 186 | if (!this.IsTag) 187 | { 188 | Debug.LogWarning("Attempted to retrieve parameter from symbol that is not a tag."); 189 | return defaultValue; 190 | } 191 | 192 | float paramValue; 193 | if (!float.TryParse(this.Tag.Parameter, out paramValue)) 194 | { 195 | var warning = string.Format( 196 | "Found Invalid parameter format in tag [{0}]. " + 197 | "Parameter [{1}] does not parse to a float.", 198 | this.Tag, 199 | this.Tag.Parameter); 200 | Debug.LogWarning(warning); 201 | paramValue = defaultValue; 202 | } 203 | 204 | return paramValue; 205 | } 206 | } 207 | } 208 | } -------------------------------------------------------------------------------- /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 cmd 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 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Overlay.shader: -------------------------------------------------------------------------------- 1 | // Simplified SDF shader: 2 | // - No Shading Option (bevel / bump / env map) 3 | // - No Glow Option 4 | // - Softness is applied on both side of the outline 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field Overlay" { 7 | 8 | Properties { 9 | _FaceColor ("Face Color", Color) = (1,1,1,1) 10 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 11 | 12 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 13 | _OutlineWidth ("Outline Thickness", Range(0,1)) = 0 14 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 15 | 16 | _UnderlayColor ("Border Color", Color) = (0,0,0,.5) 17 | _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 18 | _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 19 | _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 20 | _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 21 | 22 | _WeightNormal ("Weight Normal", float) = 0 23 | _WeightBold ("Weight Bold", float) = .5 24 | 25 | _ShaderFlags ("Flags", float) = 0 26 | _ScaleRatioA ("Scale RatioA", float) = 1 27 | _ScaleRatioB ("Scale RatioB", float) = 1 28 | _ScaleRatioC ("Scale RatioC", float) = 1 29 | 30 | _MainTex ("Font Atlas", 2D) = "white" {} 31 | _TextureWidth ("Texture Width", float) = 512 32 | _TextureHeight ("Texture Height", float) = 512 33 | _GradientScale ("Gradient Scale", float) = 5 34 | _ScaleX ("Scale X", float) = 1 35 | _ScaleY ("Scale Y", float) = 1 36 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 37 | 38 | _VertexOffsetX ("Vertex OffsetX", float) = 0 39 | _VertexOffsetY ("Vertex OffsetY", float) = 0 40 | 41 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 42 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 43 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 44 | 45 | _StencilComp ("Stencil Comparison", Float) = 8 46 | _Stencil ("Stencil ID", Float) = 0 47 | _StencilOp ("Stencil Operation", Float) = 0 48 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 49 | _StencilReadMask ("Stencil Read Mask", Float) = 255 50 | 51 | _ColorMask ("Color Mask", Float) = 15 52 | } 53 | 54 | SubShader { 55 | Tags 56 | { 57 | "Queue"="Overlay" 58 | "IgnoreProjector"="True" 59 | "RenderType"="Transparent" 60 | } 61 | 62 | 63 | Stencil 64 | { 65 | Ref [_Stencil] 66 | Comp [_StencilComp] 67 | Pass [_StencilOp] 68 | ReadMask [_StencilReadMask] 69 | WriteMask [_StencilWriteMask] 70 | } 71 | 72 | Cull [_CullMode] 73 | ZWrite Off 74 | Lighting Off 75 | Fog { Mode Off } 76 | ZTest Always 77 | Blend One OneMinusSrcAlpha 78 | ColorMask [_ColorMask] 79 | 80 | Pass { 81 | CGPROGRAM 82 | #pragma vertex VertShader 83 | #pragma fragment PixShader 84 | #pragma shader_feature __ OUTLINE_ON 85 | #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER 86 | 87 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 88 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 89 | 90 | #include "UnityCG.cginc" 91 | #include "UnityUI.cginc" 92 | #include "TMPro_Properties.cginc" 93 | 94 | struct vertex_t { 95 | float4 vertex : POSITION; 96 | float3 normal : NORMAL; 97 | fixed4 color : COLOR; 98 | float2 texcoord0 : TEXCOORD0; 99 | float2 texcoord1 : TEXCOORD1; 100 | }; 101 | 102 | struct pixel_t { 103 | float4 vertex : SV_POSITION; 104 | fixed4 faceColor : COLOR; 105 | fixed4 outlineColor : COLOR1; 106 | float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV 107 | half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w) 108 | half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw) 109 | #if (UNDERLAY_ON | UNDERLAY_INNER) 110 | float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved 111 | half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y) 112 | #endif 113 | }; 114 | 115 | 116 | pixel_t VertShader(vertex_t input) 117 | { 118 | float bold = step(input.texcoord1.y, 0); 119 | 120 | float4 vert = input.vertex; 121 | vert.x += _VertexOffsetX; 122 | vert.y += _VertexOffsetY; 123 | float4 vPosition = UnityObjectToClipPos(vert); 124 | 125 | float2 pixelSize = vPosition.w; 126 | pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); 127 | 128 | float scale = rsqrt(dot(pixelSize, pixelSize)); 129 | scale *= abs(input.texcoord1.y) * _GradientScale * 1.5; 130 | if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 131 | 132 | float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; 133 | weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; 134 | 135 | float layerScale = scale; 136 | 137 | scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale); 138 | float bias = (0.5 - weight) * scale - 0.5; 139 | float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; 140 | 141 | float opacity = input.color.a; 142 | #if (UNDERLAY_ON | UNDERLAY_INNER) 143 | opacity = 1.0; 144 | #endif 145 | 146 | fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor; 147 | faceColor.rgb *= faceColor.a; 148 | 149 | fixed4 outlineColor = _OutlineColor; 150 | outlineColor.a *= opacity; 151 | outlineColor.rgb *= outlineColor.a; 152 | outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2)))); 153 | 154 | #if (UNDERLAY_ON | UNDERLAY_INNER) 155 | 156 | layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); 157 | float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); 158 | 159 | float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; 160 | float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; 161 | float2 layerOffset = float2(x, y); 162 | #endif 163 | 164 | // Generate UV for the Masking Texture 165 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 166 | float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); 167 | 168 | // Structure for pixel shader 169 | pixel_t output = { 170 | vPosition, 171 | faceColor, 172 | outlineColor, 173 | float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y), 174 | half4(scale, bias - outline, bias + outline, bias), 175 | half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)), 176 | #if (UNDERLAY_ON | UNDERLAY_INNER) 177 | float4(input.texcoord0 + layerOffset, input.color.a, 0), 178 | half2(layerScale, layerBias), 179 | #endif 180 | }; 181 | 182 | return output; 183 | } 184 | 185 | 186 | // PIXEL SHADER 187 | fixed4 PixShader(pixel_t input) : SV_Target 188 | { 189 | half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x; 190 | half4 c = input.faceColor * saturate(d - input.param.w); 191 | 192 | #ifdef OUTLINE_ON 193 | c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z)); 194 | c *= saturate(d - input.param.y); 195 | #endif 196 | 197 | #if UNDERLAY_ON 198 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 199 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a); 200 | #endif 201 | 202 | #if UNDERLAY_INNER 203 | half sd = saturate(d - input.param.z); 204 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 205 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a); 206 | #endif 207 | 208 | // Alternative implementation to UnityGet2DClipping with support for softness. 209 | #if UNITY_UI_CLIP_RECT 210 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); 211 | c *= m.x * m.y; 212 | #endif 213 | 214 | #if (UNDERLAY_ON | UNDERLAY_INNER) 215 | c *= input.texcoord1.z; 216 | #endif 217 | 218 | #if UNITY_UI_ALPHACLIP 219 | clip(c.a - 0.001); 220 | #endif 221 | 222 | return c; 223 | } 224 | ENDCG 225 | } 226 | } 227 | 228 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 229 | } 230 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile.shader: -------------------------------------------------------------------------------- 1 | // Simplified SDF shader: 2 | // - No Shading Option (bevel / bump / env map) 3 | // - No Glow Option 4 | // - Softness is applied on both side of the outline 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field" { 7 | 8 | Properties { 9 | _FaceColor ("Face Color", Color) = (1,1,1,1) 10 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 11 | 12 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 13 | _OutlineWidth ("Outline Thickness", Range(0,1)) = 0 14 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 15 | 16 | _UnderlayColor ("Border Color", Color) = (0,0,0,.5) 17 | _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 18 | _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 19 | _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 20 | _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 21 | 22 | _WeightNormal ("Weight Normal", float) = 0 23 | _WeightBold ("Weight Bold", float) = .5 24 | 25 | _ShaderFlags ("Flags", float) = 0 26 | _ScaleRatioA ("Scale RatioA", float) = 1 27 | _ScaleRatioB ("Scale RatioB", float) = 1 28 | _ScaleRatioC ("Scale RatioC", float) = 1 29 | 30 | _MainTex ("Font Atlas", 2D) = "white" {} 31 | _TextureWidth ("Texture Width", float) = 512 32 | _TextureHeight ("Texture Height", float) = 512 33 | _GradientScale ("Gradient Scale", float) = 5 34 | _ScaleX ("Scale X", float) = 1 35 | _ScaleY ("Scale Y", float) = 1 36 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 37 | 38 | _VertexOffsetX ("Vertex OffsetX", float) = 0 39 | _VertexOffsetY ("Vertex OffsetY", float) = 0 40 | 41 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 42 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 43 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 44 | 45 | _StencilComp ("Stencil Comparison", Float) = 8 46 | _Stencil ("Stencil ID", Float) = 0 47 | _StencilOp ("Stencil Operation", Float) = 0 48 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 49 | _StencilReadMask ("Stencil Read Mask", Float) = 255 50 | 51 | _ColorMask ("Color Mask", Float) = 15 52 | } 53 | 54 | SubShader { 55 | Tags 56 | { 57 | "Queue"="Transparent" 58 | "IgnoreProjector"="True" 59 | "RenderType"="Transparent" 60 | } 61 | 62 | 63 | Stencil 64 | { 65 | Ref [_Stencil] 66 | Comp [_StencilComp] 67 | Pass [_StencilOp] 68 | ReadMask [_StencilReadMask] 69 | WriteMask [_StencilWriteMask] 70 | } 71 | 72 | Cull [_CullMode] 73 | ZWrite Off 74 | Lighting Off 75 | Fog { Mode Off } 76 | ZTest [unity_GUIZTestMode] 77 | Blend One OneMinusSrcAlpha 78 | ColorMask [_ColorMask] 79 | 80 | Pass { 81 | CGPROGRAM 82 | #pragma vertex VertShader 83 | #pragma fragment PixShader 84 | #pragma shader_feature __ OUTLINE_ON 85 | #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER 86 | 87 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 88 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 89 | 90 | #include "UnityCG.cginc" 91 | #include "UnityUI.cginc" 92 | #include "TMPro_Properties.cginc" 93 | 94 | struct vertex_t { 95 | float4 vertex : POSITION; 96 | float3 normal : NORMAL; 97 | fixed4 color : COLOR; 98 | float2 texcoord0 : TEXCOORD0; 99 | float2 texcoord1 : TEXCOORD1; 100 | }; 101 | 102 | struct pixel_t { 103 | float4 vertex : SV_POSITION; 104 | fixed4 faceColor : COLOR; 105 | fixed4 outlineColor : COLOR1; 106 | float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV 107 | half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w) 108 | half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw) 109 | #if (UNDERLAY_ON | UNDERLAY_INNER) 110 | float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved 111 | half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y) 112 | #endif 113 | }; 114 | 115 | 116 | pixel_t VertShader(vertex_t input) 117 | { 118 | float bold = step(input.texcoord1.y, 0); 119 | 120 | float4 vert = input.vertex; 121 | vert.x += _VertexOffsetX; 122 | vert.y += _VertexOffsetY; 123 | float4 vPosition = UnityObjectToClipPos(vert); 124 | 125 | float2 pixelSize = vPosition.w; 126 | pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); 127 | 128 | float scale = rsqrt(dot(pixelSize, pixelSize)); 129 | scale *= abs(input.texcoord1.y) * _GradientScale * 1.5; 130 | if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 131 | 132 | float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; 133 | weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; 134 | 135 | float layerScale = scale; 136 | 137 | scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale); 138 | float bias = (0.5 - weight) * scale - 0.5; 139 | float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; 140 | 141 | float opacity = input.color.a; 142 | #if (UNDERLAY_ON | UNDERLAY_INNER) 143 | opacity = 1.0; 144 | #endif 145 | 146 | fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor; 147 | faceColor.rgb *= faceColor.a; 148 | 149 | fixed4 outlineColor = _OutlineColor; 150 | outlineColor.a *= opacity; 151 | outlineColor.rgb *= outlineColor.a; 152 | outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2)))); 153 | 154 | #if (UNDERLAY_ON | UNDERLAY_INNER) 155 | 156 | layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); 157 | float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); 158 | 159 | float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; 160 | float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; 161 | float2 layerOffset = float2(x, y); 162 | #endif 163 | 164 | // Generate UV for the Masking Texture 165 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 166 | float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); 167 | 168 | // Structure for pixel shader 169 | pixel_t output = { 170 | vPosition, 171 | faceColor, 172 | outlineColor, 173 | float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y), 174 | half4(scale, bias - outline, bias + outline, bias), 175 | half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)), 176 | #if (UNDERLAY_ON | UNDERLAY_INNER) 177 | float4(input.texcoord0 + layerOffset, input.color.a, 0), 178 | half2(layerScale, layerBias), 179 | #endif 180 | }; 181 | 182 | return output; 183 | } 184 | 185 | 186 | // PIXEL SHADER 187 | fixed4 PixShader(pixel_t input) : SV_Target 188 | { 189 | half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x; 190 | half4 c = input.faceColor * saturate(d - input.param.w); 191 | 192 | #ifdef OUTLINE_ON 193 | c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z)); 194 | c *= saturate(d - input.param.y); 195 | #endif 196 | 197 | #if UNDERLAY_ON 198 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 199 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a); 200 | #endif 201 | 202 | #if UNDERLAY_INNER 203 | half sd = saturate(d - input.param.z); 204 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 205 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a); 206 | #endif 207 | 208 | // Alternative implementation to UnityGet2DClipping with support for softness. 209 | #if UNITY_UI_CLIP_RECT 210 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); 211 | c *= m.x * m.y; 212 | #endif 213 | 214 | #if (UNDERLAY_ON | UNDERLAY_INNER) 215 | c *= input.texcoord1.z; 216 | #endif 217 | 218 | #if UNITY_UI_ALPHACLIP 219 | clip(c.a - 0.001); 220 | #endif 221 | 222 | return c; 223 | } 224 | ENDCG 225 | } 226 | } 227 | 228 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 229 | } 230 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/RichTextTag.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using System.Collections; 4 | using UnityEngine; 5 | 6 | /// 7 | /// RichTextTags help parse text that contains HTML style tags, used by Unity's RichText text components. 8 | /// 9 | public class RichTextTag 10 | { 11 | public static readonly RichTextTag ClearColorTag = new RichTextTag(""); 12 | 13 | private const char OpeningNodeDelimeter = '<'; 14 | private const char CloseNodeDelimeter = '>'; 15 | private const char EndTagDelimeter = '/'; 16 | private const char ParameterDelimeter = '='; 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// Tag text. 22 | public RichTextTag(string tagText) 23 | { 24 | this.TagText = tagText; 25 | } 26 | 27 | /// 28 | /// Gets the full tag text including markers. 29 | /// 30 | /// The tag full text. 31 | public string TagText { get; private set; } 32 | 33 | /// 34 | /// Gets the text for this tag if it's used as a closing tag. Closing tags are unchanged. 35 | /// 36 | /// The closing tag text. 37 | public string ClosingTagText 38 | { 39 | get 40 | { 41 | return this.IsClosingTag ? this.TagText : string.Format("", this.TagType); 42 | } 43 | } 44 | 45 | /// 46 | /// Gets the TagType, the body of the tag as a string 47 | /// 48 | /// The type of the tag. 49 | public string TagType 50 | { 51 | get 52 | { 53 | // Strip start and end tags 54 | var tagType = this.TagText.Substring(1, this.TagText.Length - 2); 55 | tagType = tagType.TrimStart(EndTagDelimeter); 56 | 57 | var tagEndDelimeters = new char[] { ' ', ParameterDelimeter }; 58 | var delimeterIndex = tagType.IndexOfAny(tagEndDelimeters); 59 | var tagEndIndex = delimeterIndex > 0 ? delimeterIndex : tagType.Length; 60 | tagType = tagType.Substring(0, tagEndIndex); 61 | 62 | return tagType; 63 | } 64 | } 65 | 66 | /// 67 | /// Gets the parameter as a string. Ex: For tag Color=#FF00FFFF the parameter would be #FF00FFFF. 68 | /// 69 | /// The parameter. 70 | public string Parameter 71 | { 72 | get 73 | { 74 | var parameterDelimeterIndex = this.TagText.IndexOf(ParameterDelimeter); 75 | if (parameterDelimeterIndex < 0) 76 | { 77 | return string.Empty; 78 | } 79 | 80 | // Subtract two, one for the delimeter and one for the closing character 81 | var parameterLength = this.TagText.Length - parameterDelimeterIndex - 2; 82 | var parameter = this.TagText.Substring(parameterDelimeterIndex + 1, parameterLength); 83 | 84 | // Kill optional enclosing quotes 85 | if (parameter.Length > 0) 86 | { 87 | if (parameter[0] == '\"' && parameter[parameter.Length - 1] == '\"') 88 | { 89 | parameter = parameter.Substring(1, parameter.Length - 2); 90 | } 91 | } 92 | 93 | return parameter; 94 | } 95 | } 96 | 97 | /// 98 | /// Gets a value indicating whether this instance is an opening tag. 99 | /// 100 | /// true if this instance is an opening tag; otherwise, false. 101 | public bool IsOpeningTag 102 | { 103 | get 104 | { 105 | return !this.IsClosingTag; 106 | } 107 | } 108 | 109 | /// 110 | /// Gets a value indicating whether this instance is a closing tag. 111 | /// 112 | /// true if this instance is a closing tag; otherwise, false. 113 | public bool IsClosingTag 114 | { 115 | get 116 | { 117 | return this.TagText.Length > 2 && this.TagText[1] == EndTagDelimeter; 118 | } 119 | } 120 | 121 | /// 122 | /// Gets the length of the tag. Shorcut for the length of the full TagText. 123 | /// 124 | /// The text length. 125 | public int Length 126 | { 127 | get 128 | { 129 | return this.TagText.Length; 130 | } 131 | } 132 | 133 | /// 134 | /// Checks if the specified String starts with a tag. 135 | /// 136 | /// true, if the first character begins a tag false otherwise. 137 | /// Text to check for tags. 138 | public static bool StringStartsWithTag(string text) 139 | { 140 | return text.StartsWith(RichTextTag.OpeningNodeDelimeter.ToString()); 141 | } 142 | 143 | /// 144 | /// Parses the text for the next RichTextTag. 145 | /// 146 | /// The next RichTextTag in the sequence. Null if the sequence contains no RichTextTag 147 | /// Text to parse. 148 | public static RichTextTag ParseNext(string text) 149 | { 150 | // Trim up to the first delimeter 151 | var openingDelimeterIndex = text.IndexOf(RichTextTag.OpeningNodeDelimeter); 152 | 153 | // No opening delimeter found. Might want to throw. 154 | if (openingDelimeterIndex < 0) 155 | { 156 | return null; 157 | } 158 | 159 | var closingDelimeterIndex = text.IndexOf(RichTextTag.CloseNodeDelimeter); 160 | 161 | // No closingDelimeter found. Might want to throw. 162 | if (closingDelimeterIndex < 0) 163 | { 164 | return null; 165 | } 166 | 167 | var tagText = text.Substring(openingDelimeterIndex, closingDelimeterIndex - openingDelimeterIndex + 1); 168 | return new RichTextTag(tagText); 169 | } 170 | 171 | /// 172 | /// Removes all copies of the tag of the specified type from the text string. 173 | /// 174 | /// The text string without any tag of the specified type. 175 | /// Text to remove Tags from. 176 | /// Tag type to remove. 177 | public static string RemoveTagsFromString(string text, string tagType) 178 | { 179 | var bodyWithoutTags = text; 180 | for (int i = 0; i < text.Length; ++i) 181 | { 182 | var remainingText = text.Substring(i, text.Length - i); 183 | if (StringStartsWithTag(remainingText)) 184 | { 185 | var parsedTag = ParseNext(remainingText); 186 | if (parsedTag.TagType == tagType) 187 | { 188 | bodyWithoutTags = bodyWithoutTags.Replace(parsedTag.TagText, string.Empty); 189 | } 190 | 191 | i += parsedTag.Length - 1; 192 | } 193 | } 194 | 195 | return bodyWithoutTags; 196 | } 197 | 198 | /// 199 | /// Returns a that represents the current . 200 | /// 201 | /// A that represents the current . 202 | public override string ToString() 203 | { 204 | return this.TagText; 205 | } 206 | } 207 | } -------------------------------------------------------------------------------- /Assets/Editor/RBPackageExporter.cs: -------------------------------------------------------------------------------- 1 | /* MIT License 2 | 3 | Copyright (c) 2016 Edward Rowe, RedBlueGames 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 | */ 23 | 24 | using System.Collections; 25 | using System.Collections.Generic; 26 | using UnityEditor; 27 | using UnityEngine; 28 | 29 | /// 30 | /// Tool that helps us export RedBlueTools for use in other projects, as well as for the public 31 | /// 32 | public class RBPackageExporter : UnityEditor.EditorWindow 33 | { 34 | private static string companyPath = "Assets/RedBlueGames"; 35 | private static string packageExtension = ".unitypackage"; 36 | private static string testPackageSuffix = "WithTests"; 37 | private List redBlueAssets; 38 | 39 | private bool includeTests; 40 | 41 | [MenuItem("Assets/RBPackage Exporter")] 42 | private static void ExportRBScriptsWithTests() 43 | { 44 | EditorWindow.GetWindow(false, "RBPackage Exporter", true); 45 | } 46 | 47 | private static List GetTestDirectories(string[] directories) 48 | { 49 | var testDirectories = new List(); 50 | foreach (var directory in directories) 51 | { 52 | if (IsDirectoryAChildOfAnyOfThese(directory, testDirectories)) 53 | { 54 | testDirectories.Add(directory); 55 | continue; 56 | } 57 | 58 | if (IsTestDirectory(directory)) 59 | { 60 | testDirectories.Add(directory); 61 | } 62 | } 63 | 64 | return testDirectories; 65 | } 66 | 67 | private static bool IsDirectoryAChildOfAnyOfThese(string path, List possibleParentDirectories) 68 | { 69 | foreach (var possibleParentDirectory in possibleParentDirectories) 70 | { 71 | if (path.Contains(possibleParentDirectory)) 72 | { 73 | return true; 74 | } 75 | } 76 | 77 | return false; 78 | } 79 | 80 | private static bool IsTestDirectory(string path) 81 | { 82 | return System.IO.Path.GetFileName(path) == "Tests"; 83 | } 84 | 85 | private void OnEnable() 86 | { 87 | this.redBlueAssets = new List(); 88 | this.FindAssetsInCompanyFolder(); 89 | } 90 | 91 | private void FindAssetsInCompanyFolder() 92 | { 93 | foreach (var subdirectory in System.IO.Directory.GetDirectories(companyPath)) 94 | { 95 | var splitSubdirectory = subdirectory.Split(System.IO.Path.DirectorySeparatorChar); 96 | string folderName = splitSubdirectory[splitSubdirectory.Length - 1]; 97 | this.redBlueAssets.Add(new RBAsset() 98 | { 99 | AssetName = folderName, 100 | IsSelected = false 101 | }); 102 | } 103 | } 104 | 105 | private void OnGUI() 106 | { 107 | EditorGUILayout.HelpBox( 108 | "This tool Allows quick export of specific RedBlueGames custom assets. It also allows optional export of Tests folders.", 109 | MessageType.None); 110 | EditorGUILayout.LabelField("Asset Packages to export:", EditorStyles.boldLabel); 111 | EditorGUILayout.BeginVertical(); 112 | for (int i = 0; i < this.redBlueAssets.Count; i++) 113 | { 114 | this.redBlueAssets[i].IsSelected = EditorGUILayout.Toggle( 115 | this.redBlueAssets[i].AssetName, 116 | this.redBlueAssets[i].IsSelected); 117 | } 118 | 119 | EditorGUILayout.EndVertical(); 120 | 121 | // Check if any assets are selected. 122 | bool atLeastOnePackageSelected = false; 123 | foreach (var assetPackage in this.redBlueAssets) 124 | { 125 | if (assetPackage.IsSelected) 126 | { 127 | atLeastOnePackageSelected = true; 128 | break; 129 | } 130 | } 131 | 132 | EditorGUILayout.Separator(); 133 | this.includeTests = EditorGUILayout.Toggle("Include Tests", this.includeTests); 134 | 135 | EditorGUI.BeginDisabledGroup(!atLeastOnePackageSelected); 136 | if (GUILayout.Button("Export")) 137 | { 138 | this.ExportAllPackages(this.includeTests); 139 | } 140 | 141 | EditorGUI.EndDisabledGroup(); 142 | 143 | if (!atLeastOnePackageSelected) 144 | { 145 | EditorGUILayout.HelpBox( 146 | "No packages selected to export. Select at least one asset Package.", 147 | MessageType.Warning); 148 | } 149 | } 150 | 151 | private void ExportAllPackages(bool includeTests) 152 | { 153 | foreach (var asset in this.redBlueAssets) 154 | { 155 | if (asset.IsSelected) 156 | { 157 | this.ExportRBScripts(asset, includeTests); 158 | } 159 | } 160 | } 161 | 162 | private void ExportRBScripts(RBAsset assetToExport, bool includeTests) 163 | { 164 | var subDirectories = System.IO.Directory.GetDirectories(companyPath, "*", System.IO.SearchOption.AllDirectories); 165 | var directoriesToExport = new List(subDirectories); 166 | 167 | var testDirectories = GetTestDirectories(subDirectories); 168 | if (!includeTests) 169 | { 170 | foreach (var testDirectory in testDirectories) 171 | { 172 | directoriesToExport.Remove(testDirectory); 173 | } 174 | } 175 | 176 | // Do not export the other packages 177 | foreach (var asset in this.redBlueAssets) 178 | { 179 | if (assetToExport.AssetName != asset.AssetName) 180 | { 181 | string assetPath = companyPath + System.IO.Path.DirectorySeparatorChar + asset.AssetName; 182 | directoriesToExport.Remove(assetPath); 183 | 184 | var subdirectoriesOfAsset = System.IO.Directory.GetDirectories(assetPath, "*", System.IO.SearchOption.AllDirectories); 185 | foreach (var subdirectory in subdirectoriesOfAsset) 186 | { 187 | directoriesToExport.Remove(subdirectory); 188 | } 189 | } 190 | } 191 | 192 | var allAssetPaths = new List(); 193 | foreach (var directory in directoriesToExport) 194 | { 195 | var filesInDirectory = System.IO.Directory.GetFiles(directory); 196 | allAssetPaths.AddRange(filesInDirectory); 197 | } 198 | 199 | if (allAssetPaths.Count == 0) 200 | { 201 | Debug.Log("No assets to export. Will not export asset package: " + assetToExport.AssetName); 202 | return; 203 | } 204 | 205 | string filename = string.Concat(assetToExport.AssetName, includeTests ? testPackageSuffix : string.Empty, packageExtension); 206 | AssetDatabase.ExportPackage( 207 | allAssetPaths.ToArray(), 208 | filename, 209 | ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Interactive); 210 | } 211 | 212 | private class RBAsset 213 | { 214 | public string AssetName { get; set; } 215 | 216 | public bool IsSelected { get; set; } 217 | } 218 | } -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Masking.shader: -------------------------------------------------------------------------------- 1 | // Simplified SDF shader: 2 | // - No Shading Option (bevel / bump / env map) 3 | // - No Glow Option 4 | // - Softness is applied on both side of the outline 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field - Masking" { 7 | 8 | Properties { 9 | _FaceColor ("Face Color", Color) = (1,1,1,1) 10 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 11 | 12 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 13 | _OutlineWidth ("Outline Thickness", Range(0,1)) = 0 14 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 15 | 16 | _UnderlayColor ("Border Color", Color) = (0,0,0,.5) 17 | _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 18 | _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 19 | _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 20 | _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 21 | 22 | _WeightNormal ("Weight Normal", float) = 0 23 | _WeightBold ("Weight Bold", float) = .5 24 | 25 | _ShaderFlags ("Flags", float) = 0 26 | _ScaleRatioA ("Scale RatioA", float) = 1 27 | _ScaleRatioB ("Scale RatioB", float) = 1 28 | _ScaleRatioC ("Scale RatioC", float) = 1 29 | 30 | _MainTex ("Font Atlas", 2D) = "white" {} 31 | _TextureWidth ("Texture Width", float) = 512 32 | _TextureHeight ("Texture Height", float) = 512 33 | _GradientScale ("Gradient Scale", float) = 5 34 | _ScaleX ("Scale X", float) = 1 35 | _ScaleY ("Scale Y", float) = 1 36 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 37 | 38 | _VertexOffsetX ("Vertex OffsetX", float) = 0 39 | _VertexOffsetY ("Vertex OffsetY", float) = 0 40 | 41 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 42 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 43 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 44 | _MaskTex ("Mask Texture", 2D) = "white" {} 45 | _MaskInverse ("Inverse", float) = 0 46 | _MaskEdgeColor ("Edge Color", Color) = (1,1,1,1) 47 | _MaskEdgeSoftness ("Edge Softness", Range(0, 1)) = 0.01 48 | _MaskWipeControl ("Wipe Position", Range(0, 1)) = 0.5 49 | 50 | _StencilComp ("Stencil Comparison", Float) = 8 51 | _Stencil ("Stencil ID", Float) = 0 52 | _StencilOp ("Stencil Operation", Float) = 0 53 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 54 | _StencilReadMask ("Stencil Read Mask", Float) = 255 55 | 56 | _ColorMask ("Color Mask", Float) = 15 57 | } 58 | 59 | SubShader { 60 | Tags 61 | { 62 | "Queue"="Transparent" 63 | "IgnoreProjector"="True" 64 | "RenderType"="Transparent" 65 | } 66 | 67 | 68 | Stencil 69 | { 70 | Ref [_Stencil] 71 | Comp [_StencilComp] 72 | Pass [_StencilOp] 73 | ReadMask [_StencilReadMask] 74 | WriteMask [_StencilWriteMask] 75 | } 76 | 77 | Cull [_CullMode] 78 | ZWrite Off 79 | Lighting Off 80 | Fog { Mode Off } 81 | ZTest [unity_GUIZTestMode] 82 | Blend One OneMinusSrcAlpha 83 | ColorMask [_ColorMask] 84 | 85 | Pass { 86 | CGPROGRAM 87 | #pragma vertex VertShader 88 | #pragma fragment PixShader 89 | #pragma shader_feature __ OUTLINE_ON 90 | #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER 91 | 92 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 93 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 94 | 95 | 96 | #include "UnityCG.cginc" 97 | #include "UnityUI.cginc" 98 | #include "TMPro_Properties.cginc" 99 | 100 | struct vertex_t { 101 | float4 vertex : POSITION; 102 | float3 normal : NORMAL; 103 | fixed4 color : COLOR; 104 | float2 texcoord0 : TEXCOORD0; 105 | float2 texcoord1 : TEXCOORD1; 106 | }; 107 | 108 | struct pixel_t { 109 | float4 vertex : SV_POSITION; 110 | fixed4 faceColor : COLOR; 111 | fixed4 outlineColor : COLOR1; 112 | float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV 113 | half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w) 114 | half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw) 115 | #if (UNDERLAY_ON | UNDERLAY_INNER) 116 | float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved 117 | half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y) 118 | #endif 119 | }; 120 | 121 | float _MaskWipeControl; 122 | float _MaskEdgeSoftness; 123 | fixed4 _MaskEdgeColor; 124 | bool _MaskInverse; 125 | 126 | pixel_t VertShader(vertex_t input) 127 | { 128 | float bold = step(input.texcoord1.y, 0); 129 | 130 | float4 vert = input.vertex; 131 | vert.x += _VertexOffsetX; 132 | vert.y += _VertexOffsetY; 133 | float4 vPosition = UnityObjectToClipPos(vert); 134 | 135 | float2 pixelSize = vPosition.w; 136 | pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); 137 | 138 | float scale = rsqrt(dot(pixelSize, pixelSize)); 139 | scale *= abs(input.texcoord1.y) * _GradientScale * 1.5; 140 | if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 141 | 142 | float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; 143 | weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; 144 | 145 | float layerScale = scale; 146 | 147 | scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale); 148 | float bias = (0.5 - weight) * scale - 0.5; 149 | float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale; 150 | 151 | float opacity = input.color.a; 152 | #if (UNDERLAY_ON | UNDERLAY_INNER) 153 | opacity = 1.0; 154 | #endif 155 | 156 | fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor; 157 | faceColor.rgb *= faceColor.a; 158 | 159 | fixed4 outlineColor = _OutlineColor; 160 | outlineColor.a *= opacity; 161 | outlineColor.rgb *= outlineColor.a; 162 | outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2)))); 163 | 164 | #if (UNDERLAY_ON | UNDERLAY_INNER) 165 | 166 | layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale); 167 | float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale); 168 | 169 | float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; 170 | float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; 171 | float2 layerOffset = float2(x, y); 172 | #endif 173 | 174 | // Generate UV for the Masking Texture 175 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 176 | float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); 177 | 178 | // Structure for pixel shader 179 | pixel_t output = { 180 | vPosition, 181 | faceColor, 182 | outlineColor, 183 | float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y), 184 | half4(scale, bias - outline, bias + outline, bias), 185 | half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)), 186 | #if (UNDERLAY_ON | UNDERLAY_INNER) 187 | float4(input.texcoord0 + layerOffset, input.color.a, 0), 188 | half2(layerScale, layerBias), 189 | #endif 190 | }; 191 | 192 | return output; 193 | } 194 | 195 | 196 | // PIXEL SHADER 197 | fixed4 PixShader(pixel_t input) : SV_Target 198 | { 199 | half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x; 200 | half4 c = input.faceColor * saturate(d - input.param.w); 201 | 202 | #ifdef OUTLINE_ON 203 | c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z)); 204 | c *= saturate(d - input.param.y); 205 | #endif 206 | 207 | #if UNDERLAY_ON 208 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 209 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a); 210 | #endif 211 | 212 | #if UNDERLAY_INNER 213 | half sd = saturate(d - input.param.z); 214 | d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x; 215 | c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a); 216 | #endif 217 | 218 | // Alternative implementation to UnityGet2DClipping with support for softness. 219 | #if UNITY_UI_CLIP_RECT 220 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); 221 | c *= m.x * m.y; 222 | #endif 223 | 224 | float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a); 225 | float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl; 226 | a = saturate(t / _MaskEdgeSoftness); 227 | c.rgb = lerp(_MaskEdgeColor.rgb*c.a, c.rgb, a); 228 | c *= a; 229 | 230 | #if (UNDERLAY_ON | UNDERLAY_INNER) 231 | c *= input.texcoord1.z; 232 | #endif 233 | 234 | #if UNITY_UI_ALPHACLIP 235 | clip(c.a - 0.001); 236 | #endif 237 | 238 | return c; 239 | } 240 | ENDCG 241 | } 242 | } 243 | 244 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 245 | } 246 | -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Animation/TextAnimation.cs: -------------------------------------------------------------------------------- 1 | namespace RedBlueGames.Tools.TextTyper 2 | { 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using TMPro; 6 | using UnityEngine; 7 | using UnityEngine.Events; 8 | using UnityEngine.UI; 9 | 10 | [RequireComponent(typeof(TextMeshProUGUI))] 11 | public abstract class TextAnimation : MonoBehaviour 12 | { 13 | [Tooltip("0-based index of the first printable character that should be animated")] 14 | [SerializeField] 15 | private int firstCharToAnimate; 16 | 17 | [Tooltip("0-based index of the last printable character that should be animated")] 18 | [SerializeField] 19 | private int lastCharToAnimate; 20 | 21 | [Tooltip("If true, animation will begin playing immediately on Awake")] 22 | [SerializeField] 23 | private bool playOnAwake = false; 24 | 25 | /// 26 | /// Determines how often Animate() will be called 27 | /// 28 | private const float frameRate = 15f; 29 | private static readonly float timeBetweenAnimates = 1f / frameRate; 30 | 31 | private float lastAnimateTime; 32 | private TextMeshProUGUI textComponent; 33 | private TMP_TextInfo textInfo; 34 | private TMP_MeshInfo[] cachedMeshInfo; 35 | 36 | public bool UseUnscaledTime {get; set;} 37 | 38 | protected int FirstCharToAnimate 39 | { 40 | get 41 | { 42 | return this.firstCharToAnimate; 43 | } 44 | } 45 | protected int LastCharToAnimate 46 | { 47 | get 48 | { 49 | return this.lastCharToAnimate; 50 | } 51 | } 52 | 53 | private TextMeshProUGUI TextComponent 54 | { 55 | get 56 | { 57 | if (this.textComponent == null) 58 | { 59 | this.textComponent = this.GetComponent(); 60 | } 61 | 62 | return this.textComponent; 63 | } 64 | } 65 | 66 | protected float TimeForTimeScale 67 | { 68 | get 69 | { 70 | return this.UseUnscaledTime ? Time.realtimeSinceStartup : Time.time; 71 | } 72 | } 73 | 74 | /// 75 | /// Set the range of characters that should be animated by this Component 76 | /// 77 | /// 0-based index of the first printable character that should be animated 78 | /// 0-based index of the last printable character that should be animated 79 | public void SetCharsToAnimate(int firstChar, int lastChar) 80 | { 81 | this.firstCharToAnimate = firstChar; 82 | this.lastCharToAnimate = lastChar; 83 | } 84 | 85 | /// 86 | /// Cache the vertex data of the text object b/c the animation transform is applied to the original position of the characters. 87 | /// 88 | public void CacheTextMeshInfo() 89 | { 90 | this.textInfo = this.TextComponent.textInfo; 91 | this.cachedMeshInfo = this.textInfo.CopyMeshInfoVertexData(); 92 | } 93 | 94 | protected virtual void Awake() 95 | { 96 | this.enabled = this.playOnAwake; 97 | } 98 | 99 | protected virtual void Start() 100 | { 101 | this.TextComponent.ForceMeshUpdate(); 102 | this.lastAnimateTime = float.MinValue; 103 | } 104 | 105 | protected virtual void OnEnable() 106 | { 107 | TMPro_EventManager.TEXT_CHANGED_EVENT.Add(OnTMProChanged); 108 | } 109 | 110 | protected virtual void OnDisable() 111 | { 112 | TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(OnTMProChanged); 113 | 114 | // Reset to baseline/standard text mesh 115 | this.TextComponent.ForceMeshUpdate(); 116 | } 117 | 118 | protected virtual void Update() 119 | { 120 | if (this.TimeForTimeScale > this.lastAnimateTime + timeBetweenAnimates) 121 | { 122 | this.AnimateAllChars(); 123 | } 124 | } 125 | 126 | /// 127 | /// Derived classes must implement how individual characters are animated 128 | /// 129 | /// Index of character being animated 130 | /// X/Y translation vector 131 | /// 2D rotation angle 132 | /// Uniform scale 133 | protected abstract void Animate(int characterIndex, out Vector2 translation, out float rotation, out float scale); 134 | 135 | /// 136 | /// Get the vertices of the TMPro mesh, request translation/rotation/scale info from Animate(), 137 | /// then, transform the vertices and apply them back to the mesh 138 | /// 139 | public void AnimateAllChars() 140 | { 141 | this.lastAnimateTime = this.TimeForTimeScale; 142 | 143 | int characterCount = this.textInfo.characterCount; 144 | 145 | // If no characters do nothing 146 | if (characterCount == 0) 147 | { 148 | return; 149 | } 150 | 151 | for (int i = 0; i < characterCount; i++) 152 | { 153 | // Skip characters that aren't specified to animate 154 | if (i < this.firstCharToAnimate || i > this.lastCharToAnimate) 155 | { 156 | continue; 157 | } 158 | 159 | TMP_CharacterInfo charInfo = textInfo.characterInfo[i]; 160 | 161 | // Skip characters that are not visible and thus have no geometry to manipulate. 162 | if (!charInfo.isVisible) 163 | { 164 | continue; 165 | } 166 | 167 | // Get the index of the material used by the current character. 168 | int materialIndex = charInfo.materialReferenceIndex; 169 | 170 | // Get the index of the first vertex used by this text element. 171 | int vertexIndex = charInfo.vertexIndex; 172 | 173 | // Get the cached vertices of the mesh used by this text element (character or sprite). 174 | Vector3[] sourceVertices = cachedMeshInfo[materialIndex].vertices; 175 | 176 | // NOTE: Alternate calculation - Determine the center point of each character at the baseline. 177 | //Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine); 178 | // Determine the center point of each character. 179 | Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2; 180 | 181 | // Need to translate all 4 vertices of each quad to align with middle of character / baseline. 182 | // This is needed so the matrix TRS is applied at the origin for each character. 183 | Vector3 offset = charMidBasline; 184 | 185 | Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices; 186 | 187 | // Apply offset from center 188 | destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset; 189 | destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset; 190 | destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset; 191 | destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset; 192 | 193 | Vector2 translation; 194 | float rotation, scale; 195 | 196 | // This is where the derived class sets translation/rotation/scale 197 | this.Animate(i, out translation, out rotation, out scale); 198 | Matrix4x4 matrix = Matrix4x4.TRS(translation, Quaternion.Euler(0f, 0f, rotation), scale * Vector3.one); 199 | 200 | // Apply the derived class transformation 201 | destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]); 202 | destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]); 203 | destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]); 204 | destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]); 205 | 206 | // Remove offset from center 207 | destinationVertices[vertexIndex + 0] += offset; 208 | destinationVertices[vertexIndex + 1] += offset; 209 | destinationVertices[vertexIndex + 2] += offset; 210 | destinationVertices[vertexIndex + 3] += offset; 211 | } 212 | 213 | this.ApplyChangesToMesh(); 214 | } 215 | 216 | /// 217 | /// Apply the modified vertices (calculated by Animate) to the mesh 218 | /// 219 | private void ApplyChangesToMesh() 220 | { 221 | for (int i = 0; i < this.textInfo.meshInfo.Length; i++) 222 | { 223 | this.textInfo.meshInfo[i].mesh.vertices = this.textInfo.meshInfo[i].vertices; 224 | this.TextComponent.UpdateGeometry(this.textInfo.meshInfo[i].mesh, i); 225 | } 226 | } 227 | 228 | /// 229 | /// This event is fired whenever the TMPro mesh is updated 230 | /// For example, if the text string changes or MaxVisibleCharacters changes 231 | /// 232 | private void OnTMProChanged(Object obj) 233 | { 234 | if (obj == this.TextComponent) 235 | { 236 | this.CacheTextMeshInfo(); 237 | } 238 | } 239 | } 240 | } -------------------------------------------------------------------------------- /Assets/RedBlueGames/TextTyper/Examples/ExampleCurveLibrary.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 4b3c7f099297a574fb0c50c5811b9d8c, type: 3} 13 | m_Name: ExampleCurveLibrary 14 | m_EditorClassIdentifier: 15 | CurvePresets: 16 | - Name: CrazyFlip 17 | timeOffsetPerChar: 0.043 18 | xPosCurve: 19 | serializedVersion: 2 20 | m_Curve: 21 | - serializedVersion: 3 22 | time: 0 23 | value: 0 24 | inSlope: 0 25 | outSlope: 0 26 | tangentMode: 0 27 | weightedMode: 0 28 | inWeight: 0.33333334 29 | outWeight: 0.33333334 30 | m_PreInfinity: 2 31 | m_PostInfinity: 2 32 | m_RotationOrder: 0 33 | xPosMultiplier: 0 34 | yPosCurve: 35 | serializedVersion: 2 36 | m_Curve: 37 | - serializedVersion: 3 38 | time: 0 39 | value: 0 40 | inSlope: 3.7978075 41 | outSlope: 3.7978075 42 | tangentMode: 0 43 | weightedMode: 0 44 | inWeight: 0.33333334 45 | outWeight: 0.060301617 46 | - serializedVersion: 3 47 | time: 0.25 48 | value: 1 49 | inSlope: 0 50 | outSlope: 0 51 | tangentMode: 0 52 | weightedMode: 0 53 | inWeight: 0.33333334 54 | outWeight: 0.33333334 55 | - serializedVersion: 3 56 | time: 0.75 57 | value: -1 58 | inSlope: 0 59 | outSlope: 0 60 | tangentMode: 0 61 | weightedMode: 0 62 | inWeight: 0 63 | outWeight: 0 64 | - serializedVersion: 3 65 | time: 1 66 | value: 0 67 | inSlope: 4.5849752 68 | outSlope: 4.5849752 69 | tangentMode: 0 70 | weightedMode: 0 71 | inWeight: 0.064149 72 | outWeight: 0 73 | m_PreInfinity: 1 74 | m_PostInfinity: 1 75 | m_RotationOrder: 4 76 | yPosMultiplier: 0 77 | rotationCurve: 78 | serializedVersion: 2 79 | m_Curve: 80 | - serializedVersion: 3 81 | time: 0 82 | value: -0.0062561035 83 | inSlope: 0 84 | outSlope: 0 85 | tangentMode: 0 86 | weightedMode: 0 87 | inWeight: 0 88 | outWeight: 0 89 | - serializedVersion: 3 90 | time: 0.48911172 91 | value: 0.95581746 92 | inSlope: -0.047005925 93 | outSlope: -0.047005925 94 | tangentMode: 0 95 | weightedMode: 0 96 | inWeight: 0.33333334 97 | outWeight: 0.5025005 98 | - serializedVersion: 3 99 | time: 1.0041809 100 | value: -0.0000076293945 101 | inSlope: 2 102 | outSlope: 2 103 | tangentMode: 0 104 | weightedMode: 0 105 | inWeight: 0 106 | outWeight: 0 107 | m_PreInfinity: 2 108 | m_PostInfinity: 2 109 | m_RotationOrder: 4 110 | rotationMultiplier: 15.2 111 | scaleCurve: 112 | serializedVersion: 2 113 | m_Curve: 114 | - serializedVersion: 3 115 | time: 0 116 | value: -1 117 | inSlope: 3.7978075 118 | outSlope: 3.7978075 119 | tangentMode: 0 120 | weightedMode: 0 121 | inWeight: 0.33333334 122 | outWeight: 0.060301617 123 | - serializedVersion: 3 124 | time: 0.25 125 | value: 0 126 | inSlope: 0 127 | outSlope: 0 128 | tangentMode: 0 129 | weightedMode: 0 130 | inWeight: 0.33333334 131 | outWeight: 0.33333334 132 | - serializedVersion: 3 133 | time: 0.75 134 | value: -2 135 | inSlope: 0 136 | outSlope: 0 137 | tangentMode: 0 138 | weightedMode: 0 139 | inWeight: 0 140 | outWeight: 0 141 | - serializedVersion: 3 142 | time: 1 143 | value: -1 144 | inSlope: 4.5849752 145 | outSlope: 4.5849752 146 | tangentMode: 0 147 | weightedMode: 0 148 | inWeight: 0.064149 149 | outWeight: 0 150 | m_PreInfinity: 1 151 | m_PostInfinity: 1 152 | m_RotationOrder: 4 153 | scaleMultiplier: 1 154 | - Name: SlowSine 155 | timeOffsetPerChar: 0.058 156 | xPosCurve: 157 | serializedVersion: 2 158 | m_Curve: [] 159 | m_PreInfinity: 0 160 | m_PostInfinity: 0 161 | m_RotationOrder: 0 162 | xPosMultiplier: 0 163 | yPosCurve: 164 | serializedVersion: 2 165 | m_Curve: 166 | - serializedVersion: 3 167 | time: 0 168 | value: 0 169 | inSlope: 3.7978075 170 | outSlope: 3.7978075 171 | tangentMode: 0 172 | weightedMode: 0 173 | inWeight: 0.33333334 174 | outWeight: 0.060301617 175 | - serializedVersion: 3 176 | time: 0.25 177 | value: 1 178 | inSlope: 0 179 | outSlope: 0 180 | tangentMode: 0 181 | weightedMode: 0 182 | inWeight: 0.33333334 183 | outWeight: 0.33333334 184 | - serializedVersion: 3 185 | time: 0.75 186 | value: -1 187 | inSlope: 0 188 | outSlope: 0 189 | tangentMode: 0 190 | weightedMode: 0 191 | inWeight: 0 192 | outWeight: 0 193 | - serializedVersion: 3 194 | time: 1 195 | value: 0 196 | inSlope: 4.5849752 197 | outSlope: 4.5849752 198 | tangentMode: 0 199 | weightedMode: 0 200 | inWeight: 0.064149 201 | outWeight: 0 202 | m_PreInfinity: 1 203 | m_PostInfinity: 1 204 | m_RotationOrder: 4 205 | yPosMultiplier: 8.3 206 | rotationCurve: 207 | serializedVersion: 2 208 | m_Curve: [] 209 | m_PreInfinity: 2 210 | m_PostInfinity: 2 211 | m_RotationOrder: 4 212 | rotationMultiplier: 0 213 | scaleCurve: 214 | serializedVersion: 2 215 | m_Curve: [] 216 | m_PreInfinity: 2 217 | m_PostInfinity: 2 218 | m_RotationOrder: 4 219 | scaleMultiplier: 0 220 | - Name: Bounce 221 | timeOffsetPerChar: 0.009 222 | xPosCurve: 223 | serializedVersion: 2 224 | m_Curve: [] 225 | m_PreInfinity: 0 226 | m_PostInfinity: 0 227 | m_RotationOrder: 0 228 | xPosMultiplier: 0 229 | yPosCurve: 230 | serializedVersion: 2 231 | m_Curve: 232 | - serializedVersion: 3 233 | time: 0 234 | value: 0 235 | inSlope: -0.09797665 236 | outSlope: -0.09797665 237 | tangentMode: 0 238 | weightedMode: 0 239 | inWeight: 0.33333334 240 | outWeight: 0.29289895 241 | - serializedVersion: 3 242 | time: 0.10219215 243 | value: 0.0134547055 244 | inSlope: 4.7060666 245 | outSlope: 4.7060666 246 | tangentMode: 0 247 | weightedMode: 0 248 | inWeight: 0.25443903 249 | outWeight: 0.33333334 250 | - serializedVersion: 3 251 | time: 0.5 252 | value: 1 253 | inSlope: 0 254 | outSlope: 0 255 | tangentMode: 0 256 | weightedMode: 0 257 | inWeight: 0.33333334 258 | outWeight: 0.33333334 259 | - serializedVersion: 3 260 | time: 0.7820118 261 | value: -0.01093027 262 | inSlope: -0.016581338 263 | outSlope: -0.016581338 264 | tangentMode: 0 265 | weightedMode: 0 266 | inWeight: 0.33333334 267 | outWeight: 0.50150305 268 | - serializedVersion: 3 269 | time: 1 270 | value: 0 271 | inSlope: 0.31197608 272 | outSlope: 0.31197608 273 | tangentMode: 0 274 | weightedMode: 0 275 | inWeight: 0.7005903 276 | outWeight: 0 277 | m_PreInfinity: 1 278 | m_PostInfinity: 1 279 | m_RotationOrder: 4 280 | yPosMultiplier: 10 281 | rotationCurve: 282 | serializedVersion: 2 283 | m_Curve: [] 284 | m_PreInfinity: 2 285 | m_PostInfinity: 2 286 | m_RotationOrder: 4 287 | rotationMultiplier: 0 288 | scaleCurve: 289 | serializedVersion: 2 290 | m_Curve: 291 | - serializedVersion: 3 292 | time: 0 293 | value: 0 294 | inSlope: 0.15185268 295 | outSlope: 0.15185268 296 | tangentMode: 0 297 | weightedMode: 0 298 | inWeight: 0.33333334 299 | outWeight: 0.2684354 300 | - serializedVersion: 3 301 | time: 0.025213063 302 | value: 0.025649277 303 | inSlope: 1.3138535 304 | outSlope: 1.3138535 305 | tangentMode: 0 306 | weightedMode: 0 307 | inWeight: 0.10522993 308 | outWeight: 0.33333334 309 | - serializedVersion: 3 310 | time: 0.105376184 311 | value: 0.24849355 312 | inSlope: 0 313 | outSlope: 0 314 | tangentMode: 0 315 | weightedMode: 0 316 | inWeight: 0.33333334 317 | outWeight: 0.33333334 318 | - serializedVersion: 3 319 | time: 0.21328115 320 | value: -0.00064086914 321 | inSlope: 0.056443963 322 | outSlope: 0.056443963 323 | tangentMode: 0 324 | weightedMode: 0 325 | inWeight: 0.33333334 326 | outWeight: 0.22213072 327 | - serializedVersion: 3 328 | time: 0.8918457 329 | value: -0.0008544922 330 | inSlope: -0.00941646 331 | outSlope: -0.00941646 332 | tangentMode: 0 333 | weightedMode: 0 334 | inWeight: 0.33333334 335 | outWeight: 0.33333334 336 | - serializedVersion: 3 337 | time: 0.96213645 338 | value: -0.085121274 339 | inSlope: 0.02057552 340 | outSlope: 0.02057552 341 | tangentMode: 0 342 | weightedMode: 0 343 | inWeight: 0.33333334 344 | outWeight: 1 345 | - serializedVersion: 3 346 | time: 1 347 | value: 0 348 | inSlope: 1.0830793 349 | outSlope: 1.0830793 350 | tangentMode: 0 351 | weightedMode: 0 352 | inWeight: 1 353 | outWeight: 0.33333334 354 | m_PreInfinity: 1 355 | m_PostInfinity: 1 356 | m_RotationOrder: 4 357 | scaleMultiplier: 1 358 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Distance Field Overlay" { 2 | 3 | Properties { 4 | _FaceTex ("Face Texture", 2D) = "white" {} 5 | _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0 6 | _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0 7 | _FaceColor ("Face Color", Color) = (1,1,1,1) 8 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 9 | 10 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 11 | _OutlineTex ("Outline Texture", 2D) = "white" {} 12 | _OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0 13 | _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0 14 | _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 15 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 16 | 17 | _Bevel ("Bevel", Range(0,1)) = 0.5 18 | _BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0 19 | _BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0 20 | _BevelClamp ("Bevel Clamp", Range(0,1)) = 0 21 | _BevelRoundness ("Bevel Roundness", Range(0,1)) = 0 22 | 23 | _LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416 24 | _SpecularColor ("Specular", Color) = (1,1,1,1) 25 | _SpecularPower ("Specular", Range(0,4)) = 2.0 26 | _Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10 27 | _Diffuse ("Diffuse", Range(0,1)) = 0.5 28 | _Ambient ("Ambient", Range(1,0)) = 0.5 29 | 30 | _BumpMap ("Normal map", 2D) = "bump" {} 31 | _BumpOutline ("Bump Outline", Range(0,1)) = 0 32 | _BumpFace ("Bump Face", Range(0,1)) = 0 33 | 34 | _ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1) 35 | _ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1) 36 | _Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ } 37 | _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0) 38 | 39 | 40 | _UnderlayColor ("Border Color", Color) = (0,0,0, 0.5) 41 | _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 42 | _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 43 | _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 44 | _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 45 | 46 | _GlowColor ("Color", Color) = (0, 1, 0, 0.5) 47 | _GlowOffset ("Offset", Range(-1,1)) = 0 48 | _GlowInner ("Inner", Range(0,1)) = 0.05 49 | _GlowOuter ("Outer", Range(0,1)) = 0.05 50 | _GlowPower ("Falloff", Range(1, 0)) = 0.75 51 | 52 | _WeightNormal ("Weight Normal", float) = 0 53 | _WeightBold ("Weight Bold", float) = 0.5 54 | 55 | _ShaderFlags ("Flags", float) = 0 56 | _ScaleRatioA ("Scale RatioA", float) = 1 57 | _ScaleRatioB ("Scale RatioB", float) = 1 58 | _ScaleRatioC ("Scale RatioC", float) = 1 59 | 60 | _MainTex ("Font Atlas", 2D) = "white" {} 61 | _TextureWidth ("Texture Width", float) = 512 62 | _TextureHeight ("Texture Height", float) = 512 63 | _GradientScale ("Gradient Scale", float) = 5.0 64 | _ScaleX ("Scale X", float) = 1.0 65 | _ScaleY ("Scale Y", float) = 1.0 66 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 67 | 68 | _VertexOffsetX ("Vertex OffsetX", float) = 0 69 | _VertexOffsetY ("Vertex OffsetY", float) = 0 70 | 71 | _MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767) 72 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 73 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 74 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 75 | 76 | _StencilComp ("Stencil Comparison", Float) = 8 77 | _Stencil ("Stencil ID", Float) = 0 78 | _StencilOp ("Stencil Operation", Float) = 0 79 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 80 | _StencilReadMask ("Stencil Read Mask", Float) = 255 81 | 82 | _ColorMask ("Color Mask", Float) = 15 83 | } 84 | 85 | SubShader { 86 | 87 | Tags 88 | { 89 | "Queue"="Overlay" 90 | "IgnoreProjector"="True" 91 | "RenderType"="Transparent" 92 | } 93 | 94 | Stencil 95 | { 96 | Ref [_Stencil] 97 | Comp [_StencilComp] 98 | Pass [_StencilOp] 99 | ReadMask [_StencilReadMask] 100 | WriteMask [_StencilWriteMask] 101 | } 102 | 103 | Cull [_CullMode] 104 | ZWrite Off 105 | Lighting Off 106 | Fog { Mode Off } 107 | ZTest Always 108 | Blend One OneMinusSrcAlpha 109 | ColorMask [_ColorMask] 110 | 111 | Pass { 112 | CGPROGRAM 113 | #pragma target 3.0 114 | #pragma vertex VertShader 115 | #pragma fragment PixShader 116 | #pragma shader_feature __ BEVEL_ON 117 | #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER 118 | #pragma shader_feature __ GLOW_ON 119 | 120 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 121 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 122 | 123 | 124 | #include "UnityCG.cginc" 125 | #include "UnityUI.cginc" 126 | #include "TMPro_Properties.cginc" 127 | #include "TMPro.cginc" 128 | 129 | struct vertex_t { 130 | float4 position : POSITION; 131 | float3 normal : NORMAL; 132 | fixed4 color : COLOR; 133 | float2 texcoord0 : TEXCOORD0; 134 | float2 texcoord1 : TEXCOORD1; 135 | }; 136 | 137 | 138 | struct pixel_t { 139 | float4 position : SV_POSITION; 140 | fixed4 color : COLOR; 141 | float2 atlas : TEXCOORD0; // Atlas 142 | float4 param : TEXCOORD1; // alphaClip, scale, bias, weight 143 | float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw) 144 | float3 viewDir : TEXCOORD3; 145 | 146 | #if (UNDERLAY_ON || UNDERLAY_INNER) 147 | float4 texcoord2 : TEXCOORD4; // u,v, scale, bias 148 | fixed4 underlayColor : COLOR1; 149 | #endif 150 | float4 textures : TEXCOORD5; 151 | }; 152 | 153 | // Used by Unity internally to handle Texture Tiling and Offset. 154 | float4 _FaceTex_ST; 155 | float4 _OutlineTex_ST; 156 | 157 | pixel_t VertShader(vertex_t input) 158 | { 159 | float bold = step(input.texcoord1.y, 0); 160 | 161 | float4 vert = input.position; 162 | vert.x += _VertexOffsetX; 163 | vert.y += _VertexOffsetY; 164 | float4 vPosition = UnityObjectToClipPos(vert); 165 | 166 | float2 pixelSize = vPosition.w; 167 | pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); 168 | float scale = rsqrt(dot(pixelSize, pixelSize)); 169 | scale *= abs(input.texcoord1.y) * _GradientScale * 1.5; 170 | if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 171 | 172 | float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0; 173 | weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5; 174 | 175 | float bias =(.5 - weight) + (.5 / scale); 176 | 177 | float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA); 178 | 179 | #if GLOW_ON 180 | alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB); 181 | #endif 182 | 183 | alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight; 184 | 185 | #if (UNDERLAY_ON || UNDERLAY_INNER) 186 | float4 underlayColor = _UnderlayColor; 187 | underlayColor.rgb *= underlayColor.a; 188 | 189 | float bScale = scale; 190 | bScale /= 1 + ((_UnderlaySoftness*_ScaleRatioC) * bScale); 191 | float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale); 192 | 193 | float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth; 194 | float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight; 195 | float2 bOffset = float2(x, y); 196 | #endif 197 | 198 | // Generate UV for the Masking Texture 199 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 200 | float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); 201 | 202 | // Support for texture tiling and offset 203 | float2 textureUV = UnpackUV(input.texcoord1.x); 204 | float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex); 205 | float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex); 206 | 207 | pixel_t output = { 208 | vPosition, 209 | input.color, 210 | input.texcoord0, 211 | float4(alphaClip, scale, bias, weight), 212 | half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)), 213 | mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz), 214 | #if (UNDERLAY_ON || UNDERLAY_INNER) 215 | float4(input.texcoord0 + bOffset, bScale, bBias), 216 | underlayColor, 217 | #endif 218 | float4(faceUV, outlineUV), 219 | }; 220 | 221 | return output; 222 | } 223 | 224 | 225 | fixed4 PixShader(pixel_t input) : SV_Target 226 | { 227 | float c = tex2D(_MainTex, input.atlas).a; 228 | 229 | #ifndef UNDERLAY_ON 230 | clip(c - input.param.x); 231 | #endif 232 | 233 | float scale = input.param.y; 234 | float bias = input.param.z; 235 | float weight = input.param.w; 236 | float sd = (bias - c) * scale; 237 | 238 | float outline = (_OutlineWidth * _ScaleRatioA) * scale; 239 | float softness = (_OutlineSoftness * _ScaleRatioA) * scale; 240 | 241 | half4 faceColor = _FaceColor; 242 | half4 outlineColor = _OutlineColor; 243 | 244 | faceColor.rgb *= input.color.rgb; 245 | 246 | faceColor *= tex2D(_FaceTex, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y); 247 | outlineColor *= tex2D(_OutlineTex, input.textures.zw + float2(_OutlineUVSpeedX, _OutlineUVSpeedY) * _Time.y); 248 | 249 | faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); 250 | 251 | #if BEVEL_ON 252 | float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0); 253 | float3 n = GetSurfaceNormal(input.atlas, weight, dxy); 254 | 255 | float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz; 256 | bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5)); 257 | n = normalize(n- bump); 258 | 259 | float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), -1.0)); 260 | 261 | float3 col = GetSpecular(n, light); 262 | faceColor.rgb += col*faceColor.a; 263 | faceColor.rgb *= 1-(dot(n, light)*_Diffuse); 264 | faceColor.rgb *= lerp(_Ambient, 1, n.z*n.z); 265 | 266 | fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n)); 267 | faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; 268 | #endif 269 | 270 | #if UNDERLAY_ON 271 | float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; 272 | faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a); 273 | #endif 274 | 275 | #if UNDERLAY_INNER 276 | float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z; 277 | faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a); 278 | #endif 279 | 280 | #if GLOW_ON 281 | float4 glowColor = GetGlowColor(sd, scale); 282 | faceColor.rgb += glowColor.rgb * glowColor.a; 283 | #endif 284 | 285 | // Alternative implementation to UnityGet2DClipping with support for softness. 286 | #if UNITY_UI_CLIP_RECT 287 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw); 288 | faceColor *= m.x * m.y; 289 | #endif 290 | 291 | #if UNITY_UI_ALPHACLIP 292 | clip(faceColor.a - 0.001); 293 | #endif 294 | 295 | return faceColor * input.color.a; 296 | } 297 | 298 | ENDCG 299 | } 300 | } 301 | 302 | Fallback "TextMeshPro/Mobile/Distance Field" 303 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 304 | } 305 | --------------------------------------------------------------------------------