{"id":31923,"date":"2024-11-01T09:04:14","date_gmt":"2024-11-01T09:04:14","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=31923"},"modified":"2024-11-01T11:34:08","modified_gmt":"2024-11-01T11:34:08","slug":"unity-basics-course-2d-and-ui","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/31923\/","title":{"rendered":"Unity Basics Course: 2D and UI"},"content":{"rendered":"<p><body><\/p>\n<header>\n<\/header>\n<div class=\"container\">\n<h2>1. Introduction to Unity<\/h2>\n<p>\n            Unity is a powerful platform for game development and real-time 3D content creation.<br \/>\n            It offers a variety of features and tools to easily develop both 2D and 3D games.<br \/>\n            This course will cover the basic concepts of Unity and how to create 2D games and UI (User Interface).<br \/>\n            Before starting to learn Unity, let&#8217;s take a brief look at the installation and basic interface of Unity.\n        <\/p>\n<h2>2. Installing Unity and Basic Interface<\/h2>\n<p>\n            First, to install Unity, you need to download Unity Hub from the official Unity website.<br \/>\n            Unity Hub allows you to manage different versions of Unity and create projects.\n        <\/p>\n<p>\n            After installing Unity, when you launch it, the basic interface appears.<br \/>\n            <strong>Main Components<\/strong> are as follows:\n        <\/p>\n<ul>\n<li><strong>Scene View<\/strong>: You can visually check the scene you are currently working on.<\/li>\n<li><strong>Game View<\/strong>: An area where you can run and test the game in play mode.<\/li>\n<li><strong>Inspector<\/strong>: A panel where you can edit the properties of the selected object.<\/li>\n<li><strong>Project<\/strong>: All files and assets of the project are managed here.<\/li>\n<li><strong>Hierarchy<\/strong>: Lists all objects in the current scene hierarchically.<\/li>\n<\/ul>\n<h2>3. 2D Game Development<\/h2>\n<p>\n            Unity provides powerful tools for 2D game development.<br \/>\n            Now, let&#8217;s create a simple 2D game.<br \/>\n            You can set up the project and create basic 2D objects by following these steps.\n        <\/p>\n<h3>3.1 Creating a New 2D Project<\/h3>\n<p>\n            In Unity Hub, click the <strong>New<\/strong> button, then select the 2D template to create a new project.<br \/>\n            Enter the project name, choose the desired location, and then click the <strong>Create<\/strong> button to generate the project.\n        <\/p>\n<h3>3.2 Adding Sprites<\/h3>\n<p>\n            In a 2D game, sprites are the most fundamental graphic elements.<br \/>\n            For example, characters, backgrounds, and obstacles can be represented as sprites.<br \/>\n            Add your sprite images by dragging them into the <strong>Assets<\/strong> folder of your project.<br \/>\n            Drag the added sprites into the scene view to use them as game objects.\n        <\/p>\n<h3>3.3 Sprite Animation<\/h3>\n<p>\n            Sprite animation creates movement by sequentially displaying multiple sprite images.<br \/>\n            First, prepare several frames of sprites, then open the <strong>Animation<\/strong> window and select appropriate sprites to create an animation clip.\n        <\/p>\n<pre>\n            \/\/ Example code for sprite animation\n            using UnityEngine;\n\n            public class PlayerAnimation : MonoBehaviour {\n                private Animator animator;\n\n                void Start() {\n                    animator = GetComponent<Animator>();\n                }\n\n                void Update() {\n                    if (Input.GetKey(KeyCode.RightArrow)) {\n                        animator.SetBool(\"isRunning\", true);\n                    } else {\n                        animator.SetBool(\"isRunning\", false);\n                    }\n                }\n            }\n        <\/Animator><\/pre>\n<h2>4. UI (User Interface) Components<\/h2>\n<p>\n            The User Interface (UI) is an important element that communicates with the game user.<br \/>\n            UI elements display various information such as score, lives, and buttons, and are essential for players to interact with the game.\n        <\/p>\n<h3>4.1 Creating a Canvas<\/h3>\n<p>\n            To add UI elements, you must first create a canvas.<br \/>\n            Right-click in the scene view and select <strong>UI<\/strong> &gt; <strong>Canvas<\/strong>.<br \/>\n            Once the canvas is created, there will be space to place UI elements.\n        <\/p>\n<h3>4.2 Adding a UI Button<\/h3>\n<p>\n            A button is one of the most basic UI elements.<br \/>\n            To add a button below the canvas, right-click and select <strong>UI<\/strong> &gt; <strong>Button<\/strong>.<br \/>\n            To change the text of the created button, click on the button and modify the text properties in the inspector.\n        <\/p>\n<pre>\n            \/\/ Button click event code\n            using UnityEngine;\n            using UnityEngine.UI;\n\n            public class UIButtonHandler : MonoBehaviour {\n                public Button yourButton;\n\n                void Start() {\n                    yourButton.onClick.AddListener(TaskOnClick);\n                }\n\n                void TaskOnClick() {\n                    Debug.Log(\"Button clicked!\");\n                }\n            }\n        <\/pre>\n<h3>4.3 Adding Text Elements<\/h3>\n<p>\n            You can add text elements to convey information within the game.<br \/>\n            Right-click on the canvas and select <strong>UI<\/strong> &gt; <strong>Text<\/strong> and place it in the appropriate location.<br \/>\n            In the inspector, you can modify the content of the text and adjust font, size, and other properties.\n        <\/p>\n<h2>5. Scripts and Interaction<\/h2>\n<p>\n            Now, let&#8217;s explore how to interact with the UI in a 2D game.<br \/>\n            We will look at how to handle button click events using scripts.\n        <\/p>\n<h3>5.1 Creating a Script<\/h3>\n<p>\n            Right-click in the <strong>Assets<\/strong> folder in the project window and select <strong>Create<\/strong> &gt; <strong>C# Script<\/strong>.<br \/>\n            Name the script, then double-click to open it in a code editor like Visual Studio for editing.\n        <\/p>\n<h3>5.2 Adding Button Functionality to the Script<\/h3>\n<p>\n            Add the code that will execute when the button is clicked to the created script.<br \/>\n            Use the <code>OnClick()<\/code> method to connect the button for handling the click.\n        <\/p>\n<h2>6. Testing and Building the Game<\/h2>\n<p>\n            Now that the basic 2D game and UI elements have been created,<br \/>\n            to test the game, click the <strong>Play<\/strong> button in the top menu.<br \/>\n            You can add helpful debug logs to check the game state.\n        <\/p>\n<h3>6.1 Game Build Settings<\/h3>\n<p>\n            Once testing is complete, you need to build the game.<br \/>\n            Select <strong>File<\/strong> &gt; <strong>Build Settings<\/strong> from the top menu.<br \/>\n            Choose the platform and click the <strong>Build<\/strong> button to build the game.\n        <\/p>\n<h2>7. Conclusion<\/h2>\n<p>\n            In this tutorial, we learned how to develop a 2D game and build a UI using Unity.<br \/>\n            By utilizing various features of Unity, you can develop even more professional games.<br \/>\n            As the next step, consider exploring how to add more complex logic or animations to enhance the quality of your game.\n        <\/p>\n<p>\n            Additionally, refer to the official Unity documentation or community forums to explore more resources and experience the fun of game development.<br \/>\n            We look forward to the day when your creatively enhanced game will be released to the world!\n        <\/p>\n<\/div>\n<footer>\n<p>\u00a9 2023 Basic Unity Course<\/p>\n<\/footer>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction to Unity Unity is a powerful platform for game development and real-time 3D content creation. It offers a variety of features and tools to easily develop both 2D and 3D games. This course will cover the basic concepts of Unity and how to create 2D games and UI (User Interface). Before starting to &hellip; <a href=\"https:\/\/atmokpo.com\/w\/31923\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity Basics Course: 2D and UI&#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-31923","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: 2D and UI - \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\/31923\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unity Basics Course: 2D and UI - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"1. Introduction to Unity Unity is a powerful platform for game development and real-time 3D content creation. It offers a variety of features and tools to easily develop both 2D and 3D games. This course will cover the basic concepts of Unity and how to create 2D games and UI (User Interface). Before starting to &hellip; \ub354 \ubcf4\uae30 &quot;Unity Basics Course: 2D and UI&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/31923\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:04:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:34:08+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\/31923\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31923\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity Basics Course: 2D and UI\",\"datePublished\":\"2024-11-01T09:04:14+00:00\",\"dateModified\":\"2024-11-01T11:34:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31923\/\"},\"wordCount\":777,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/31923\/\",\"url\":\"https:\/\/atmokpo.com\/w\/31923\/\",\"name\":\"Unity Basics Course: 2D and UI - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:04:14+00:00\",\"dateModified\":\"2024-11-01T11:34:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/31923\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/31923\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/31923\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unity Basics Course: 2D and UI\"}]},{\"@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: 2D and UI - \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\/31923\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity Basics Course: 2D and UI - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"1. Introduction to Unity Unity is a powerful platform for game development and real-time 3D content creation. It offers a variety of features and tools to easily develop both 2D and 3D games. This course will cover the basic concepts of Unity and how to create 2D games and UI (User Interface). Before starting to &hellip; \ub354 \ubcf4\uae30 \"Unity Basics Course: 2D and UI\"","og_url":"https:\/\/atmokpo.com\/w\/31923\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:04:14+00:00","article_modified_time":"2024-11-01T11:34:08+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\/31923\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/31923\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity Basics Course: 2D and UI","datePublished":"2024-11-01T09:04:14+00:00","dateModified":"2024-11-01T11:34:08+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/31923\/"},"wordCount":777,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/31923\/","url":"https:\/\/atmokpo.com\/w\/31923\/","name":"Unity Basics Course: 2D and UI - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:04:14+00:00","dateModified":"2024-11-01T11:34:08+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/31923\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/31923\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/31923\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Unity Basics Course: 2D and UI"}]},{"@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\/31923","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=31923"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31923\/revisions"}],"predecessor-version":[{"id":31924,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/31923\/revisions\/31924"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=31923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=31923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=31923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}