├── .gitattributes ├── .gitignore ├── Assets ├── Demo.meta ├── Demo │ ├── BuyInventoryItem.cs │ ├── BuyInventoryItem.cs.meta │ ├── Data.meta │ ├── Data │ │ ├── CookieData.asset │ │ ├── CookieData.asset.meta │ │ ├── CupcakeData.asset │ │ └── CupcakeData.asset.meta │ ├── Demo.unity │ ├── Demo.unity.meta │ ├── GameController.cs │ ├── GameController.cs.meta │ ├── InventoryItem.cs │ ├── InventoryItem.cs.meta │ ├── InventoryItemData.cs │ ├── InventoryItemData.cs.meta │ ├── NewsFeedReader.cs │ ├── NewsFeedReader.cs.meta │ ├── NotificationConsole.cs │ ├── NotificationConsole.cs.meta │ ├── NotificationEventItem.cs │ ├── NotificationEventItem.cs.meta │ ├── PendingNotificationItem.cs │ ├── PendingNotificationItem.cs.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── BuyItem.prefab │ │ ├── BuyItem.prefab.meta │ │ ├── Console.prefab │ │ ├── Console.prefab.meta │ │ ├── Event.prefab │ │ ├── Event.prefab.meta │ │ ├── GameController.prefab │ │ ├── GameController.prefab.meta │ │ ├── GameUI.prefab │ │ ├── GameUI.prefab.meta │ │ ├── InventoryItem.prefab │ │ ├── InventoryItem.prefab.meta │ │ ├── Notification.prefab │ │ └── Notification.prefab.meta │ ├── Sprites.meta │ └── Sprites │ │ ├── cookie.png │ │ ├── cookie.png.meta │ │ ├── cupcake.png │ │ ├── cupcake.png.meta │ │ ├── heart.png │ │ ├── heart.png.meta │ │ ├── newsloadingicon.png │ │ ├── newsloadingicon.png.meta │ │ ├── progressbar.png │ │ └── progressbar.png.meta ├── Editor.meta ├── Editor │ ├── com.unity.mobile.notifications.meta │ └── com.unity.mobile.notifications │ │ ├── NotificationSettings.asset │ │ └── NotificationSettings.asset.meta ├── Scripts.meta ├── Scripts │ ├── DefaultSerializer.cs │ ├── DefaultSerializer.cs.meta │ ├── GameNotification.cs │ ├── GameNotification.cs.meta │ ├── GameNotificationsManager.cs │ ├── GameNotificationsManager.cs.meta │ ├── GameNotificationsPlatform.cs │ ├── GameNotificationsPlatform.cs.meta │ ├── IPendingNotificationsSerializer.cs │ ├── IPendingNotificationsSerializer.cs.meta │ ├── PendingNotification.cs │ └── PendingNotification.cs.meta ├── TextMesh Pro.meta └── TextMesh Pro │ ├── Documentation.meta │ ├── Documentation │ ├── TextMesh Pro User Guide 2016.pdf │ └── TextMesh Pro User Guide 2016.pdf.meta │ ├── Resources.meta │ ├── Resources │ ├── Fonts & Materials.meta │ ├── Fonts & Materials │ │ ├── LiberationSans SDF - Drop Shadow.mat │ │ ├── LiberationSans SDF - Drop Shadow.mat.meta │ │ ├── LiberationSans SDF - Outline.mat │ │ ├── LiberationSans SDF - Outline.mat.meta │ │ ├── LiberationSans SDF.asset │ │ └── LiberationSans SDF.asset.meta │ ├── LineBreaking Following Characters.txt │ ├── LineBreaking Following Characters.txt.meta │ ├── LineBreaking Leading Characters.txt │ ├── LineBreaking Leading Characters.txt.meta │ ├── Shaders.meta │ ├── Shaders │ │ ├── TMP_Bitmap-Custom-Atlas.shader │ │ ├── TMP_Bitmap-Custom-Atlas.shader.meta │ │ ├── TMP_Bitmap-Mobile.shader │ │ ├── TMP_Bitmap-Mobile.shader.meta │ │ ├── TMP_Bitmap.shader │ │ ├── TMP_Bitmap.shader.meta │ │ ├── TMP_SDF Overlay.shader │ │ ├── TMP_SDF Overlay.shader.meta │ │ ├── TMP_SDF-Mobile Masking.shader │ │ ├── TMP_SDF-Mobile Masking.shader.meta │ │ ├── TMP_SDF-Mobile Overlay.shader │ │ ├── TMP_SDF-Mobile Overlay.shader.meta │ │ ├── TMP_SDF-Mobile.shader │ │ ├── TMP_SDF-Mobile.shader.meta │ │ ├── TMP_SDF-Surface-Mobile.shader │ │ ├── TMP_SDF-Surface-Mobile.shader.meta │ │ ├── TMP_SDF-Surface.shader │ │ ├── TMP_SDF-Surface.shader.meta │ │ ├── TMP_SDF.shader │ │ ├── TMP_SDF.shader.meta │ │ ├── TMP_Sprite.shader │ │ ├── TMP_Sprite.shader.meta │ │ ├── TMPro.cginc │ │ ├── TMPro.cginc.meta │ │ ├── TMPro_Properties.cginc │ │ ├── TMPro_Properties.cginc.meta │ │ ├── TMPro_Surface.cginc │ │ └── TMPro_Surface.cginc.meta │ ├── Sprite Assets.meta │ ├── Sprite Assets │ │ ├── EmojiOne.asset │ │ └── EmojiOne.asset.meta │ ├── Style Sheets.meta │ ├── Style Sheets │ │ ├── Default Style Sheet.asset │ │ └── Default Style Sheet.asset.meta │ ├── TMP Settings.asset │ └── TMP Settings.asset.meta │ ├── Sprites.meta │ └── Sprites │ ├── EmojiOne Attribution.txt │ ├── EmojiOne Attribution.txt.meta │ ├── EmojiOne.json │ ├── EmojiOne.json.meta │ ├── EmojiOne.png │ └── EmojiOne.png.meta ├── License.md ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Don't touch EOLs 2 | * -text 3 | 4 | # Actual text files 5 | *.cs diff=csharp 6 | *.cginc 7 | *.shader 8 | *.bat 9 | *.sh 10 | 11 | # Unity files 12 | *.unity merge=unityyamlmerge 13 | *.prefab merge=unityyamlmerge 14 | *.meta merge=unityyamlmerge 15 | *.mat merge=unityyamlmerge 16 | *.anim merge=unityyamlmerge 17 | *.cubemap merge=unityyamlmerge 18 | *.fontsettings merge=unityyamlmerge 19 | *.physicMaterial merge=unityyamlmerge 20 | *.physicsMaterial2D merge=unityyamlmerge 21 | *.mask merge=unityyamlmerge 22 | *.overrideController merge=unityyamlmerge 23 | *.controller merge=unityyamlmerge 24 | *.flare merge=unityyamlmerge 25 | *.playable merge=unityyamlmerge 26 | *.spriteatlas merge=unityyamlmerge 27 | *.mixer merge=unityyamlmerge 28 | *.guiskin merge=unityyamlmerge 29 | *.asset merge=unityyamlmerge 30 | 31 | ## git-lfs ## 32 | 33 | # Textures 34 | *.bmp filter=lfs diff=lfs merge=lfs 35 | *.jpg filter=lfs diff=lfs merge=lfs 36 | *.jpeg filter=lfs diff=lfs merge=lfs 37 | *.png filter=lfs diff=lfs merge=lfs 38 | *.tga filter=lfs diff=lfs merge=lfs 39 | *.tiff filter=lfs diff=lfs merge=lfs 40 | *.tif filter=lfs diff=lfs merge=lfs 41 | *.psd filter=lfs diff=lfs merge=lfs 42 | *.exr filter=lfs diff=lfs merge=lfs 43 | *.dds filter=lfs diff=lfs merge=lfs 44 | 45 | # Audio 46 | *.mp3 filter=lfs diff=lfs merge=lfs 47 | *.wav filter=lfs diff=lfs merge=lfs 48 | *.ogg filter=lfs diff=lfs merge=lfs 49 | *.aif filter=lfs diff=lfs merge=lfs 50 | 51 | # Video 52 | *.mp4 filter=lfs diff=lfs merge=lfs 53 | *.mov filter=lfs diff=lfs merge=lfs 54 | *.avi filter=lfs diff=lfs merge=lfs 55 | 56 | # Meshes 57 | *.fbx filter=lfs diff=lfs merge=lfs 58 | *.blend filter=lfs diff=lfs merge=lfs 59 | *.obj filter=lfs diff=lfs merge=lfs 60 | 61 | # Other binaries 62 | *.a filter=lfs diff=lfs merge=lfs 63 | *.exe filter=lfs diff=lfs merge=lfs 64 | *.pdf filter=lfs diff=lfs merge=lfs 65 | *.zip filter=lfs diff=lfs merge=lfs 66 | *.dll filter=lfs diff=lfs merge=lfs 67 | *.mdb filter=lfs diff=lfs merge=lfs 68 | *.unitypackage filter=lfs diff=lfs merge=lfs 69 | *.ttf filter=lfs diff=lfs merge=lfs 70 | *.assetbundle filter=lfs diff=lfs merge=lfs -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific stuff: 2 | .idea/ 3 | 4 | ## Plugin-specific files: 5 | 6 | # IntelliJ 7 | out/ 8 | 9 | ### Unity template 10 | [Ll]ibrary 11 | [Tt]emp 12 | Assets/AssetStoreTools* 13 | .gradle 14 | 15 | # Autogenerated VS/MD/Consulo solution and project files 16 | *.csproj 17 | *.unityproj 18 | *.sln 19 | *.suo 20 | *.tmp 21 | *.user 22 | *.userprefs 23 | *.pidb 24 | *.booproj 25 | *.svd 26 | *.pdb 27 | 28 | /Build 29 | 30 | # Unity3D generated meta files 31 | *.pidb.meta 32 | 33 | # Unity3D Generated File On Crash Reports 34 | sysinfo.txt 35 | 36 | ### Windows template 37 | # Windows thumbnail cache files 38 | Thumbs.db 39 | 40 | # Folder config file 41 | Desktop.ini 42 | 43 | ### C# files 44 | bin/ 45 | obj/ 46 | _Builds 47 | NotificationsSamples.sln.DotSettings 48 | -------------------------------------------------------------------------------- /Assets/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb3a0c5453185624f878091b74e1fa21 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/BuyInventoryItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TMPro; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace NotificationSamples.Demo 7 | { 8 | /// 9 | /// UI list item for buying an inventory item. 10 | /// 11 | public class BuyInventoryItem : MonoBehaviour 12 | { 13 | [SerializeField] 14 | protected TextMeshProUGUI titleLabel; 15 | [SerializeField] 16 | protected TextMeshProUGUI timeLabel; 17 | [SerializeField] 18 | protected TextMeshProUGUI costLabel; 19 | [SerializeField] 20 | protected Image icon; 21 | [SerializeField] 22 | protected Button buyButton; 23 | [SerializeField] 24 | protected Image progressImage; 25 | 26 | // Fired when the buy button is pressed. 27 | private Action bought; 28 | 29 | // When the last bought item will be delivered. 30 | private DateTime? deliveryTime; 31 | 32 | // Initial time remaining for the delivery of the last bought item. 33 | private float initialTimeRemaining; 34 | 35 | // The last currency received from the game controller. 36 | private int currency; 37 | 38 | /// 39 | /// Title to show in the notification. 40 | /// 41 | public string Title => titleLabel.text; 42 | 43 | /// 44 | /// Description to show in the notification. 45 | /// 46 | public string Description { get; private set; } 47 | 48 | /// 49 | /// Fire notification after this amount of minutes. 50 | /// 51 | public float Minutes { get; set; } 52 | 53 | /// 54 | /// The item's cost. 55 | /// 56 | public int Cost { get; set; } 57 | 58 | /// 59 | /// The item data linked to this UI item. 60 | /// 61 | public InventoryItemData ItemData { get; private set; } 62 | 63 | /// 64 | /// Initialise the item with the specified settings. 65 | /// 66 | public void Initialise(InventoryItemData itemData, Action buyAction) 67 | { 68 | ItemData = itemData; 69 | titleLabel.text = itemData.Title; 70 | Minutes = itemData.InitialCreationTime; 71 | Description = itemData.Description; 72 | Cost = itemData.InitialCost; 73 | icon.sprite = itemData.Icon; 74 | bought = buyAction; 75 | deliveryTime = null; 76 | progressImage.fillAmount = 0.0f; 77 | UpdateControls(); 78 | } 79 | 80 | /// 81 | /// Called when the buy button is clicked. 82 | /// 83 | public void OnBuy() 84 | { 85 | bought?.Invoke(this); 86 | } 87 | 88 | /// 89 | /// Called when buying an item was successful. 90 | /// 91 | public void OnBuySuccess(DateTime boughtDeliveryTime) 92 | { 93 | deliveryTime = boughtDeliveryTime; 94 | initialTimeRemaining = GetTimeRemaining(); 95 | buyButton.interactable = false; 96 | UpdateControls(); 97 | } 98 | 99 | /// 100 | /// Update UI controls. 101 | /// 102 | public void UpdateControls() 103 | { 104 | if (deliveryTime != null) 105 | { 106 | // Do not update the labels (i.e. show the old values until the item is delivered). 107 | return; 108 | } 109 | costLabel.text = Cost.ToString("N0"); 110 | timeLabel.text = $"Takes {Minutes:F1} minute(s)"; 111 | } 112 | 113 | /// 114 | /// Called when the game's currency total changed. 115 | /// 116 | public void OnCurrencyChanged(int newCurrency) 117 | { 118 | currency = newCurrency; 119 | UpdateBuyButton(); 120 | } 121 | 122 | /// 123 | /// Called when an item was delivered. 124 | /// 125 | public void OnDeliveredItem(InventoryItemData itemData) 126 | { 127 | if (itemData == ItemData) 128 | { 129 | UpdateBuyButton(); 130 | } 131 | } 132 | 133 | // Time remaining until the last bought item is delivered. 134 | private float GetTimeRemaining() 135 | { 136 | if (deliveryTime == null) 137 | { 138 | return 0.0f; 139 | } 140 | TimeSpan timeSpan = deliveryTime.Value - DateTime.Now; 141 | return Mathf.Max((float)timeSpan.TotalSeconds, 0.0f); 142 | } 143 | 144 | private void Update() 145 | { 146 | UpdateProgress(); 147 | } 148 | 149 | // Determine if the buy button should be interactable. 150 | private void UpdateBuyButton() 151 | { 152 | buyButton.interactable = currency >= Cost && GetTimeRemaining() <= 0.0f; 153 | } 154 | 155 | // Update an item's delivery progress, and update the progress bar. 156 | private void UpdateProgress() 157 | { 158 | if (deliveryTime == null) 159 | { 160 | return; 161 | } 162 | float timeRemaining = GetTimeRemaining(); 163 | if (timeRemaining > 0.0f) 164 | { 165 | progressImage.fillAmount = 1.0f - Mathf.Clamp01(timeRemaining / initialTimeRemaining); 166 | return; 167 | } 168 | progressImage.fillAmount = 0.0f; 169 | deliveryTime = null; 170 | UpdateControls(); 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /Assets/Demo/BuyInventoryItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3748f80abcfae4727bb9aa6f5c76cb05 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f67d40e69341341e895ed2c2bd9c01ab 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Data/CookieData.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: 69315768b2baa4a3b8409745cca9bd7f, type: 3} 13 | m_Name: CookieData 14 | m_EditorClassIdentifier: 15 | Title: Cookie 16 | Description: A nice cookie. 17 | Icon: {fileID: 21300000, guid: eb24c38f144234b3ebbb8091d47d8f05, type: 3} 18 | InitialCost: 10 19 | CostIncrease: 5 20 | InitialCreationTime: 0.1 21 | CreationTimeIncrease: 0.1 22 | CurrencyBonus: 1 23 | IconId: icon_cookie 24 | -------------------------------------------------------------------------------- /Assets/Demo/Data/CookieData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d34eef51027b48e690a3c49134673c9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Data/CupcakeData.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: 69315768b2baa4a3b8409745cca9bd7f, type: 3} 13 | m_Name: CupcakeData 14 | m_EditorClassIdentifier: 15 | Title: Cupcake 16 | Description: A nice cupcake. 17 | Icon: {fileID: 21300000, guid: 77e9fb8ea74be4f1a94808ee169f2209, type: 3} 18 | InitialCost: 15 19 | CostIncrease: 8 20 | InitialCreationTime: 0.1 21 | CreationTimeIncrease: 0.3 22 | CurrencyBonus: 2 23 | IconId: icon_cupcake 24 | -------------------------------------------------------------------------------- /Assets/Demo/Data/CupcakeData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c74432055a60b4c188d28378e3b20d63 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a8dc573bd002341a4c8035354f4aaa 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/GameController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d87151d06c55490fadb463b5de02a0e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/InventoryItem.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace NotificationSamples.Demo 6 | { 7 | /// 8 | /// UI list item for purchased inventory items. 9 | /// 10 | public class InventoryItem : MonoBehaviour 11 | { 12 | [SerializeField, Tooltip("Label to store the quantity bought.")] 13 | protected TextMeshProUGUI quantityLabel; 14 | [SerializeField] 15 | protected Image icon; 16 | 17 | // Quantity of items bought. 18 | private int quantity; 19 | 20 | /// 21 | /// The item data linked to this UI item. 22 | /// 23 | public InventoryItemData ItemData { get; private set; } 24 | 25 | /// 26 | /// Initialise the item with the specified settings. 27 | /// 28 | public void Initialise(InventoryItemData itemData) 29 | { 30 | ItemData = itemData; 31 | icon.sprite = itemData.Icon; 32 | quantity = 1; 33 | UpdateControls(); 34 | } 35 | 36 | /// 37 | /// Called when another item of the same type was received after buying. 38 | /// 39 | public void OnReceivedItem() 40 | { 41 | quantity++; 42 | UpdateControls(); 43 | } 44 | 45 | // Update UI controls. 46 | private void UpdateControls() 47 | { 48 | quantityLabel.text = quantity.ToString(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Demo/InventoryItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580a2927f8fe34f1a9acae8c8980637b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/InventoryItemData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NotificationSamples.Demo 4 | { 5 | /// 6 | /// Inventory item data. 7 | /// 8 | [CreateAssetMenu(fileName = "InventoryItemData", menuName = "NotificationsSamples/Inventory Item", order = 1)] 9 | public class InventoryItemData : ScriptableObject 10 | { 11 | [Tooltip("Item's title.")] 12 | public string Title; 13 | 14 | [Tooltip("Item's description.")] 15 | public string Description; 16 | 17 | [Tooltip("The item's icon to use in the UI.")] 18 | public Sprite Icon; 19 | 20 | [Tooltip("Item's initial cost.")] 21 | public int InitialCost; 22 | 23 | [Tooltip("Cost increase every time it is bought.")] 24 | public int CostIncrease; 25 | 26 | [Tooltip("How long it takes to create the item after buying it (minutes).")] 27 | public float InitialCreationTime; 28 | 29 | [Tooltip("Increase the creation time every time it is bought (minutes).")] 30 | public float CreationTimeIncrease; 31 | 32 | [Tooltip("Currency bonus the item provides per second.")] 33 | public float CurrencyBonus; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Demo/InventoryItemData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69315768b2baa4a3b8409745cca9bd7f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/NewsFeedReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Xml; 4 | using UnityEngine; 5 | using UnityEngine.Networking; 6 | 7 | namespace NotificationSamples.Demo 8 | { 9 | /// 10 | /// Read a news feed (RSS). 11 | /// 12 | public class NewsFeedReader : MonoBehaviour 13 | { 14 | /// 15 | /// A single news item. 16 | /// 17 | public class NewsItem 18 | { 19 | public string Title; 20 | public string Description; 21 | } 22 | 23 | /// 24 | /// Get the first news item from the RSS URL. 25 | /// 26 | /// RSS URL. 27 | /// Action to fire when the process is done. The item will be null if it failed. 28 | public void GetFirstItem(string url, Action doneAction) 29 | { 30 | StartCoroutine(GetFirstItemInternal(url, doneAction)); 31 | } 32 | 33 | // Get the first news item from the RSS URL. 34 | private IEnumerator GetFirstItemInternal(string url, Action doneAction) 35 | { 36 | UnityWebRequest www = UnityWebRequest.Get(url); 37 | yield return www.SendWebRequest(); 38 | 39 | #pragma warning disable 0618 40 | if (www.isNetworkError || www.isHttpError) 41 | #pragma warning restore 0618 42 | { 43 | Debug.LogErrorFormat("Failed to get the feed from the url. ERROR: {0}", www.error); 44 | doneAction?.Invoke(null); 45 | yield break; 46 | } 47 | 48 | XmlDocument document = new XmlDocument(); 49 | try 50 | { 51 | document.LoadXml(www.downloadHandler.text); 52 | } 53 | catch (Exception e) 54 | { 55 | Debug.LogErrorFormat("Failed to extract the XML. ERROR: {0}", e); 56 | doneAction?.Invoke(null); 57 | yield break; 58 | } 59 | 60 | XmlNode channel = FindNode(document.FirstChild, "channel"); 61 | if (channel == null || !channel.HasChildNodes) 62 | { 63 | Debug.LogError("XML does not have a channel node."); 64 | doneAction?.Invoke(null); 65 | yield break; 66 | } 67 | 68 | XmlNode channelTitle = FindNode(channel.FirstChild, "title"); 69 | XmlNode item = FindNode(channel.FirstChild, "item"); 70 | if (item == null || !item.HasChildNodes) 71 | { 72 | Debug.LogError("First item is null or has no children."); 73 | doneAction?.Invoke(null); 74 | yield break; 75 | } 76 | XmlNode title = FindNode(item.FirstChild, "title"); 77 | XmlNode description = FindNode(item.FirstChild, "description"); 78 | if (title == null || description == null) 79 | { 80 | Debug.LogErrorFormat("Item ({0}) does not have a title or description.", item.Name); 81 | doneAction?.Invoke(null); 82 | yield break; 83 | } 84 | 85 | NewsItem newsItem = new NewsItem 86 | { 87 | Title = channelTitle != null ? channelTitle.InnerText : title.InnerText, 88 | Description = title.InnerText 89 | }; 90 | doneAction?.Invoke(newsItem); 91 | } 92 | 93 | // Find the node with the specified name. The search starts at the first node and checks its children, 94 | // siblings and children's siblings. 95 | private XmlNode FindNode(XmlNode firstNode, string nodeName) 96 | { 97 | XmlNode result = firstNode; 98 | while (result != null) 99 | { 100 | if (result.Name == nodeName) 101 | { 102 | return result; 103 | } 104 | 105 | // Check children 106 | if (result.HasChildNodes) 107 | { 108 | XmlNode childNode = FindNode(result.FirstChild, nodeName); 109 | if (childNode != null) 110 | { 111 | return childNode; 112 | } 113 | } 114 | 115 | result = result.NextSibling; 116 | } 117 | return null; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Assets/Demo/NewsFeedReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57d48f28dfaef4638b0983a41dd9f536 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/NotificationConsole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using TMPro; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace NotificationSamples.Demo 8 | { 9 | /// 10 | /// Manages the console on screen that displays information about notifications, 11 | /// and allows you to schedule more. 12 | /// 13 | public class NotificationConsole : MonoBehaviour 14 | { 15 | [SerializeField] 16 | protected Button sendButton; 17 | 18 | [SerializeField] 19 | protected Button clearEventButton; 20 | 21 | [SerializeField] 22 | protected TMP_InputField titleField; 23 | 24 | [SerializeField] 25 | protected TMP_InputField bodyField; 26 | 27 | [SerializeField] 28 | protected TMP_InputField timeField; 29 | 30 | [SerializeField] 31 | protected TMP_InputField badgeField; 32 | 33 | [SerializeField] 34 | protected GameNotificationsManager manager; 35 | 36 | [SerializeField] 37 | protected Transform pendingNotificationsListParent; 38 | 39 | [SerializeField] 40 | protected PendingNotificationItem pendingNotificationPrefab; 41 | 42 | [SerializeField] 43 | protected Transform pendingEventParent; 44 | 45 | [SerializeField] 46 | protected NotificationEventItem eventPrefab; 47 | 48 | // Update pending notifications in the next update. 49 | private bool updatePendingNotifications; 50 | 51 | private void Awake() 52 | { 53 | if (sendButton != null) 54 | { 55 | sendButton.onClick.AddListener(SendNotificationFromUi); 56 | } 57 | 58 | if (clearEventButton != null) 59 | { 60 | clearEventButton.onClick.AddListener(ClearEvents); 61 | } 62 | } 63 | 64 | private IEnumerator Start() 65 | { 66 | return manager.Initialize(); 67 | } 68 | 69 | private void OnDestroy() 70 | { 71 | if (sendButton != null) 72 | { 73 | sendButton.onClick.RemoveListener(SendNotificationFromUi); 74 | } 75 | 76 | if (clearEventButton != null) 77 | { 78 | clearEventButton.onClick.RemoveListener(ClearEvents); 79 | } 80 | } 81 | 82 | private void OnEnable() 83 | { 84 | if (manager != null) 85 | { 86 | manager.LocalNotificationDelivered += OnDelivered; 87 | manager.LocalNotificationExpired += OnExpired; 88 | } 89 | } 90 | 91 | private void OnDisable() 92 | { 93 | if (manager != null) 94 | { 95 | manager.LocalNotificationDelivered -= OnDelivered; 96 | manager.LocalNotificationExpired -= OnExpired; 97 | } 98 | } 99 | 100 | /// 101 | /// Queue a notification with the given parameters. 102 | /// 103 | /// The title for the notification. 104 | /// The body text for the notification. 105 | /// The time to deliver the notification. 106 | /// The optional badge number to display on the application icon. 107 | /// 108 | /// Whether to reschedule the notification if foregrounding and the notification hasn't yet been shown. 109 | /// 110 | /// the channel must be registered in . 111 | /// Notification small icon. 112 | /// Notification large icon. 113 | public void SendNotification(string title, string body, DateTime deliveryTime, int? badgeNumber = null, 114 | bool reschedule = false) 115 | { 116 | GameNotification notification = manager.CreateNotification(); 117 | 118 | if (notification == null) 119 | { 120 | return; 121 | } 122 | 123 | notification.Title = title; 124 | notification.Body = body; 125 | if (badgeNumber != null) 126 | { 127 | notification.BadgeNumber = badgeNumber.Value; 128 | } 129 | 130 | PendingNotification notificationToDisplay = manager.ScheduleNotification(notification, deliveryTime); 131 | notificationToDisplay.Reschedule = reschedule; 132 | updatePendingNotifications = true; 133 | 134 | QueueEvent($"Queued event with ID \"{notification.Id}\" at time {deliveryTime:HH:mm}"); 135 | } 136 | 137 | /// 138 | /// Cancel a given pending notification 139 | /// 140 | public void CancelPendingNotificationItem(PendingNotification itemToCancel) 141 | { 142 | manager.CancelNotification(itemToCancel.Notification.Id.Value); 143 | 144 | updatePendingNotifications = true; 145 | 146 | QueueEvent($"Cancelled notification with ID \"{itemToCancel.Notification.Id}\""); 147 | } 148 | 149 | private void OnApplicationFocus(bool hasFocus) 150 | { 151 | if (hasFocus) 152 | { 153 | StartCoroutine(UpdatePendingNotificationsNextFrame()); 154 | } 155 | } 156 | 157 | private void SendNotificationFromUi() 158 | { 159 | int? badgeNumber = int.TryParse(badgeField.text, out int parsedBadgeNumber) 160 | ? parsedBadgeNumber 161 | : (int?)null; 162 | 163 | DateTime deliveryTime; 164 | if (float.TryParse(timeField.text, out float minutes)) 165 | { 166 | deliveryTime = DateTime.Now.ToLocalTime() + TimeSpan.FromMinutes(minutes); 167 | } 168 | else 169 | { 170 | deliveryTime = DateTime.Now.ToLocalTime() + TimeSpan.FromMinutes(1); 171 | } 172 | 173 | SendNotification(titleField.text, bodyField.text, deliveryTime, badgeNumber); 174 | } 175 | 176 | private void OnDelivered(PendingNotification deliveredNotification) 177 | { 178 | // Schedule this to run on the next frame (can't create UI elements from a Java callback) 179 | StartCoroutine(ShowDeliveryNotificationCoroutine(deliveredNotification.Notification)); 180 | } 181 | 182 | private void OnExpired(PendingNotification obj) 183 | { 184 | QueueEvent($"Notification with title \"{obj.Notification.Title}\" expired and was not displayed."); 185 | } 186 | 187 | private IEnumerator ShowDeliveryNotificationCoroutine(GameNotification deliveredNotification) 188 | { 189 | yield return null; 190 | 191 | QueueEvent($"Notification with ID \"{deliveredNotification.Id}\" shown in foreground."); 192 | 193 | updatePendingNotifications = true; 194 | } 195 | 196 | private IEnumerator UpdatePendingNotificationsNextFrame() 197 | { 198 | yield return null; 199 | updatePendingNotifications = true; 200 | } 201 | 202 | private void Update() 203 | { 204 | if (updatePendingNotifications) 205 | { 206 | UpdatePendingNotifications(); 207 | } 208 | } 209 | 210 | private void UpdatePendingNotifications() 211 | { 212 | Debug.Log("Updating pending list."); 213 | 214 | updatePendingNotifications = false; 215 | 216 | // Clear all existing ones 217 | foreach (object child in pendingNotificationsListParent.transform) 218 | { 219 | if (child is Transform childTransform) 220 | { 221 | Destroy(childTransform.gameObject); 222 | } 223 | } 224 | 225 | if (manager?.PendingNotifications == null) 226 | return; 227 | 228 | // Recreate based on currently pending list 229 | // Note: Using ToArray because the list can change during the loop. 230 | foreach (PendingNotification scheduledNotification in manager.PendingNotifications.ToArray()) 231 | { 232 | PendingNotificationItem newItem = 233 | Instantiate(pendingNotificationPrefab, pendingNotificationsListParent); 234 | newItem.Show(scheduledNotification, this); 235 | } 236 | } 237 | 238 | private void QueueEvent(string eventText) 239 | { 240 | Debug.Log($"Queueing event with text \"{eventText}\""); 241 | 242 | NotificationEventItem newItem = Instantiate(eventPrefab, pendingEventParent); 243 | newItem.Show(eventText); 244 | } 245 | 246 | private void ClearEvents() 247 | { 248 | foreach (object child in pendingEventParent.transform) 249 | { 250 | if (child is Transform childTransform) 251 | { 252 | Destroy(childTransform.gameObject); 253 | } 254 | } 255 | } 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /Assets/Demo/NotificationConsole.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb688dae2ce0d3645a718311956f62e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/NotificationEventItem.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | using UnityEngine; 3 | 4 | namespace NotificationSamples.Demo 5 | { 6 | public class NotificationEventItem : MonoBehaviour 7 | { 8 | [SerializeField] 9 | protected TextMeshProUGUI eventLabel; 10 | 11 | public void Show(string eventText) 12 | { 13 | eventLabel.text = eventText; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Demo/NotificationEventItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43834a2f62df4005b86a5fe960b327b1 3 | timeCreated: 1543844233 -------------------------------------------------------------------------------- /Assets/Demo/PendingNotificationItem.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | using UnityEngine; 3 | 4 | namespace NotificationSamples.Demo 5 | { 6 | public class PendingNotificationItem : MonoBehaviour 7 | { 8 | [SerializeField] 9 | protected TextMeshProUGUI idLabel; 10 | [SerializeField] 11 | protected TextMeshProUGUI titleLabel; 12 | [SerializeField] 13 | protected TextMeshProUGUI timeLabel; 14 | 15 | // Reference to pending notification 16 | private NotificationConsole console; 17 | private PendingNotification notification; 18 | 19 | /// 20 | /// Show for a given pending notification. 21 | /// 22 | public void Show(PendingNotification notificationToDisplay, NotificationConsole containingConsole) 23 | { 24 | notification = notificationToDisplay; 25 | console = containingConsole; 26 | 27 | if (idLabel != null && notificationToDisplay.Notification.Id.HasValue) 28 | { 29 | idLabel.text = notificationToDisplay.Notification.Id.Value.ToString(); 30 | } 31 | 32 | if (titleLabel != null) 33 | { 34 | titleLabel.text = notificationToDisplay.Notification.Title; 35 | } 36 | 37 | if (timeLabel != null) 38 | { 39 | timeLabel.text = notificationToDisplay.DeliveryTime.ToString("yy-MM-dd HH:mm:ss"); 40 | } 41 | } 42 | 43 | /// 44 | /// Cancel this item 45 | /// 46 | public void Cancel() 47 | { 48 | console.CancelPendingNotificationItem(notification); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Demo/PendingNotificationItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3095404a74e54df49d046449b75d7fbb 3 | timeCreated: 1543572791 -------------------------------------------------------------------------------- /Assets/Demo/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 952e3339ad2d36947a7c70be8e09c218 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/BuyItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 706796ab1fc684830a27b3a478e99837 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Console.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5e34600c3eff420bb8873c7e9fe74b7 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Event.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3237713686292655018 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3237713686292655009} 12 | - component: {fileID: 4418420421554972378} 13 | - component: {fileID: 7218816076232689686} 14 | m_Layer: 5 15 | m_Name: Event 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!224 &3237713686292655009 22 | RectTransform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 3237713686292655018} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: 32 | - {fileID: 3321232541767056136} 33 | - {fileID: 3237713686292655011} 34 | m_Father: {fileID: 0} 35 | m_RootOrder: 0 36 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 37 | m_AnchorMin: {x: 0, y: 0} 38 | m_AnchorMax: {x: 0, y: 0} 39 | m_AnchoredPosition: {x: 0, y: 0} 40 | m_SizeDelta: {x: 0, y: 0} 41 | m_Pivot: {x: 0.5, y: 0.5} 42 | --- !u!114 &4418420421554972378 43 | MonoBehaviour: 44 | m_ObjectHideFlags: 0 45 | m_CorrespondingSourceObject: {fileID: 0} 46 | m_PrefabInstance: {fileID: 0} 47 | m_PrefabAsset: {fileID: 0} 48 | m_GameObject: {fileID: 3237713686292655018} 49 | m_Enabled: 1 50 | m_EditorHideFlags: 0 51 | m_GeneratorAsset: {fileID: 0} 52 | m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3} 53 | m_Name: 54 | m_EditorClassIdentifier: 55 | m_Padding: 56 | m_Left: 0 57 | m_Right: 0 58 | m_Top: 0 59 | m_Bottom: 0 60 | m_ChildAlignment: 0 61 | m_Spacing: 0 62 | m_ChildForceExpandWidth: 0 63 | m_ChildForceExpandHeight: 0 64 | m_ChildControlWidth: 1 65 | m_ChildControlHeight: 1 66 | m_ChildScaleWidth: 0 67 | m_ChildScaleHeight: 0 68 | --- !u!114 &7218816076232689686 69 | MonoBehaviour: 70 | m_ObjectHideFlags: 0 71 | m_CorrespondingSourceObject: {fileID: 0} 72 | m_PrefabInstance: {fileID: 0} 73 | m_PrefabAsset: {fileID: 0} 74 | m_GameObject: {fileID: 3237713686292655018} 75 | m_Enabled: 1 76 | m_EditorHideFlags: 0 77 | m_GeneratorAsset: {fileID: 0} 78 | m_Script: {fileID: 11500000, guid: 43834a2f62df4005b86a5fe960b327b1, type: 3} 79 | m_Name: 80 | m_EditorClassIdentifier: 81 | eventLabel: {fileID: 3237713686292655002} 82 | --- !u!1 &3237713686292655028 83 | GameObject: 84 | m_ObjectHideFlags: 0 85 | m_CorrespondingSourceObject: {fileID: 0} 86 | m_PrefabInstance: {fileID: 0} 87 | m_PrefabAsset: {fileID: 0} 88 | serializedVersion: 6 89 | m_Component: 90 | - component: {fileID: 3237713686292655011} 91 | - component: {fileID: 3237713686292655022} 92 | - component: {fileID: 3237713686292655002} 93 | m_Layer: 5 94 | m_Name: EventText 95 | m_TagString: Untagged 96 | m_Icon: {fileID: 0} 97 | m_NavMeshLayer: 0 98 | m_StaticEditorFlags: 0 99 | m_IsActive: 1 100 | --- !u!224 &3237713686292655011 101 | RectTransform: 102 | m_ObjectHideFlags: 0 103 | m_CorrespondingSourceObject: {fileID: 0} 104 | m_PrefabInstance: {fileID: 0} 105 | m_PrefabAsset: {fileID: 0} 106 | m_GameObject: {fileID: 3237713686292655028} 107 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 108 | m_LocalPosition: {x: 0, y: 0, z: 0} 109 | m_LocalScale: {x: 1, y: 1, z: 1} 110 | m_Children: [] 111 | m_Father: {fileID: 3237713686292655009} 112 | m_RootOrder: 1 113 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 114 | m_AnchorMin: {x: 0, y: 0} 115 | m_AnchorMax: {x: 0, y: 0} 116 | m_AnchoredPosition: {x: 0, y: 0} 117 | m_SizeDelta: {x: 0, y: 0} 118 | m_Pivot: {x: 0, y: 1} 119 | --- !u!222 &3237713686292655022 120 | CanvasRenderer: 121 | m_ObjectHideFlags: 0 122 | m_CorrespondingSourceObject: {fileID: 0} 123 | m_PrefabInstance: {fileID: 0} 124 | m_PrefabAsset: {fileID: 0} 125 | m_GameObject: {fileID: 3237713686292655028} 126 | m_CullTransparentMesh: 0 127 | --- !u!114 &3237713686292655002 128 | MonoBehaviour: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | m_GameObject: {fileID: 3237713686292655028} 134 | m_Enabled: 1 135 | m_EditorHideFlags: 0 136 | m_GeneratorAsset: {fileID: 0} 137 | m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} 138 | m_Name: 139 | m_EditorClassIdentifier: 140 | m_Material: {fileID: 0} 141 | m_Color: {r: 1, g: 1, b: 1, a: 1} 142 | m_RaycastTarget: 0 143 | m_OnCullStateChanged: 144 | m_PersistentCalls: 145 | m_Calls: [] 146 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 147 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 148 | m_text: This is an event that happened 149 | m_isRightToLeft: 0 150 | m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 151 | m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 152 | m_fontSharedMaterials: [] 153 | m_fontMaterial: {fileID: 0} 154 | m_fontMaterials: [] 155 | m_fontColor32: 156 | serializedVersion: 2 157 | rgba: 4294967295 158 | m_fontColor: {r: 1, g: 1, b: 1, a: 1} 159 | m_enableVertexGradient: 0 160 | m_colorMode: 3 161 | m_fontColorGradient: 162 | topLeft: {r: 1, g: 1, b: 1, a: 1} 163 | topRight: {r: 1, g: 1, b: 1, a: 1} 164 | bottomLeft: {r: 1, g: 1, b: 1, a: 1} 165 | bottomRight: {r: 1, g: 1, b: 1, a: 1} 166 | m_fontColorGradientPreset: {fileID: 0} 167 | m_spriteAsset: {fileID: 0} 168 | m_tintAllSprites: 0 169 | m_overrideHtmlColors: 0 170 | m_faceColor: 171 | serializedVersion: 2 172 | rgba: 4294967295 173 | m_outlineColor: 174 | serializedVersion: 2 175 | rgba: 4278190080 176 | m_fontSize: 24 177 | m_fontSizeBase: 24 178 | m_fontWeight: 400 179 | m_enableAutoSizing: 0 180 | m_fontSizeMin: 18 181 | m_fontSizeMax: 72 182 | m_fontStyle: 0 183 | m_textAlignment: 513 184 | m_isAlignmentEnumConverted: 1 185 | m_characterSpacing: 0 186 | m_wordSpacing: 0 187 | m_lineSpacing: 0 188 | m_lineSpacingMax: 0 189 | m_paragraphSpacing: 0 190 | m_charWidthMaxAdj: 0 191 | m_enableWordWrapping: 1 192 | m_wordWrappingRatios: 0.4 193 | m_overflowMode: 2 194 | m_firstOverflowCharacterIndex: -1 195 | m_linkedTextComponent: {fileID: 0} 196 | m_isLinkedTextComponent: 0 197 | m_isTextTruncated: 0 198 | m_enableKerning: 1 199 | m_enableExtraPadding: 0 200 | checkPaddingRequired: 0 201 | m_isRichText: 0 202 | m_parseCtrlCharacters: 1 203 | m_isOrthographic: 1 204 | m_isCullingEnabled: 0 205 | m_ignoreRectMaskCulling: 0 206 | m_ignoreCulling: 1 207 | m_horizontalMapping: 0 208 | m_verticalMapping: 0 209 | m_uvLineOffset: 0 210 | m_geometrySortingOrder: 0 211 | m_firstVisibleCharacter: 0 212 | m_useMaxVisibleDescender: 1 213 | m_pageToDisplay: 1 214 | m_margin: {x: 0, y: 0, z: 5, w: 0} 215 | m_textInfo: 216 | textComponent: {fileID: 3237713686292655002} 217 | characterCount: 30 218 | spriteCount: 0 219 | spaceCount: 5 220 | wordCount: 6 221 | linkCount: 0 222 | lineCount: 1 223 | pageCount: 1 224 | materialCount: 1 225 | m_havePropertiesChanged: 0 226 | m_isUsingLegacyAnimationComponent: 0 227 | m_isVolumetricText: 0 228 | m_spriteAnimator: {fileID: 0} 229 | m_isInputParsingRequired: 0 230 | m_inputSource: 0 231 | m_hasFontAssetChanged: 0 232 | m_subTextObjects: 233 | - {fileID: 0} 234 | - {fileID: 0} 235 | - {fileID: 0} 236 | - {fileID: 0} 237 | - {fileID: 0} 238 | - {fileID: 0} 239 | - {fileID: 0} 240 | - {fileID: 0} 241 | m_baseMaterial: {fileID: 0} 242 | m_maskOffset: {x: 0, y: 0, z: 0, w: 0} 243 | --- !u!1 &3998372699083632462 244 | GameObject: 245 | m_ObjectHideFlags: 0 246 | m_CorrespondingSourceObject: {fileID: 0} 247 | m_PrefabInstance: {fileID: 0} 248 | m_PrefabAsset: {fileID: 0} 249 | serializedVersion: 6 250 | m_Component: 251 | - component: {fileID: 3321232541767056136} 252 | - component: {fileID: 3731943764758371260} 253 | m_Layer: 5 254 | m_Name: Spacer 255 | m_TagString: Untagged 256 | m_Icon: {fileID: 0} 257 | m_NavMeshLayer: 0 258 | m_StaticEditorFlags: 0 259 | m_IsActive: 1 260 | --- !u!224 &3321232541767056136 261 | RectTransform: 262 | m_ObjectHideFlags: 0 263 | m_CorrespondingSourceObject: {fileID: 0} 264 | m_PrefabInstance: {fileID: 0} 265 | m_PrefabAsset: {fileID: 0} 266 | m_GameObject: {fileID: 3998372699083632462} 267 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 268 | m_LocalPosition: {x: 0, y: 0, z: 0} 269 | m_LocalScale: {x: 1, y: 1, z: 1} 270 | m_Children: [] 271 | m_Father: {fileID: 3237713686292655009} 272 | m_RootOrder: 0 273 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 274 | m_AnchorMin: {x: 0, y: 0} 275 | m_AnchorMax: {x: 0, y: 0} 276 | m_AnchoredPosition: {x: 0, y: 0} 277 | m_SizeDelta: {x: 0, y: 0} 278 | m_Pivot: {x: 0.5, y: 0.5} 279 | --- !u!114 &3731943764758371260 280 | MonoBehaviour: 281 | m_ObjectHideFlags: 0 282 | m_CorrespondingSourceObject: {fileID: 0} 283 | m_PrefabInstance: {fileID: 0} 284 | m_PrefabAsset: {fileID: 0} 285 | m_GameObject: {fileID: 3998372699083632462} 286 | m_Enabled: 1 287 | m_EditorHideFlags: 0 288 | m_GeneratorAsset: {fileID: 0} 289 | m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} 290 | m_Name: 291 | m_EditorClassIdentifier: 292 | m_IgnoreLayout: 0 293 | m_MinWidth: 25 294 | m_MinHeight: -1 295 | m_PreferredWidth: -1 296 | m_PreferredHeight: -1 297 | m_FlexibleWidth: -1 298 | m_FlexibleHeight: -1 299 | m_LayoutPriority: 1 300 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Event.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b25ac4bca39461b4892f29dc257c7615 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/GameController.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &2976877414878312108 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 2976877414878312110} 12 | - component: {fileID: 2976877414878312109} 13 | m_Layer: 0 14 | m_Name: GameController 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &2976877414878312110 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 2976877414878312108} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!114 &2976877414878312109 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | m_GameObject: {fileID: 2976877414878312108} 41 | m_Enabled: 1 42 | m_EditorHideFlags: 0 43 | m_Script: {fileID: 11500000, guid: 1d87151d06c55490fadb463b5de02a0e, type: 3} 44 | m_Name: 45 | m_EditorClassIdentifier: 46 | console: {fileID: 0} 47 | newsFeedReader: {fileID: 0} 48 | buyItemPrefab: {fileID: 6036781859934769854, guid: 706796ab1fc684830a27b3a478e99837, 49 | type: 3} 50 | buyContentHolder: {fileID: 0} 51 | itemPrefab: {fileID: 1354358557702816005, guid: 99d2b3a89766047f089a620f114cbdf4, 52 | type: 3} 53 | contentHolder: {fileID: 0} 54 | currencyLabel: {fileID: 0} 55 | bonusLabel: {fileID: 0} 56 | timeLabel: {fileID: 0} 57 | newsFeedLoadingIcon: {fileID: 0} 58 | newsFeedLoadingIconTurnSpeed: 200 59 | newsFeedButton: {fileID: 0} 60 | initialCurrency: 100 61 | newsFeedUrl: https://unity3d.com/news.rss 62 | itemsData: 63 | - {fileID: 11400000, guid: 5d34eef51027b48e690a3c49134673c9, type: 2} 64 | - {fileID: 11400000, guid: c74432055a60b4c188d28378e3b20d63, type: 2} 65 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/GameController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2b9a37994bfa4dc7999774d3a3346a6 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/GameUI.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4695b76ad26d4e42820676a2317449a 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/InventoryItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99d2b3a89766047f089a620f114cbdf4 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Notification.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cbf120411ca1bd49815fd77692db4c3 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6967654454ddf4055a983a491c2f1fbb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/cookie.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:93cc652a3dd2845d771bf321865b4ac0448c44a98da70ee8f5c8c105d4ae1cfc 3 | size 3450 4 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/cookie.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb24c38f144234b3ebbb8091d47d8f05 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 1 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 2048 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: iPhone 85 | maxTextureSize: 2048 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: Android 96 | maxTextureSize: 2048 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 19bae52a5e09d4c99ac1f3725e3068cb 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/cupcake.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6c3efb6f534b57b39615bdd1c1ff4b071329b31e76e4daaeacc776a2683833f1 3 | size 1209 4 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/cupcake.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77e9fb8ea74be4f1a94808ee169f2209 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 1 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 2048 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: iPhone 85 | maxTextureSize: 2048 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: Android 96 | maxTextureSize: 2048 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: b8d5fc775df05495d93cca3174545d7f 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/heart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:af060761821f0b390d2f21c5b2b16c33c758190f235f9ff0650425ccbe086ebc 3 | size 1241 4 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/heart.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5473091eb32ba45a5ba74850eb38f83b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 4829395291d074d01b7e654d000f9fa2 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/newsloadingicon.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c118de5a41d3fca60b03eeb19de73d7f6b25bee0a815a9b2785aa29c6106ee45 3 | size 2766 4 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/newsloadingicon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44ffc570c9d4749cba43d15f54af988d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: ff8460c17e0194f97a96258b4f67e79e 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/progressbar.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:25fc40f913b06947bd72e9bbde3b5a2a340ff5e139cf8c59dd6b9c67168f9f83 3 | size 7636 4 | -------------------------------------------------------------------------------- /Assets/Demo/Sprites/progressbar.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75adf097362264ac9b3d3179ee035f0a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: b0dec43a812ef405eafa9664878f6ece 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c42e653a917a5a84997dc7b10c4850a5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/com.unity.mobile.notifications.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad8f4f24b73f06f48a5a1cee6ccd3734 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor/com.unity.mobile.notifications/NotificationSettings.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: 0863bf92b4fcc45b0b9267325249bf0f, type: 3} 13 | m_Name: NotificationSettings 14 | m_EditorClassIdentifier: 15 | toolbarInt: 0 16 | iOSNotificationEditorSettingsValues: 17 | keys: 18 | - UnityNotificationRequestAuthorizationOnAppLaunch 19 | - UnityNotificationDefaultAuthorizationOptions 20 | - UnityUseLocationNotificationTrigger 21 | - UnityAPSReleaseEnvironment 22 | - UnityNotificationRequestAuthorizationForRemoteNotificationsOnAppLaunch 23 | - UnityRemoteNotificationForegroundPresentationOptions 24 | - UnityAddRemoteNotificationCapability 25 | - UnityUseAPSReleaseEnvironment 26 | values: 27 | - True 28 | - -1 29 | - False 30 | - False 31 | - False 32 | - -1 33 | - False 34 | - False 35 | AndroidNotificationEditorSettingsValues: 36 | keys: 37 | - UnityNotificationAndroidRescheduleOnDeviceRestart 38 | - UnityNotificationAndroidUseCustomActivity 39 | - UnityNotificationAndroidCustomActivityString 40 | values: 41 | - False 42 | - False 43 | - com.unity3d.player.UnityPlayerActivity 44 | TrackedResourceAssets: 45 | - Id: icon_0 46 | Type: 0 47 | Asset: {fileID: 2800000, guid: 5473091eb32ba45a5ba74850eb38f83b, type: 3} 48 | -------------------------------------------------------------------------------- /Assets/Editor/com.unity.mobile.notifications/NotificationSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8dd18fd65a0e7c469853e4ffd13013a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5f2241b5c2fb504a8d134f06d6779fb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/DefaultSerializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using UnityEngine; 5 | 6 | namespace NotificationSamples 7 | { 8 | /// 9 | /// Standard serializer used by the if no others 10 | /// are provided. Saves a simple binary format. 11 | /// 12 | public class DefaultSerializer : IPendingNotificationsSerializer 13 | { 14 | private const byte Version = 1; 15 | 16 | private readonly string filename; 17 | 18 | /// 19 | /// Instantiate a new instance of . 20 | /// 21 | /// The filename to save to. This should be an absolute path. 22 | public DefaultSerializer(string filename) 23 | { 24 | this.filename = filename; 25 | } 26 | 27 | /// 28 | public void Serialize(IList notifications) 29 | { 30 | try 31 | { 32 | using (var file = new FileStream(filename, FileMode.Create)) 33 | { 34 | using (var writer = new BinaryWriter(file)) 35 | { 36 | // Write version number 37 | writer.Write(Version); 38 | 39 | // Write list length 40 | writer.Write(notifications.Count); 41 | 42 | // Write each item 43 | foreach (PendingNotification notificationToSave in notifications) 44 | { 45 | GameNotification notification = notificationToSave.Notification; 46 | 47 | // ID 48 | writer.Write(notification.Id.HasValue); 49 | if (notification.Id.HasValue) 50 | { 51 | writer.Write(notification.Id.Value); 52 | } 53 | 54 | // Title 55 | writer.Write(notification.Title ?? ""); 56 | 57 | // Body 58 | writer.Write(notification.Body ?? ""); 59 | 60 | // Subtitle 61 | //writer.Write(notification.Subtitle ?? ""); 62 | 63 | // Data 64 | writer.Write(notification.Data ?? ""); 65 | 66 | // Badge 67 | writer.Write(notification.BadgeNumber); 68 | 69 | // Time (must have a value) 70 | writer.Write(notificationToSave.DeliveryTime.Ticks); 71 | } 72 | 73 | writer.Flush(); 74 | } 75 | } 76 | } 77 | catch (IOException e) 78 | { 79 | Debug.LogException(e); 80 | } 81 | } 82 | 83 | /// 84 | public IList Deserialize(GameNotificationsPlatform platform) 85 | { 86 | if (!File.Exists(filename)) 87 | { 88 | return null; 89 | } 90 | 91 | try 92 | { 93 | using (var file = new FileStream(filename, FileMode.Open)) 94 | { 95 | using (var reader = new BinaryReader(file)) 96 | { 97 | // Version 98 | var version = reader.ReadByte(); 99 | 100 | // Length 101 | int numElements = reader.ReadInt32(); 102 | 103 | var result = new List(numElements); 104 | for (var i = 0; i < numElements; ++i) 105 | { 106 | GameNotification notification = platform.CreateNotification(); 107 | bool hasValue; 108 | 109 | // ID 110 | hasValue = reader.ReadBoolean(); 111 | if (hasValue) 112 | { 113 | notification.Id = reader.ReadInt32(); 114 | } 115 | 116 | // Title 117 | notification.Title = reader.ReadString(); 118 | 119 | // Body 120 | notification.Body = reader.ReadString(); 121 | 122 | // Data, introduced in version 1 123 | if (version > 0) 124 | notification.Data = reader.ReadString(); 125 | 126 | // Badge 127 | notification.BadgeNumber = reader.ReadInt32(); 128 | 129 | // Time 130 | var deliveryTime = new DateTime(reader.ReadInt64(), DateTimeKind.Local); 131 | 132 | result.Add(new PendingNotification(notification, deliveryTime)); 133 | } 134 | 135 | return result; 136 | } 137 | } 138 | } 139 | catch (IOException e) 140 | { 141 | Debug.LogException(e); 142 | return null; 143 | } 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Scripts/DefaultSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5da1b0c1787a4aac85b116922a223a0e 3 | timeCreated: 1544529129 -------------------------------------------------------------------------------- /Assets/Scripts/GameNotification.cs: -------------------------------------------------------------------------------- 1 | using Unity.Notifications; 2 | 3 | namespace NotificationSamples 4 | { 5 | /// 6 | /// Represents a notification that will be delivered for this application. 7 | /// 8 | public class GameNotification 9 | { 10 | private Notification internalNotification; 11 | 12 | /// 13 | /// Gets the internal notification object used by the mobile notifications system. 14 | /// 15 | public Notification InternalNotification => internalNotification; 16 | 17 | /// 18 | /// Gets or sets a unique identifier for this notification. 19 | /// 20 | /// 21 | /// 22 | /// If null, will be generated automatically once the notification is delivered, and then 23 | /// can be retrieved afterwards. 24 | /// 25 | /// On some platforms, this might be converted to a string identifier internally. 26 | /// 27 | /// A unique integer identifier for this notification, or null (on some platforms) if not explicitly set. 28 | public int? Id { get => internalNotification.Identifier; set => internalNotification.Identifier = value; } 29 | 30 | /// 31 | /// Gets or sets the notification's title. 32 | /// 33 | /// The title message for the notification. 34 | public string Title { get => internalNotification.Title; set => internalNotification.Title = value; } 35 | 36 | /// 37 | /// Gets or sets the body text of the notification. 38 | /// 39 | /// The body message for the notification. 40 | public string Body { get => internalNotification.Text; set => internalNotification.Text = value; } 41 | 42 | /// 43 | /// Gets or sets optional arbitrary data for the notification. 44 | /// 45 | public string Data { get => internalNotification.Data; set => internalNotification.Data = value; } 46 | 47 | /// 48 | /// Gets or sets the badge number for this notification. No badge number will be shown if null. 49 | /// 50 | /// The number displayed on the app badge. 51 | public int BadgeNumber 52 | { 53 | get => internalNotification.Badge; 54 | set => internalNotification.Badge = value; 55 | } 56 | 57 | /// 58 | /// Instantiate a new instance of . 59 | /// 60 | public GameNotification() 61 | { 62 | internalNotification = new Notification 63 | { 64 | ShowInForeground = true // Deliver in foreground by default 65 | }; 66 | } 67 | 68 | /// 69 | /// Instantiate a new instance of from a delivered notification. 70 | /// 71 | /// The delivered notification. 72 | internal GameNotification(Notification notification) 73 | { 74 | this.internalNotification = notification; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Scripts/GameNotification.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 935775546f65144988a4d025f77ae4d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/GameNotificationsManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cee98b792935d2499e84d5f659c1895 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/GameNotificationsPlatform.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using Unity.Notifications; 4 | 5 | namespace NotificationSamples 6 | { 7 | /// 8 | /// A type that handles notifications for a specific game platform 9 | /// 10 | public class GameNotificationsPlatform : IDisposable 11 | { 12 | /// 13 | /// Fired when a notification is received. 14 | /// 15 | public event Action NotificationReceived; 16 | 17 | /// 18 | /// Create the platform with provied notification settings. 19 | /// 20 | public GameNotificationsPlatform(NotificationCenterArgs args) 21 | { 22 | NotificationCenter.Initialize(args); 23 | NotificationCenter.OnNotificationReceived += OnLocalNotificationReceived; 24 | } 25 | 26 | /// 27 | /// Request permission to send notifications. 28 | /// 29 | public IEnumerator RequestNotificationPermission() 30 | { 31 | return NotificationCenter.RequestPermission(); 32 | } 33 | 34 | /// 35 | /// Create a new instance of a for this platform. 36 | /// 37 | /// A new platform-appropriate notification object. 38 | public GameNotification CreateNotification() 39 | { 40 | return new GameNotification(); 41 | } 42 | 43 | /// 44 | /// Schedules a notification to be delivered. 45 | /// 46 | /// The notification to deliver. 47 | /// is null. 48 | /// isn't of the correct type. 49 | public void ScheduleNotification(GameNotification gameNotification, DateTime deliveryTime) 50 | { 51 | if (gameNotification == null) 52 | { 53 | throw new ArgumentNullException(nameof(gameNotification)); 54 | } 55 | 56 | int notificationId = NotificationCenter.ScheduleNotification(gameNotification.InternalNotification, new NotificationDateTimeSchedule(deliveryTime)); 57 | gameNotification.Id = notificationId; 58 | } 59 | 60 | /// 61 | /// Cancels a scheduled notification. 62 | /// 63 | /// The ID of a previously scheduled notification. 64 | public void CancelNotification(int notificationId) 65 | { 66 | NotificationCenter.CancelScheduledNotification(notificationId); 67 | } 68 | 69 | /// 70 | /// Dismiss a displayed notification. 71 | /// 72 | /// The ID of a previously scheduled notification that is being displayed to the user. 73 | public void DismissNotification(int notificationId) 74 | { 75 | NotificationCenter.CancelDeliveredNotification(notificationId); 76 | } 77 | 78 | /// 79 | /// Cancels all scheduled notifications. 80 | /// 81 | public void CancelAllScheduledNotifications() 82 | { 83 | NotificationCenter.CancelAllScheduledNotifications(); 84 | } 85 | 86 | /// 87 | /// Dismisses all displayed notifications. 88 | /// 89 | public void DismissAllDisplayedNotifications() 90 | { 91 | NotificationCenter.CancelAllDeliveredNotifications(); 92 | } 93 | 94 | /// 95 | /// Use this to retrieve the last local or remote notification received by the app. 96 | /// 97 | /// 98 | /// On Android the last notification is not cleared until the application is explicitly quit. 99 | /// 100 | /// 101 | /// Returns the last local or remote notification used to open the app or clicked on by the user. If no 102 | /// notification is available it returns null. 103 | /// 104 | public GameNotification GetLastNotification() 105 | { 106 | var notification = NotificationCenter.LastRespondedNotification; 107 | 108 | if (notification.HasValue) 109 | { 110 | return new GameNotification(notification.Value); 111 | } 112 | 113 | return null; 114 | } 115 | 116 | /// 117 | /// Performs any initialization or processing necessary on foregrounding the application. 118 | /// 119 | public void OnForeground() 120 | { 121 | NotificationCenter.ClearBadge(); 122 | } 123 | 124 | /// 125 | /// Performs any processing necessary on backgrounding or closing the application. 126 | /// 127 | public void OnBackground() {} 128 | 129 | /// 130 | /// Unregister delegates. 131 | /// 132 | public void Dispose() 133 | { 134 | NotificationCenter.OnNotificationReceived -= OnLocalNotificationReceived; 135 | } 136 | 137 | // Event handler for receiving local notifications. 138 | private void OnLocalNotificationReceived(Notification notification) 139 | { 140 | // Create a new AndroidGameNotification out of the delivered notification, but only 141 | // if the event is registered 142 | NotificationReceived?.Invoke(new GameNotification(notification)); 143 | } 144 | } 145 | 146 | } -------------------------------------------------------------------------------- /Assets/Scripts/GameNotificationsPlatform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 439ca0472765f4919858f720e95b444b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/IPendingNotificationsSerializer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace NotificationSamples 4 | { 5 | /// 6 | /// Responsible for the serialization and deserialization of pending notifications for a 7 | /// that is in mode. 9 | /// 10 | public interface IPendingNotificationsSerializer 11 | { 12 | /// 13 | /// Save a list of pending notifications. 14 | /// 15 | /// The collection notifications to save. 16 | void Serialize(IList notifications); 17 | 18 | /// 19 | /// Retrieve a saved list of pending notifications. 20 | /// 21 | /// The deserialized collection of pending notifications, or null if the file did not exist. 22 | IList Deserialize(GameNotificationsPlatform platform); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Scripts/IPendingNotificationsSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6583e0c6af5841769cfd7bcca972c67f 3 | timeCreated: 1544447619 -------------------------------------------------------------------------------- /Assets/Scripts/PendingNotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NotificationSamples 4 | { 5 | /// 6 | /// Represents a notification that was scheduled with . 7 | /// 8 | public class PendingNotification 9 | { 10 | /// 11 | /// Whether to reschedule this event if it hasn't displayed once the app is foregrounded again. 12 | /// 13 | /// 14 | /// 15 | /// Only valid if the 's 16 | /// flag is set to . 17 | /// 18 | /// 19 | /// Will not function for any notifications that are using a delivery scheduling method that isn't time 20 | /// based, such as iOS location notifications. 21 | /// 22 | /// 23 | public bool Reschedule; 24 | 25 | /// 26 | /// Whether notification is scheduled. 27 | /// 28 | public bool Scheduled { get; private set; } 29 | 30 | /// 31 | /// The scheduled notification. 32 | /// 33 | public readonly GameNotification Notification; 34 | 35 | public readonly DateTime DeliveryTime; 36 | 37 | /// 38 | /// Instantiate a new instance of from a . 39 | /// 40 | /// The notification to create from. 41 | public PendingNotification(GameNotification notification, DateTime deliveryTime, bool scheduled = false) 42 | { 43 | Notification = notification ?? throw new ArgumentNullException(nameof(notification)); 44 | DeliveryTime = deliveryTime; 45 | Scheduled = scheduled; 46 | } 47 | 48 | public void Schedule() 49 | { 50 | Scheduled = true; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Scripts/PendingNotification.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0d0e78678f24701974f87c106ac326c 3 | timeCreated: 1543567941 -------------------------------------------------------------------------------- /Assets/TextMesh Pro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f54d1bd14bd3ca042bd867b519fee8cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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/Documentation/TextMesh Pro User Guide 2016.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:93d6d3ca8a7d8423b01faacd00fa3921fe055fb2187873653a925e4cc1af85c0 3 | size 694398 4 | -------------------------------------------------------------------------------- /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.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/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 - 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_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: LiberationSans SDF - Drop Shadow 11 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 12 | m_ShaderKeywords: OUTLINE_ON UNDERLAY_ON 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Cube: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _FaceTex: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _MainTex: 35 | m_Texture: {fileID: -2317274456271958596, guid: 8f586378b4e144a9851e7b34d9b748ee, 36 | type: 2} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _OutlineTex: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | m_Floats: 44 | - _Ambient: 0.5 45 | - _Bevel: 0.5 46 | - _BevelClamp: 0 47 | - _BevelOffset: 0 48 | - _BevelRoundness: 0 49 | - _BevelWidth: 0 50 | - _BumpFace: 0 51 | - _BumpOutline: 0 52 | - _ColorMask: 15 53 | - _Diffuse: 0.5 54 | - _DiffusePower: 1 55 | - _FaceDilate: 0.1 56 | - _FaceUVSpeedX: 0 57 | - _FaceUVSpeedY: 0 58 | - _GlowInner: 0.05 59 | - _GlowOffset: 0 60 | - _GlowOuter: 0.05 61 | - _GlowPower: 0.75 62 | - _GradientScale: 10 63 | - _LightAngle: 3.1416 64 | - _MaskSoftnessX: 0 65 | - _MaskSoftnessY: 0 66 | - _OutlineSoftness: 0 67 | - _OutlineUVSpeedX: 0 68 | - _OutlineUVSpeedY: 0 69 | - _OutlineWidth: 0.1 70 | - _PerspectiveFilter: 0.875 71 | - _Reflectivity: 10 72 | - _ScaleRatioA: 0.9 73 | - _ScaleRatioB: 0.73125 74 | - _ScaleRatioC: 0.64125 75 | - _ScaleX: 1 76 | - _ScaleY: 1 77 | - _ShaderFlags: 0 78 | - _SpecularPower: 2 79 | - _Stencil: 0 80 | - _StencilComp: 8 81 | - _StencilOp: 0 82 | - _StencilReadMask: 255 83 | - _StencilWriteMask: 255 84 | - _TextureHeight: 1024 85 | - _TextureWidth: 1024 86 | - _UnderlayDilate: 0 87 | - _UnderlayOffsetX: 0.5 88 | - _UnderlayOffsetY: -0.5 89 | - _UnderlaySoftness: 0.05 90 | - _VertexOffsetX: 0 91 | - _VertexOffsetY: 0 92 | - _WeightBold: 0.75 93 | - _WeightNormal: 0 94 | m_Colors: 95 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 96 | - _Color: {r: 1, g: 1, b: 1, a: 1} 97 | - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} 98 | - _FaceColor: {r: 1, g: 1, b: 1, a: 1} 99 | - _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} 100 | - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} 101 | - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} 102 | - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} 103 | - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} 104 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 105 | - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} 106 | -------------------------------------------------------------------------------- /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/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_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: LiberationSans SDF - Outline 11 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 12 | m_ShaderKeywords: OUTLINE_ON 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Cube: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _FaceTex: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _MainTex: 35 | m_Texture: {fileID: -2317274456271958596, guid: 8f586378b4e144a9851e7b34d9b748ee, 36 | type: 2} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _OutlineTex: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | m_Floats: 44 | - _Ambient: 0.5 45 | - _Bevel: 0.5 46 | - _BevelClamp: 0 47 | - _BevelOffset: 0 48 | - _BevelRoundness: 0 49 | - _BevelWidth: 0 50 | - _BumpFace: 0 51 | - _BumpOutline: 0 52 | - _ColorMask: 15 53 | - _Diffuse: 0.5 54 | - _FaceDilate: 0.1 55 | - _FaceUVSpeedX: 0 56 | - _FaceUVSpeedY: 0 57 | - _GlowInner: 0.05 58 | - _GlowOffset: 0 59 | - _GlowOuter: 0.05 60 | - _GlowPower: 0.75 61 | - _GradientScale: 10 62 | - _LightAngle: 3.1416 63 | - _MaskSoftnessX: 0 64 | - _MaskSoftnessY: 0 65 | - _OutlineSoftness: 0 66 | - _OutlineUVSpeedX: 0 67 | - _OutlineUVSpeedY: 0 68 | - _OutlineWidth: 0.1 69 | - _PerspectiveFilter: 0.875 70 | - _Reflectivity: 10 71 | - _ScaleRatioA: 0.9 72 | - _ScaleRatioB: 0.73125 73 | - _ScaleRatioC: 0.64125 74 | - _ScaleX: 1 75 | - _ScaleY: 1 76 | - _ShaderFlags: 0 77 | - _SpecularPower: 2 78 | - _Stencil: 0 79 | - _StencilComp: 8 80 | - _StencilOp: 0 81 | - _StencilReadMask: 255 82 | - _StencilWriteMask: 255 83 | - _TextureHeight: 1024 84 | - _TextureWidth: 1024 85 | - _UnderlayDilate: 0 86 | - _UnderlayOffsetX: 0 87 | - _UnderlayOffsetY: 0 88 | - _UnderlaySoftness: 0 89 | - _VertexOffsetX: 0 90 | - _VertexOffsetY: 0 91 | - _WeightBold: 0.75 92 | - _WeightNormal: 0 93 | m_Colors: 94 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 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/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.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/LineBreaking Following Characters.txt: -------------------------------------------------------------------------------- 1 | )]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,. -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- 1 | ([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇〉》」$⦆¥₩ # -------------------------------------------------------------------------------- /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/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-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_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/TMP_Bitmap-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e3b057af24249748ff873be7fafee47 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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.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 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 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/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/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 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-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/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-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_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/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 | -------------------------------------------------------------------------------- /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/TMP_SDF.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68e6db2ebdc24f95958faec2be5558d6 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/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: -------------------------------------------------------------------------------- 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/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/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/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/TextMesh Pro/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0603b6d5186471b96c778c3949c7ce2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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/Sprites/EmojiOne Attribution.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 381dcb09d5029d14897e55f98031fca5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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/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/TextMesh Pro/Sprites/EmojiOne.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8d1830e21c290b1a2ce398fc98bad6b0ebb5feaa259b8969ea03066ab2f7aced 3 | size 73304 4 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Unity Technologies ApS 2 | 3 | Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). 4 | 5 | Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. 6 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.mobile.notifications": "2.3.0", 4 | "com.unity.textmeshpro": "3.0.6", 5 | "com.unity.modules.ai": "1.0.0", 6 | "com.unity.modules.animation": "1.0.0", 7 | "com.unity.modules.assetbundle": "1.0.0", 8 | "com.unity.modules.audio": "1.0.0", 9 | "com.unity.modules.cloth": "1.0.0", 10 | "com.unity.modules.director": "1.0.0", 11 | "com.unity.modules.imageconversion": "1.0.0", 12 | "com.unity.modules.imgui": "1.0.0", 13 | "com.unity.modules.jsonserialize": "1.0.0", 14 | "com.unity.modules.particlesystem": "1.0.0", 15 | "com.unity.modules.physics": "1.0.0", 16 | "com.unity.modules.physics2d": "1.0.0", 17 | "com.unity.modules.screencapture": "1.0.0", 18 | "com.unity.modules.terrain": "1.0.0", 19 | "com.unity.modules.terrainphysics": "1.0.0", 20 | "com.unity.modules.tilemap": "1.0.0", 21 | "com.unity.modules.ui": "1.0.0", 22 | "com.unity.modules.uielements": "1.0.0", 23 | "com.unity.modules.umbra": "1.0.0", 24 | "com.unity.modules.unityanalytics": "1.0.0", 25 | "com.unity.modules.unitywebrequest": "1.0.0", 26 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 27 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 28 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 29 | "com.unity.modules.unitywebrequestwww": "1.0.0", 30 | "com.unity.modules.vehicles": "1.0.0", 31 | "com.unity.modules.video": "1.0.0", 32 | "com.unity.modules.vr": "1.0.0", 33 | "com.unity.modules.wind": "1.0.0", 34 | "com.unity.modules.xr": "1.0.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 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_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Demo/Demo.unity 10 | guid: d4a8dc573bd002341a4c8035354f4aaa 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef 20 | m_ProjectGenerationRootNamespace: NotificationSamples 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_AutoSyncTransforms: 1 46 | m_AlwaysShowColliders: 0 47 | m_ShowColliderSleep: 1 48 | m_ShowColliderContacts: 0 49 | m_ShowColliderAABB: 0 50 | m_ContactArrowScale: 0.2 51 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 52 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 53 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 54 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 55 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 56 | -------------------------------------------------------------------------------- /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 | - type: 8 | m_NativeTypeID: 20 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: bfcfc320427f8224bbb7a96f3d3aebad, 13 | type: 2} 14 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.30f1 2 | m_EditorVersionWithRevision: 2021.3.30f1 (b4360d7cdac4) 3 | -------------------------------------------------------------------------------- /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: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 4 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | skinWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 4 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 0 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | skinWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 0 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 4 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 0 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | skinWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 0 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 0 133 | billboardsFaceCameraPosition: 0 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 4 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 0 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | skinWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 0 164 | antiAliasing: 0 165 | softParticles: 0 166 | softVegetation: 1 167 | realtimeReflectionProbes: 0 168 | billboardsFaceCameraPosition: 0 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 4 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 0 188 | shadowResolution: 0 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | skinWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 0 199 | antiAliasing: 0 200 | softParticles: 0 201 | softVegetation: 1 202 | realtimeReflectionProbes: 0 203 | billboardsFaceCameraPosition: 0 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 4 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: {} 220 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 1 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 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/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mobile Notifications Samples & Wrapper 2 | This Unity project demonstrates how to use the [Unity Mobile Notifications API](https://docs.unity3d.com/Packages/com.unity.mobile.notifications@1.0/manual/index.html) in real-world use cases. 3 | 4 | 5 | 6 | ## Overview: the Game Notifications Manager 7 | 8 | The primary component of the wrapper is the Game Notifications Manager. It is the interface through which you can schedule cross-platform local notifications. 9 | 10 | 11 | ### Usage 12 | 13 | 14 | 15 | 1. Add the Game Notifications Manager to a Game Object (Note that the Manager's lifetime is currently limited to one scene. Up to you to add a DontDestroyOnLoad) 16 | 2. Reference it from a game script that will send notifications. 17 | 3. Initialize the Manager. Provide at least one channel if targeting Android. This should only be done once per application session. 18 | 19 | 20 | ``` 21 | var channel = new GameNotificationChannel(ChannelId, "Default Game Channel", "Generic notifications"); 22 | manager.Initialize(channel); 23 | 24 | ``` 25 | 26 | 4. Create a new notification: 27 | 28 | ``` 29 | var notification = manager.CreateNotification(); 30 | 31 | ``` 32 | (Note that the wrapper might return a null object on some platforms. Check for null before continuing.) 33 | 34 | 5. Fill in the important fields 35 | 36 | 37 | ``` 38 | notification.Title = title; 39 | notification.Body = body; 40 | notification.DeliveryTime = deliveryTime; 41 | 42 | ``` 43 | 44 | 45 | 46 | 6. Schedule the notification. 47 | 48 | 49 | ``` 50 | manager.ScheduleNotification(notification); 51 | ``` 52 | 53 | 54 | The Manager saves a small file to disk whenever backgrounding so that it can keep track of notifications that were published and scheduled in previous sessions. 55 | 56 | 57 | ### Operation Modes 58 | 59 | The manager features several operation modes that control its behaviour. The default operation mode has queueing, foreground clearing and automatic rescheduling all on. 60 | 61 | 62 | 63 | * **No queueing** 64 | 65 | The wrapper immediately schedules messages with the underlying operating system. 66 | 67 | * **Queuing** 68 | 69 | The wrapper only schedules messages with the OS when backgrounding. The system will also (optionally, but on by default) have the ability to calculate badge numbers automatically in this mode. If you don't provide any badge numbers manually with your notifications, the wrapper will set the badge numbers so that they increment based on the scheduled time of each notification. 70 | 71 | * **Foreground clearing** 72 | 73 | The wrapper will remove all scheduled messages when the app comes into the foreground. 74 | 75 | * **Automatic rescheduling** 76 | 77 | If this is set, after clearing all messages when foregrounding, the wrapper will go through all notifications marked this way, and put them back in the queue for delivery. 78 | 79 | 80 | To configure a notification for rescheduling: 81 | 82 | 83 | 84 | ``` 85 | var notificationToDisplay = manager.ScheduleNotification(notification); 86 | notificationToDisplay.Reschedule = true; 87 | ``` 88 | 89 | 90 | 91 | ## Demo Notes 92 | 93 | 94 | 95 | * Operates using all operation modes on by default. 96 | * Features a very simple clicker game. It will schedule local notifications whenever a cookie or cupcake is completed. 97 | * The News Feed button will retrieve the latest item from the Unity news RSS and schedule it as a notification 5 minutes in the future (configurable in GameController) 98 | * More Options contains a 'play reminder' button which will schedule an absence notification message for a fixed time of day the following day. (6am by default, configurable in GameController) 99 | 100 | 101 | ## Credits 102 | This Sample was developed in conjunction with 24 Bit Games. www.24bit.games 103 | --------------------------------------------------------------------------------