├── .github └── FUNDING.yml ├── Assets ├── Demo Scene.meta ├── Demo Scene │ ├── Demo.cs │ ├── Demo.cs.meta │ ├── scene.unity │ └── scene.unity.meta ├── Popup UI.meta └── Popup UI │ ├── Resources.meta │ ├── Resources │ ├── PopupUI.prefab │ └── PopupUI.prefab.meta │ ├── Scripts.meta │ ├── Scripts │ ├── Popup.cs │ ├── Popup.cs.meta │ ├── PopupUI.cs │ └── PopupUI.cs.meta │ ├── Sprites.meta │ └── Sprites │ ├── square_r.png │ ├── square_r.png.meta │ ├── square_r_2.png │ └── square_r_2.png.meta ├── EasyUI_Popup_v1.1.unitypackage ├── LICENCE └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://paypal.me/hamzaherbou'] 2 | -------------------------------------------------------------------------------- /Assets/Demo Scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7311d60bc2aee7e4fb06fb491a42f7b5 3 | folderAsset: yes 4 | timeCreated: 1623253950 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo Scene/Demo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine ; 2 | using EasyUI.Popup ; 3 | 4 | public class Demo : MonoBehaviour { 5 | [TextArea (5, 20)]public string longText ; 6 | 7 | //Buttons 8 | public void Button1 () { 9 | Popup.Show ("Hello GameDevs :)") ; 10 | } 11 | 12 | public void Button2 () { 13 | Popup.Show ("Title", longText) ; 14 | } 15 | 16 | public void Button3 () { 17 | Popup.Show ("Error", "Invalid email or password!", "OK", PopupColor.Red) ; 18 | } 19 | 20 | public void Button4 () { 21 | Popup.Show ("Success", "Your account updated successfully.", "OK", PopupColor.Green) ; 22 | } 23 | 24 | public void Button5 () { 25 | Popup.Show ("Event test", "When you close this popup a message will show.", "Close Me", PopupColor.Magenta, 26 | () => { 27 | Debug.Log ("Magenta popup is closed") ; 28 | } 29 | ) ; 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Demo Scene/Demo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6adbf70cd0faaf489775ac4a14b05ee 3 | timeCreated: 1618350149 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Demo Scene/scene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herbou/Unity_PopupUI/b98d19188fa42d09be6ded013265bcde7be455e5/Assets/Demo Scene/scene.unity -------------------------------------------------------------------------------- /Assets/Demo Scene/scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2884d1cda16047244b5123fdb6e0d6f0 3 | timeCreated: 1609001769 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Popup UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f9e43da4ef55cf4c9de2a4430d31ee4 3 | folderAsset: yes 4 | timeCreated: 1609002110 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Popup UI/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e101ec0bdde418143857f3bf5df01632 3 | folderAsset: yes 4 | timeCreated: 1608726934 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Popup UI/Resources/PopupUI.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herbou/Unity_PopupUI/b98d19188fa42d09be6ded013265bcde7be455e5/Assets/Popup UI/Resources/PopupUI.prefab -------------------------------------------------------------------------------- /Assets/Popup UI/Resources/PopupUI.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68a55a9a5437c4243b0aba56d39bce52 3 | timeCreated: 1624115393 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Popup UI/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71b8ccabcd0218f4e80edf4930aac815 3 | folderAsset: yes 4 | timeCreated: 1609002110 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Popup UI/Scripts/Popup.cs: -------------------------------------------------------------------------------- 1 | /* ------------------------------- 2 | Created by : Hamza Herbou 3 | hamza95herbou@gmail.com 4 | ---------------------------------- */ 5 | 6 | using UnityEngine ; 7 | using UnityEngine.EventSystems ; 8 | using UnityEngine.Events ; 9 | using EasyUI.Helpers ; 10 | 11 | 12 | namespace EasyUI.Popup { 13 | 14 | public enum PopupColor { 15 | Black, 16 | Red, 17 | Purple, 18 | Magenta, 19 | Blue, 20 | Green, 21 | Yellow, 22 | Orange 23 | } 24 | 25 | public static class Popup { 26 | public static bool _isLoaded = false ; 27 | 28 | private static PopupUI popupUI ; 29 | 30 | 31 | private static void Prepare () { 32 | if (!_isLoaded) { 33 | GameObject instance = MonoBehaviour.Instantiate (Resources.Load ("PopupUI")) ; 34 | instance.name = "[ POPUP UI ]" ; 35 | popupUI = instance.GetComponent () ; 36 | _isLoaded = true ; 37 | 38 | CheckForEventSystem () ; 39 | } 40 | } 41 | 42 | private static void CheckForEventSystem () { 43 | // Check if there is an EventSystem in the scene (if not, add one) 44 | EventSystem es = MonoBehaviour.FindObjectOfType () ; 45 | if (object.ReferenceEquals (es, null)) { 46 | GameObject esGameObject = new GameObject ("EventSystem") ; 47 | esGameObject.AddComponent () ; 48 | esGameObject.AddComponent () ; 49 | } 50 | } 51 | 52 | 53 | 54 | public static void Show (string text) { 55 | Prepare () ; 56 | popupUI.Show ("", text, popupUI.defaultButtonText, PopupColor.Black, null) ; 57 | } 58 | 59 | public static void Show (string text, UnityAction onCloseAction) { 60 | Prepare () ; 61 | popupUI.Show ("", text, popupUI.defaultButtonText, PopupColor.Black, onCloseAction) ; 62 | } 63 | 64 | public static void Show (string title, string text) { 65 | Prepare () ; 66 | popupUI.Show (title, text, popupUI.defaultButtonText, PopupColor.Black, null) ; 67 | } 68 | 69 | public static void Show (string title, string text, UnityAction onCloseAction) { 70 | Prepare () ; 71 | popupUI.Show (title, text, popupUI.defaultButtonText, PopupColor.Black, onCloseAction) ; 72 | } 73 | 74 | public static void Show (string title, string text, string buttonText) { 75 | Prepare () ; 76 | popupUI.Show (title, text, buttonText, PopupColor.Black, null) ; 77 | } 78 | 79 | public static void Show (string title, string text, string buttonText, UnityAction onCloseAction) { 80 | Prepare () ; 81 | popupUI.Show (title, text, buttonText, PopupColor.Black, onCloseAction) ; 82 | } 83 | 84 | public static void Show (string title, string text, string buttonText, PopupColor buttonColor) { 85 | Prepare () ; 86 | popupUI.Show (title, text, buttonText, buttonColor, null) ; 87 | } 88 | 89 | public static void Show (string title, string text, string buttonText, PopupColor buttonColor, UnityAction onCloseAction) { 90 | Prepare () ; 91 | popupUI.Show (title, text, buttonText, buttonColor, onCloseAction) ; 92 | } 93 | 94 | 95 | public static void Dismiss () { 96 | if (_isLoaded) 97 | popupUI.Dismiss () ; 98 | } 99 | 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /Assets/Popup UI/Scripts/Popup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e9cb16f2ff29e14f83337de1962cf76 3 | timeCreated: 1624116436 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Popup UI/Scripts/PopupUI.cs: -------------------------------------------------------------------------------- 1 | /* ------------------------------- 2 | Created by : Hamza Herbou 3 | hamza95herbou@gmail.com 4 | ---------------------------------- */ 5 | 6 | using UnityEngine ; 7 | using System.Collections ; 8 | using UnityEngine.UI ; 9 | using EasyUI.Popup ; 10 | using UnityEngine.Events ; 11 | 12 | 13 | namespace EasyUI.Helpers { 14 | 15 | public class PopupUI : MonoBehaviour { 16 | [Header ("UI References :")] 17 | [SerializeField] private GraphicRaycaster uiCanvasGraphicRaycaster ; 18 | [SerializeField] private CanvasGroup uiCanvasGroup ; 19 | [SerializeField] private GameObject uiHeader ; 20 | [SerializeField] private Text uiTitle ; 21 | [SerializeField] private Text uiText ; 22 | [SerializeField] private Image uiButtonImage ; 23 | [SerializeField] private Text uiButtonText ; 24 | private Button uiButton ; 25 | 26 | [Header ("Popup Colors :")] 27 | [SerializeField] private Color[] colors ; 28 | 29 | [Header ("Popup Fade Duration :")] 30 | [Range (.1f, .8f)] [SerializeField] private float fadeInDuration = .3f ; 31 | [Range (.1f, .8f)] [SerializeField] private float fadeOutDuration = .3f ; 32 | 33 | [Space] 34 | public int maxTextLength = 200 ; 35 | public string defaultButtonText = "CLOSE" ; 36 | 37 | private UnityAction onCloseAction ; 38 | 39 | 40 | void Awake () { 41 | uiCanvasGroup.alpha = 0f ; 42 | uiCanvasGroup.interactable = false ; 43 | uiCanvasGraphicRaycaster.enabled = false ; 44 | 45 | uiButton = uiButtonImage.GetComponent < Button> () ; 46 | uiButton.onClick.RemoveAllListeners () ; 47 | uiButton.onClick.AddListener (() => { 48 | if (onCloseAction != null) { 49 | onCloseAction.Invoke () ; 50 | onCloseAction = null ; 51 | } 52 | 53 | StartCoroutine (FadeOut (fadeOutDuration)) ; 54 | }) ; 55 | } 56 | 57 | public void Show (string title, string text, string buttonText, PopupColor color, UnityAction action) { 58 | if (string.IsNullOrEmpty (title.Trim ())) 59 | uiHeader.SetActive (false) ; 60 | else { 61 | uiHeader.SetActive (true) ; 62 | uiTitle.text = title ; 63 | } 64 | 65 | uiText.text = (text.Length > maxTextLength) ? text.Substring (0, maxTextLength) + "..." : text ; 66 | 67 | uiButtonText.text = buttonText ; 68 | 69 | Color c = colors [ (int)color ] ; 70 | Color ct = c ; 71 | ct.a = .75f ; 72 | uiTitle.color = ct ; 73 | uiButtonImage.color = c ; 74 | 75 | onCloseAction = action ; 76 | 77 | Dismiss () ; 78 | StartCoroutine (FadeIn (fadeInDuration)) ; 79 | } 80 | 81 | private IEnumerator FadeIn (float duration) { 82 | uiCanvasGraphicRaycaster.enabled = true ; 83 | yield return Fade (uiCanvasGroup, 0f, 1f, duration) ; 84 | uiCanvasGroup.interactable = true ; 85 | } 86 | 87 | private IEnumerator FadeOut (float duration) { 88 | yield return Fade (uiCanvasGroup, 1f, 0f, duration) ; 89 | uiCanvasGroup.interactable = false ; 90 | uiCanvasGraphicRaycaster.enabled = false ; 91 | } 92 | 93 | private IEnumerator Fade (CanvasGroup cGroup, float startAlpha, float endAlpha, float duration) { 94 | float startTime = Time.time ; 95 | float alpha = startAlpha ; 96 | 97 | if (duration > 0f) { 98 | //Anim start 99 | while (alpha != endAlpha) { 100 | alpha = Mathf.Lerp (startAlpha, endAlpha, (Time.time - startTime) / duration) ; 101 | cGroup.alpha = alpha ; 102 | 103 | yield return null ; 104 | } 105 | } 106 | 107 | cGroup.alpha = endAlpha ; 108 | } 109 | 110 | public void Dismiss () { 111 | StopAllCoroutines () ; 112 | uiCanvasGroup.alpha = 0f ; 113 | uiCanvasGroup.interactable = false ; 114 | uiCanvasGraphicRaycaster.enabled = false ; 115 | } 116 | 117 | private void OnDestroy () { 118 | EasyUI.Popup.Popup._isLoaded = false ; 119 | } 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /Assets/Popup UI/Scripts/PopupUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df52f3200d4eb594d9f94d029608ff09 3 | timeCreated: 1624116437 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Popup UI/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89c2e77622af86641bf81361d1a2d7b1 3 | folderAsset: yes 4 | timeCreated: 1609002326 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Popup UI/Sprites/square_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herbou/Unity_PopupUI/b98d19188fa42d09be6ded013265bcde7be455e5/Assets/Popup UI/Sprites/square_r.png -------------------------------------------------------------------------------- /Assets/Popup UI/Sprites/square_r.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28b08fa84201bf74f815e602f1963808 3 | timeCreated: 1609002775 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 0 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 45, y: 45, z: 45, w: 45} 43 | spritePixelsToUnits: 160 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: Android 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Popup UI/Sprites/square_r_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herbou/Unity_PopupUI/b98d19188fa42d09be6ded013265bcde7be455e5/Assets/Popup UI/Sprites/square_r_2.png -------------------------------------------------------------------------------- /Assets/Popup UI/Sprites/square_r_2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d522b9a09abaaf4f94d4434abbc256a 3 | timeCreated: 1624116067 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 18, y: 18, z: 18, w: 18} 43 | spritePixelsToUnits: 140 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: Android 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /EasyUI_Popup_v1.1.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/herbou/Unity_PopupUI/b98d19188fa42d09be6ded013265bcde7be455e5/EasyUI_Popup_v1.1.unitypackage -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Hamza Herbou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Popup UI for your game 2 | A powerful,Customizable, and esay-to-use Popup UI for Unity 3 | 4 | Popup UI 5 | 6 | ### Video tutorial : https://youtu.be/TL8OQ8tc-gs 7 |

8 | 9 | 10 | 11 | ## ■ Supporting Platforms : 12 | - All platforms (Standalone Builds, Android, iOS, WebGl, and more..) 13 |

14 | ## ■ How to use? : 15 | ### 1- Import **EasyUI_Popup** package. 16 | ⚠️ NOTE! : No need to add any prefab to the scene 17 | ### 3- Add **EasyUI.Popup** namespace in your script : 18 | ```c# 19 | using EasyUI.Popup ; 20 | ``` 21 | ### 4- Now Simply write ```Popup.Show(..)```: 22 | ```c# 23 | // Only Text : 24 | Popup.Show ("Hello GameDevs") ; 25 | 26 | // Title & Text : 27 | Popup.Show ("Message", "Hello GameDevs") ; 28 | ``` 29 | 30 | ## ■ Change text styling : 31 | ```c# 32 | Popup.Show ("Custom text color", "Hello, This text is red"); 33 | ``` 34 | Toast ui 35 | for more supported style tags : Text supported styles 36 | 37 | ## ■ All options popup : 38 | ```c# 39 | void Start(){ 40 | Popup.Show ("Popup title", "With Unity we can do anything.", "Click Me", PopupColor.Red, OnClose); 41 | } 42 | 43 | void OnClose(){ 44 | Debug.Log("Red Popup closed"); 45 | } 46 | ``` 47 | Toast ui 48 | 49 | or you can use lambda expression **=>** for the event : 50 | ```c# 51 | void Start(){ 52 | Popup.Show ("Popup title", "Hello world", "Click Me", PopupColor.Red, 53 | () => { 54 | Debug.Log("Red Popup closed"); 55 | } 56 | ); 57 | 58 | // or remove {} since we have only one line: 59 | // Popup.Show ("Popup title", "Hello world", "Click Me", PopupColor.Red, () => Debug.Log("Red Popup closed") ); 60 | } 61 | ``` 62 | 63 | ## ■ Dismiss popup : 64 | ```c# 65 | Popup.Dismiss(); 66 | ``` 67 | 68 | ## ■ All Show(..) versions : 69 | ```c# 70 | Popup.Show (string text); 71 | 72 | Popup.Show (string text, UnityAction onCloseAction); 73 | 74 | Popup.Show (string title, string text); 75 | 76 | Popup.Show (string title, string text, UnityAction onCloseAction); 77 | 78 | Popup.Show (string title, string text, string buttonText); 79 | 80 | Popup.Show (string title, string text, string buttonText, UnityAction onCloseAction); 81 | 82 | Popup.Show (string title, string text, string buttonText, PopupColor buttonColor); 83 | 84 | Popup.Show (string title, string text, string buttonText, PopupColor buttonColor, UnityAction onCloseAction); 85 | ``` 86 | 87 | 88 |

89 |
90 | ## ❤️ Donate 91 | Paypal 92 | --------------------------------------------------------------------------------