{"id":32095,"date":"2024-11-01T09:05:38","date_gmt":"2024-11-01T09:05:38","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=32095"},"modified":"2024-11-01T11:33:20","modified_gmt":"2024-11-01T11:33:20","slug":"unity-basics-course-creating-an-ending-screen-victory","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/32095\/","title":{"rendered":"Unity Basics Course: Creating an Ending Screen &#8211; Victory"},"content":{"rendered":"<p><body><\/p>\n<h2>Introduction<\/h2>\n<p>Hello! In this course, we will learn how to create an ending screen in Unity for games. We will particularly focus on the ending screen that will be displayed when a victory condition is met. The ending screen plays a significant role in game development as it provides important feedback to the player and greatly influences the overall gaming experience. In this article, we will explain the components of the ending screen, UI design, script writing methods, and more in detail.<\/p>\n<h2>1. Understanding the Ending Screen<\/h2>\n<p>The ending screen is the screen displayed to the player at the last stage of the game. It appears when the victory conditions are satisfied, and typically consists of the following elements:<\/p>\n<ul>\n<li>Victory message<\/li>\n<li>Score, rank, and other statistical information<\/li>\n<li>Restart button<\/li>\n<li>Button to return to the main menu<\/li>\n<li>Background image or animation<\/li>\n<\/ul>\n<h2>2. Setting Up the Unity Project<\/h2>\n<p>First, open the Unity project and create a new scene for the ending screen. Follow these steps:<\/p>\n<ol>\n<li>In the Unity Editor, click the <strong>File<\/strong> menu and select <strong>New Scene<\/strong>.<\/li>\n<li>Name the scene <strong>EndingScreen<\/strong> and save it.<\/li>\n<li>Right-click in the Hierarchy panel and choose <strong>UI -&gt; Canvas<\/strong> to create a canvas.<\/li>\n<li>Add various UI elements under the canvas.<\/li>\n<\/ol>\n<h2>3. Configuring the UI<\/h2>\n<p>Now, let&#8217;s set up the necessary UI elements for the ending screen. The basic elements needed for the ending screen include:<\/p>\n<h3>3.1. Adding a Victory Message<\/h3>\n<p>Add text under the Canvas to display the victory message. To add text:<\/p>\n<ol>\n<li>Right-click on the Canvas in the Hierarchy and select <strong>UI -&gt; Text<\/strong>.<\/li>\n<li>Modify the properties of the Text object to write the victory message. For example, you can use the message &#8220;Congratulations! You have won!&#8221;.<\/li>\n<\/ol>\n<h3>3.2. Displaying Scores and Statistics<\/h3>\n<p>To show the score and statistics obtained in the game, add another Text element.<\/p>\n<ol>\n<li>Right-click on the Canvas in the Hierarchy and select <strong>UI -&gt; Text<\/strong>.<\/li>\n<li>Modify the properties of the Text object to dynamically update the score information by connecting a script.<\/li>\n<\/ol>\n<h3>3.3. Adding Buttons<\/h3>\n<p>Add buttons that allow the player to restart or return to the main menu. Here\u2019s how to add buttons:<\/p>\n<ol>\n<li>Right-click on the Canvas in the Hierarchy and select <strong>UI -&gt; Button<\/strong>.<\/li>\n<li>Replace the button text with phrases like &#8220;Restart&#8221; or &#8220;Main Menu&#8221;.<\/li>\n<li>Adjust the button size and position in the Inspector window to make it look good.<\/li>\n<\/ol>\n<h2>4. Adding Scripts<\/h2>\n<p>Now that the UI elements of the ending screen are ready, let&#8217;s write a script to display this screen when the victory condition occurs. You can use the following approach:<\/p>\n<h3>4.1. Creating the EndingScreenManager Script<\/h3>\n<p>Follow these steps in the Unity Editor to create the script:<\/p>\n<ol>\n<li>Create a <strong>Scripts<\/strong> folder in the Project view.<\/li>\n<li>Right-click in the Scripts folder, select <strong>Create -&gt; C# Script<\/strong>, and name it <strong>EndingScreenManager<\/strong>.<\/li>\n<li>Double-click the script to open it in the code editor.<\/li>\n<\/ol>\n<h3>4.2. Writing the Script Code<\/h3>\n<p>Here is a basic code example for the EndingScreenManager script:<\/p>\n<pre><code>\nusing UnityEngine;\nusing UnityEngine.SceneManagement;\nusing UnityEngine.UI;\n\npublic class EndingScreenManager : MonoBehaviour\n{\n    public GameObject endingScreen;\n    public Text scoreText;\n\n    void Start()\n    {\n        endingScreen.SetActive(false);\n    }\n\n    public void ShowEndingScreen(int score)\n    {\n        endingScreen.SetActive(true);\n        scoreText.text = \"Your Score: \" + score.ToString();\n    }\n\n    public void RestartGame()\n    {\n        SceneManager.LoadScene(SceneManager.GetActiveScene().name);\n    }\n\n    public void GoToMainMenu()\n    {\n        SceneManager.LoadScene(\"MainMenu\");  \/\/ Change MainMenu to the actual scene name.\n    }\n}\n    <\/code><\/pre>\n<h3>4.3. Connecting UI Elements and the Script<\/h3>\n<p>Now that the script is ready, let&#8217;s connect the UI elements to the script:<\/p>\n<ol>\n<li>Select the Canvas in the Hierarchy panel, then add the EndingScreenManager script.<\/li>\n<li>Drag and connect the GameObject of the ending screen to the <strong>Ending Screen<\/strong> field of the EndingScreenManager component.<\/li>\n<li>Drag and connect the Text object that will display the score to the Score Text field.<\/li>\n<\/ol>\n<h2>5. Displaying the Ending Screen at Game End<\/h2>\n<p>Set up the game to call the ShowEndingScreen method to display the ending screen when the game ends. You can add the following code at the location where the victory condition is confirmed:<\/p>\n<pre><code>\nif (playerHasWon)\n{\n    endingScreenManager.ShowEndingScreen(playerScore);\n}\n    <\/code><\/pre>\n<h2>6. Decorating the Ending Screen<\/h2>\n<p>The ending screen should also be visually appealing. Here are some tips for creating an attractive ending screen:<\/p>\n<ul>\n<li>Use color combinations that match the background image.<\/li>\n<li>Add animation effects to create excitement about the ending.<\/li>\n<li>Adjust the font style of the text to enhance readability.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>This tutorial guided you on how to create an ending screen in Unity. By showing the ending screen at the right moment when the victory condition is satisfied and providing a congratulatory message and statistical information to the player, you can offer a more satisfying gaming experience. Now, add a fantastic ending screen to your game to give players an unforgettable moment!<\/p>\n<h2>Appendix<\/h2>\n<p>If you have any additional information or questions, please leave a comment. If you want more Unity-related tutorials, please subscribe to the blog!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Hello! In this course, we will learn how to create an ending screen in Unity for games. We will particularly focus on the ending screen that will be displayed when a victory condition is met. The ending screen plays a significant role in game development as it provides important feedback to the player and &hellip; <a href=\"https:\/\/atmokpo.com\/w\/32095\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity Basics Course: Creating an Ending Screen &#8211; Victory&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[135],"tags":[],"class_list":["post-32095","post","type-post","status-publish","format-standard","hentry","category-unity-basic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/32095\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Introduction Hello! In this course, we will learn how to create an ending screen in Unity for games. We will particularly focus on the ending screen that will be displayed when a victory condition is met. The ending screen plays a significant role in game development as it provides important feedback to the player and &hellip; \ub354 \ubcf4\uae30 &quot;Unity Basics Course: Creating an Ending Screen &#8211; Victory&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/32095\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:05:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:33:20+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity Basics Course: Creating an Ending Screen &#8211; Victory\",\"datePublished\":\"2024-11-01T09:05:38+00:00\",\"dateModified\":\"2024-11-01T11:33:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/\"},\"wordCount\":736,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/\",\"url\":\"https:\/\/atmokpo.com\/w\/32095\/\",\"name\":\"Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:05:38+00:00\",\"dateModified\":\"2024-11-01T11:33:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/32095\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/32095\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unity Basics Course: Creating an Ending Screen &#8211; Victory\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/32095\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Introduction Hello! In this course, we will learn how to create an ending screen in Unity for games. We will particularly focus on the ending screen that will be displayed when a victory condition is met. The ending screen plays a significant role in game development as it provides important feedback to the player and &hellip; \ub354 \ubcf4\uae30 \"Unity Basics Course: Creating an Ending Screen &#8211; Victory\"","og_url":"https:\/\/atmokpo.com\/w\/32095\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:05:38+00:00","article_modified_time":"2024-11-01T11:33:20+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/32095\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/32095\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity Basics Course: Creating an Ending Screen &#8211; Victory","datePublished":"2024-11-01T09:05:38+00:00","dateModified":"2024-11-01T11:33:20+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/32095\/"},"wordCount":736,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/32095\/","url":"https:\/\/atmokpo.com\/w\/32095\/","name":"Unity Basics Course: Creating an Ending Screen - Victory - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:05:38+00:00","dateModified":"2024-11-01T11:33:20+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/32095\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/32095\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/32095\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Unity Basics Course: Creating an Ending Screen &#8211; Victory"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=32095"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32095\/revisions"}],"predecessor-version":[{"id":32096,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32095\/revisions\/32096"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=32095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=32095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=32095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}