{"id":32009,"date":"2024-11-01T09:04:54","date_gmt":"2024-11-01T09:04:54","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=32009"},"modified":"2024-11-01T11:33:43","modified_gmt":"2024-11-01T11:33:43","slug":"unity-basics-course-creating-an-ending-screen","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/32009\/","title":{"rendered":"Unity Basics Course: Creating an Ending Screen"},"content":{"rendered":"<p><body><\/p>\n<div class=\"section\">\n<p>In this course, we will learn how to create an ending screen for a game using Unity. The ending screen is an important element that indicates to the player that they have completed the game and it is necessary to convey the theme of the game well. Each step will be explained in detail, along with necessary code examples.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>1. Understanding the Components of the Ending Screen<\/h2>\n<p>The ending screen consists of various elements, which reflect the game&#8217;s story and mood. Generally, the following elements are included:<\/p>\n<ul>\n<li><strong>Game Logo<\/strong>: A graphic representing the identity of the game.<\/li>\n<li><strong>Thank You Message<\/strong>: An expression of gratitude for the player&#8217;s participation.<\/li>\n<li><strong>Restart Button<\/strong>: An option for the player to restart the game.<\/li>\n<li><strong>Exit Button<\/strong>: An option to exit the game.<\/li>\n<li><strong>Ranking or Score<\/strong>: Space to display the player&#8217;s achievements.<\/li>\n<\/ul>\n<\/div>\n<div class=\"section\">\n<h2>2. Setting Up a Unity Project<\/h2>\n<p>The first step is to create a new Unity project. Launch Unity and follow the steps below to set up a new 2D project:<\/p>\n<ol>\n<li>Run the Unity Hub and click the &#8216;New Project&#8217; button.<\/li>\n<li>Select the &#8216;2D&#8217; template and enter a project name.<\/li>\n<li>Specify the saving location of the project and click the &#8216;Create&#8217; button.<\/li>\n<\/ol>\n<\/div>\n<div class=\"section\">\n<h2>3. Designing the UI of the Ending Screen<\/h2>\n<p>To design the ending screen in Unity, you need to add UI elements. Follow the steps below to set up the UI:<\/p>\n<ol>\n<li>Right-click in the Hierarchy window and select &#8216;UI &gt; Canvas&#8217; to create a canvas.<\/li>\n<li>Under Canvas, select &#8216;UI &gt; Image&#8217; to add a background image. Adjust the ratio to fill the whole screen.<\/li>\n<li>Set the background color or drag an image file to use as the background.<\/li>\n<\/ol>\n<p>Now let&#8217;s add text and buttons:<\/p>\n<ol>\n<li>Under Canvas, select &#8216;UI &gt; Text &#8211; TextMeshPro&#8217;. Create a text object and enter the title (e.g., &#8220;Game Completed!&#8221;).<\/li>\n<li>Adjust the text properties to set the size and color.<\/li>\n<li>Similarly, add &#8216;UI &gt; Button&#8217; and set the button&#8217;s text to &#8220;Restart&#8221; or &#8220;Exit&#8221;.<\/li>\n<\/ol>\n<\/div>\n<div class=\"section\">\n<h2>4. Writing the UI Script for the Ending Screen<\/h2>\n<p>Now, let&#8217;s write a script to make the ending screen functional. Create a new C# script and name it &#8216;EndingScreen&#8217;, then write the following code:<\/p>\n<pre><code>using UnityEngine;\nusing UnityEngine.SceneManagement;\nusing UnityEngine.UI;\n\npublic class EndingScreen : MonoBehaviour\n{\n    public Button restartButton;\n    public Button exitButton;\n\n    void Start()\n    {\n        restartButton.onClick.AddListener(RestartGame);\n        exitButton.onClick.AddListener(ExitGame);\n    }\n\n    void RestartGame()\n    {\n        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);\n    }\n\n    void ExitGame()\n    {\n        Application.Quit();\n    }\n}\n    <\/code><\/pre>\n<p>Add the script you wrote to the Canvas of the ending screen, and assign the functions related to the buttons.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>5. Integrating Game Logic with the Ending Screen<\/h2>\n<p>Now, you need to modify the game logic so that the ending screen appears when the game is over. Add the following code to call the ending screen at the last state of the game:<\/p>\n<pre><code>using UnityEngine;\n\npublic class GameManager : MonoBehaviour\n{\n    public GameObject endingScreen;\n\n    public void GameOver()\n    {\n        endingScreen.SetActive(true);\n    }\n}\n    <\/code><\/pre>\n<p>Now, set the game over conditions and assign the ending screen&#8217;s Canvas to the <strong>endingScreen<\/strong> variable so that the ending screen is displayed when the game is over.<\/p>\n<\/div>\n<div class=\"section\">\n<h2>6. Adding Animation to the Ending Screen<\/h2>\n<p>You can add animation effects to the ending screen to provide a more engaging user experience. You can add animations using the following methods:<\/p>\n<ol>\n<li>Select the ending screen Canvas and click &#8216;Add Component&#8217;. Add an &#8216;Animator&#8217;.<\/li>\n<li>Create an &#8216;Animation&#8217; folder in the Project window, and in that folder, select &#8216;Create &gt; Animation&#8217; to create a new animation.<\/li>\n<li>In the Animation window, click &#8216;Add Property&#8217; and add the desired properties, such as color or position. Then link this animation to Animate the End Game Canvas.<\/li>\n<\/ol>\n<\/div>\n<div class=\"section\">\n<h2>7. Final Check and Build<\/h2>\n<p>After completing all the setups, play the game to check if the ending screen works correctly. If there are no issues, prepare to build the game. Select the platform to build and run: <\/p>\n<ol>\n<li>Select &#8216;File &gt; Build Settings&#8217; in the top menu.<\/li>\n<li>Select the platform and click the &#8216;Build&#8217; button to start the build process.<\/li>\n<\/ol>\n<\/div>\n<div class=\"section\">\n<h2>Conclusion<\/h2>\n<p>In this course, we looked at the process of creating a simple ending screen using Unity. The ending screen of a game is an important element that leaves a deep impression on the player, so it should always be taken care of. By applying various UI designs and animations, create your unique ending screen.<\/p>\n<p>Through this course, I hope you have not only improved your fundamental understanding of Unity but also your understanding of game components. I encourage you to learn many features and techniques through more diverse Unity courses in the future!<\/p>\n<\/div>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this course, we will learn how to create an ending screen for a game using Unity. The ending screen is an important element that indicates to the player that they have completed the game and it is necessary to convey the theme of the game well. Each step will be explained in detail, along &hellip; <a href=\"https:\/\/atmokpo.com\/w\/32009\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity Basics Course: Creating an Ending Screen&#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-32009","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 - \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\/32009\/\" \/>\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 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"In this course, we will learn how to create an ending screen for a game using Unity. The ending screen is an important element that indicates to the player that they have completed the game and it is necessary to convey the theme of the game well. Each step will be explained in detail, along &hellip; \ub354 \ubcf4\uae30 &quot;Unity Basics Course: Creating an Ending Screen&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/32009\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:04:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:33:43+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\/32009\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32009\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity Basics Course: Creating an Ending Screen\",\"datePublished\":\"2024-11-01T09:04:54+00:00\",\"dateModified\":\"2024-11-01T11:33:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32009\/\"},\"wordCount\":701,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/32009\/\",\"url\":\"https:\/\/atmokpo.com\/w\/32009\/\",\"name\":\"Unity Basics Course: Creating an Ending Screen - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:04:54+00:00\",\"dateModified\":\"2024-11-01T11:33:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32009\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/32009\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/32009\/#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\"}]},{\"@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 - \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\/32009\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity Basics Course: Creating an Ending Screen - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"In this course, we will learn how to create an ending screen for a game using Unity. The ending screen is an important element that indicates to the player that they have completed the game and it is necessary to convey the theme of the game well. Each step will be explained in detail, along &hellip; \ub354 \ubcf4\uae30 \"Unity Basics Course: Creating an Ending Screen\"","og_url":"https:\/\/atmokpo.com\/w\/32009\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:04:54+00:00","article_modified_time":"2024-11-01T11:33:43+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\/32009\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/32009\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity Basics Course: Creating an Ending Screen","datePublished":"2024-11-01T09:04:54+00:00","dateModified":"2024-11-01T11:33:43+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/32009\/"},"wordCount":701,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/32009\/","url":"https:\/\/atmokpo.com\/w\/32009\/","name":"Unity Basics Course: Creating an Ending Screen - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:04:54+00:00","dateModified":"2024-11-01T11:33:43+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/32009\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/32009\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/32009\/#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"}]},{"@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\/32009","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=32009"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32009\/revisions"}],"predecessor-version":[{"id":32010,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32009\/revisions\/32010"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=32009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=32009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=32009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}