{"id":37943,"date":"2024-11-01T10:01:42","date_gmt":"2024-11-01T10:01:42","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37943"},"modified":"2024-11-01T11:33:04","modified_gmt":"2024-11-01T11:33:04","slug":"unity-2d-game-development-understanding-scenes-and-gameobjects-the-concept-of-scenes-and-the-components-of-gameobjects","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37943\/","title":{"rendered":"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects."},"content":{"rendered":"<p><body><\/p>\n<p>\n        Unity is a powerful tool that serves as an integrated development environment (IDE) for 2D and 3D game development,<br \/>\n        helping game developers easily create and distribute their games.<br \/>\n        This course aims to deepen the understanding of the fundamental concepts of game development, namely <strong>Scene<\/strong> and <strong>GameObject<\/strong>.\n    <\/p>\n<h2>1. Concept of Scene<\/h2>\n<p>\n        A Scene refers to each screen or level of a game in Unity.<br \/>\n        For example, the main menu, gameplay screen, game over screen, or each level can consist of separate scenes.<br \/>\n        Developers can manipulate cameras, lights, and objects in each scene to design the experiences delivered to users.\n    <\/p>\n<h3>1.1 Role of Scenes<\/h3>\n<p>\n        Scenes perform the following roles:<\/p>\n<ul>\n<li><strong>Game State Management:<\/strong> Manages the progress of the game and loads necessary objects.<\/li>\n<li><strong>UI Layout:<\/strong> Positions UI elements for user interaction.<\/li>\n<li><strong>Physics Engine:<\/strong> Simulates physical interactions.<\/li>\n<li><strong>Event Handling:<\/strong> Processes events based on user input.<\/li>\n<\/ul>\n<h3>1.2 Creating a Scene<\/h3>\n<p>\n        To create a scene, open the Unity Editor and follow these steps:\n    <\/p>\n<ol>\n<li>Click <code>File \u2192 New Scene<\/code> in the File menu.<\/li>\n<li>Once the scene is created, set a name and save it using <code>File \u2192 Save Scene<\/code>.<\/li>\n<li>Add <strong>GameObjects<\/strong> from the Hierarchy panel to arrange the elements desired by the user in the scene.<\/li>\n<\/ol>\n<h2>2. GameObject<\/h2>\n<p>\n        GameObject is the fundamental unit representing all objects in Unity.<br \/>\n        Game characters, backgrounds, items, projectiles, etc., are all implemented as GameObjects.<br \/>\n        Each GameObject can have various components added to extend its functionality.\n    <\/p>\n<h3>2.1 Components of GameObjects<\/h3>\n<p>\n        GameObjects are composed of the following basic elements:<\/p>\n<ul>\n<li><strong>Transform:<\/strong> Defines position, rotation, and scale.<\/li>\n<li><strong>Components:<\/strong> Define how each object behaves. For instance, <code>Rigidbody<\/code> pertains to physics simulation, while <code>BoxCollider<\/code> manages collisions.<\/li>\n<li><strong>Scripts:<\/strong> Allows you to write code to add custom functionality.<\/li>\n<\/ul>\n<h3>2.2 Example: Creating a Simple GameObject<\/h3>\n<p>\n        Here is an example of creating and manipulating a simple GameObject.<br \/>\n        In this example, we will create a basic &#8216;Cube&#8217; object and set some properties.\n    <\/p>\n<pre><code>C#\n\/\/ Using the default namespace of the Unity engine.\nusing UnityEngine;\n\npublic class CubeController : MonoBehaviour\n{\n    \/\/ Setting the movement speed of the cube.\n    public float moveSpeed = 5f;\n\n    void Update()\n    {\n        \/\/ Receiving key input.\n        float moveHorizontal = Input.GetAxis(\"Horizontal\");\n        float moveVertical = Input.GetAxis(\"Vertical\");\n\n        \/\/ Moving the cube to a new position.\n        Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);\n        transform.position += movement * moveSpeed * Time.deltaTime;\n    }\n}\n    <\/code><\/pre>\n<p>\n        With the above code, the user will move the cube using the arrow keys or WASD keys.<br \/>\n        The <code>Update<\/code> method is called every frame, adjusting the cube&#8217;s position based on user input.\n    <\/p>\n<h2>3. Relationship Between Scenes and GameObjects<\/h2>\n<p>\n        Scenes and GameObjects are closely connected concepts.<br \/>\n        A Scene consists of a collection of different GameObjects,<br \/>\n        and each GameObject operates independently within the scene.<br \/>\n        Hence, a Scene can be thought of as the space in which GameObjects exist and interact.\n    <\/p>\n<h3>3.1 Managing GameObjects Within a Scene<\/h3>\n<p>\n        There are various ways to manage GameObjects within a Scene.<br \/>\n        Below is how to create and destroy GameObjects:\n    <\/p>\n<pre><code>C#\n\/\/ Using the default namespace of the Unity engine\nusing UnityEngine;\n\npublic class GameManager : MonoBehaviour\n{\n    public GameObject enemyPrefab;\n\n    void Start()\n    {\n        \/\/ Creating an enemy object when the scene starts.\n        SpawnEnemy();\n    }\n\n    void SpawnEnemy()\n    {\n        \/\/ Instantiate an enemy at a random position.\n        Instantiate(enemyPrefab, new Vector3(Random.Range(-8f, 8f), 0, Random.Range(-4f, 4f)), Quaternion.identity);\n    }\n\n    public void DestroyEnemy(GameObject enemy)\n    {\n        \/\/ Destroy the enemy object.\n        Destroy(enemy);\n    }\n}\n    <\/code><\/pre>\n<p>\n        The above code implements a simple logic for creating and destroying enemy GameObjects.<br \/>\n        The <strong>SpawnEnemy<\/strong> method generates an enemy at a random position when the game starts,<br \/>\n        while the <strong>DestroyEnemy<\/strong> method performs the function of removing a specific enemy.\n    <\/p>\n<h2>4. Conclusion<\/h2>\n<p>\n        Scenes and GameObjects are very important elements in Unity 2D game development.<br \/>\n        If the scene constitutes the space that makes up all the scenarios of the game,<br \/>\n        then GameObjects are all the components interacting with the user within that space.<br \/>\n        If you have understood the basic concepts through this course, you will have laid the groundwork for developing more complex and diverse games.\n    <\/p>\n<p>\n        In the next course, we will learn about more in-depth script writing and various component utilizations.<br \/>\n        I hope you continue to challenge yourself and grow on your game development journey!\n    <\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity is a powerful tool that serves as an integrated development environment (IDE) for 2D and 3D game development, helping game developers easily create and distribute their games. This course aims to deepen the understanding of the fundamental concepts of game development, namely Scene and GameObject. 1. Concept of Scene A Scene refers to each &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37943\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.&#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-37943","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 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \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\/37943\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Unity is a powerful tool that serves as an integrated development environment (IDE) for 2D and 3D game development, helping game developers easily create and distribute their games. This course aims to deepen the understanding of the fundamental concepts of game development, namely Scene and GameObject. 1. Concept of Scene A Scene refers to each &hellip; \ub354 \ubcf4\uae30 &quot;Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37943\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T10:01:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:33:04+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=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.\",\"datePublished\":\"2024-11-01T10:01:42+00:00\",\"dateModified\":\"2024-11-01T11:33:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/\"},\"wordCount\":543,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"Unity Basic\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37943\/\",\"name\":\"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T10:01:42+00:00\",\"dateModified\":\"2024-11-01T11:33:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37943\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37943\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.\"}]},{\"@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 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \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\/37943\/","og_locale":"ko_KR","og_type":"article","og_title":"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Unity is a powerful tool that serves as an integrated development environment (IDE) for 2D and 3D game development, helping game developers easily create and distribute their games. This course aims to deepen the understanding of the fundamental concepts of game development, namely Scene and GameObject. 1. Concept of Scene A Scene refers to each &hellip; \ub354 \ubcf4\uae30 \"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.\"","og_url":"https:\/\/atmokpo.com\/w\/37943\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T10:01:42+00:00","article_modified_time":"2024-11-01T11:33:04+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":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/37943\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37943\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects.","datePublished":"2024-11-01T10:01:42+00:00","dateModified":"2024-11-01T11:33:04+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37943\/"},"wordCount":543,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["Unity Basic"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37943\/","url":"https:\/\/atmokpo.com\/w\/37943\/","name":"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects. - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T10:01:42+00:00","dateModified":"2024-11-01T11:33:04+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37943\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37943\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37943\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"Unity 2D Game Development, Understanding Scenes and GameObjects The concept of scenes and the components of GameObjects."}]},{"@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\/37943","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=37943"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37943\/revisions"}],"predecessor-version":[{"id":37944,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37943\/revisions\/37944"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}