Back to Browse

Create Inspector Buttons w/ Editor Scripting and Reflection - Multi-Weapon System in Unity - Part 9

3.9K views
Jan 4, 2023
26:22

In this video we automate creating buttons in our weapon data inspector based on the data classes we have. We make use of reflection to automatically find all the classes we care about so that in the future new buttons will be created without any extra work. All Assets: https://drive.google.com/drive/folders/17JbMy70gbXLcPYrIIpwYt7xJmKngu0oB?usp=sharing Discord Server: https://discord.gg/uHQrf7K If you wish to support me more: https://www.patreon.com/Bardent GitHub link for this part: https://github.com/Bardent/Weapon-System-Tutorial-Series-Unity/tree/54dab988d8ddcaebc38f89fbfe7cf665a982d759 GitHub Repo Link: https://github.com/Bardent/Weapon-System-Tutorial-Series-Unity Player Controller Series: https://www.youtube.com/playlist?list=PLy78FINcVmjA0zDBhLuLNL1Jo6xNMMq-W 00:00 - Intro 00:40 - What is Editor Scripting? 01:35 - What is Reflection? 02:00 - Creating the WeaponDataSOEditor editor script 03:41 - How we add functionality 04:32 - Adding a button to our inspector 06:09 - Creating a list of types for our buttons 07:38 - Initializing the list for science 07:59 - Creating the buttons based on the List 08:55 - Filling the list with Reflection 17:03 - Demonstrating how new classes are automatically added to the list 17:39 - Making the buttons add new components to the ComponentData List 22:19 - Demonstrating buttons adding new objects 22:54 - Stop multiple instances being added 25:31 - What are we doing next time? 25:46 - Shameless Patreon Plug 25:56 - Outro

Download

0 formats

No download links available.

Create Inspector Buttons w/ Editor Scripting and Reflection - Multi-Weapon System in Unity - Part 9 | NatokHD