Imgui Extensions in Unity3d

Imgui Extensions in Unity3d

Petteri Paju IMGUI EXTENSIONS IN UNITY3D Bachelor’s Thesis Degree Programme in Information Technology / Game Programming 2017 Tekijä/Tekijät Tutkinto Aika Petteri Paju Insinööri (AMK) Joulukuu 2017 Opinnäytetyön nimi 69 sivua IMGUI Extensions In Unity3D 0 liitesivua Toimeksiantaja Kaakkois-Suomen Ammattikorkeakoulu / GameLab Ohjaaja Lehtori Niina Mässeli Tiivistelmä Tämän opinnäytetyön tarkoituksena on tutkia ja havainnollistaa kuinka Unity 3d pelimootto- rin käyttöliittymää voidaan laajentaa. Editori laajennukset voivat lisätä Unityn editoriin uusia työkaluja ja toimintoja. Editori laajennukset voivat hyödyntää pelinkehitystö, parantamalla työnkulkua, vähentämällä virheitä ja automatisoimalla yleisiä tehtäviä. Editori laajennukset rakennetaan Unityn sisään joko visuaalisina työkaluina tai automatisoituina komentoina, jotka voidaan aktivoida napeilla. Opinnäytetyö sisältää sekä teoriaa, että käytäntöä, siitä kuinka Unityn editori toimii. Käyttö- liittymä esittelee teorian Unityn käyttöliittymästä, sekä yleiset elementit joita käytetään edi- tori laajennusten toteuttamiseen. Koska tästä aiheesta ei ole useita aikaisempia opinnäyte- töitä, tavoitteena on tarjota selkeitä esimerkkejä, jotka demonstroivat editori laajennusten toiminnollisuutta. Opinnäytetyön lopussa esitellään käytännönosuus, jonka aiheena oli luoda esimerkki peli, jonka kehityksen tueksi luotiin erilaisia editori laajennuksia. Päätavoit- teena oli esitellä eri tapoja, kuinka editori laajennuksia voidaan käyttää. Vaikka aiheeseen liittyy joitakin toimintoja ja aihealueita, jotka jäivät työn ulkopuolelle, työ onnistuneesti käsitteli tärkeimmät aihealueet, jotka liittyvät editori laajennuksiin. Yleisellä tasolla työ kävi läpi perusasiat, muutamia yleisiä käytäntöjä sekä edistyneempiä menetel- miä. Käytännönosuus demonstroi mainiosti mahdollisuuksia, joita editorilaajennukset tarjoavat. Asiasanat ohjelmointi, unity, ui, imgui, käyttöliittymä, c# Author (authors) Degree Time Petteri Paju Bachelor of December 2017 Engineering Thesis Title 69 pages IMGUI Extensions In Unity3d 0 pages of appendices Commissioned by Kaakkois-Suomen Ammattikorkeakoulu / GameLab Supervisor Niina Mässeli, Senior Abstract The goal of this thesis was to study and demonstrate how the Unity3d game engines user interface can be extended. Editor extensions can add new tools and functionalities to Unity editor. Editor extensions can be very beneficial to game development, by improving the workflow, adding safety, and automating common tasks. Editor extensions are built inside Unity as either visual tools or automated tasks triggered by menu clicks. The thesis contains both theory and practice about Unity editor works. The thesis dis- cusses the theory of Unity editor system as well as the most commons elements that are used to build custom tools. As there are not many previous studies about the topic, the thesis aims to provide illustrative examples to demonstrate how editor extensions work. The thesis concludes with a case study, where a sample game was made along with differ- ent kind of editor extensions. The main goal of the case is to showcase how editor exten- sions can be used in different ways. While there were some features and topics that were cut out from the thesis, it successfully covered most crucial information necessary for developing editor extensions. The overall thesis was able to cover the basics, some good to know practices as well as some ad- vanced topics. The case study serves as a serviceable demonstration of possibilities pro- vided by editor extensions. Keywords programming, unity, ui, imgui, user-interface, c# CONTENTS 1 INTRODUCTION .......................................................................................................... 7 2 EDITOR EXTENSIONS ................................................................................................ 7 2.1 Advantages ............................................................................................................. 9 2.2 Disadvantages ...................................................................................................... 10 2.3 Example extensions .............................................................................................. 11 2.4 PlayMaker ............................................................................................................. 11 2.5 Anima2D ............................................................................................................... 12 2.6 Editor Console Pro ................................................................................................ 13 3 IMGUI-SYSTEM ......................................................................................................... 14 3.1 Events ................................................................................................................... 14 3.2 Editor Assembly .................................................................................................... 16 3.3 Serialization .......................................................................................................... 17 3.4 SerializedObject and SerializedProperty .............................................................. 21 4 EDITOR-WINDOWS ................................................................................................... 22 4.1 Inspector-Window ................................................................................................. 23 4.1.1 Custom Editor ................................................................................................. 23 4.2 Editor Window-class ............................................................................................. 24 4.3 Scene View ........................................................................................................... 25 4.3.1 Gizmos ............................................................................................................ 26 4.3.2 Handles ........................................................................................................... 27 4.4 Menus ................................................................................................................... 28 4.4.1 Settings ........................................................................................................... 29 5 LAYOUT AND APPEARANCE ................................................................................... 31 5.1 GUI and GUILayout .............................................................................................. 31 5.2 Element Groups .................................................................................................... 33 5.3 GUIStyle and GUISkin .......................................................................................... 35 6 UI CONTROLS ........................................................................................................... 37 6.1 Basis Controls....................................................................................................... 37 6.2 Serialized Controls ................................................................................................ 39 6.2.1 PropertyField .................................................................................................. 40 6.2.2 PropertyDrawer ............................................................................................... 41 6.2.3 Built-In PropertyAttributes ............................................................................... 42 6.2.4 Custom PropertyAttributes .............................................................................. 44 6.3 Undo and ChangeCheck ...................................................................................... 45 7 CASE .......................................................................................................................... 47 7.1 Game Introduction ................................................................................................ 47 7.2 Tools Overview ..................................................................................................... 48 7.3 Maps and Game Tiles ........................................................................................... 50 7.4 Missions ................................................................................................................ 51 7.5 Mission Conditions and Events ............................................................................. 54 7.6 Items ..................................................................................................................... 57 7.7 Characters ............................................................................................................ 59 7.7.1 Stats................................................................................................................ 60 8 CONCLUSIONS ......................................................................................................... 61 REFERENCES .................................................................................................................. 63 LIST OF FIGURES LIST OF TABLES TERMS AND ABBREVIATIONS Control An element in UI. Control can be an element like button, label, or textbox. GUI / UI User-interface, made of both visual and in- teractive components. Inspector A window that allows viewing and modify- ing properties of UnityEngine.Objects. Serialization A progress where data is translated from one format to another for transfer and stor- age purposes. ScriptableObject

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    69 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us