Write Dynamic Code Using Reflection || Unity, C# Tutorial

Veröffentlicht am: 07 Oktober 2024
auf dem Kanal: Freedom Coding
1,526
65

Reflection is a really powerful programming tool, which can help you to write cleaner code and mainly can save you a lot of time. It can also be used for custom Unity editor tools and will make your code much more dynamic. When working with reflection, you are typically using the typeof keyword or the GetType() function to get the type of something, so you can then call functions on the type. In this tutorial, I prepared 4 examples of using reflection in Unity with C#. In the end, you will be able to dynamically instantiate any class, select types in the inspector, install plugins and call their private functions, and save or load data of any object with ease.

👍 Like and 🔔Subscribe for More Unity and C# Tutorials    / @freedomcoding  

Advanced service locator with contexts -   / 112983319  
Project files -   / 113461688  

🌟 Support My Work and Unlock Exclusive Content! 🌟
👉 Patreon:   / freedomcoding  

🎮 Join Our Developer Community!
💬 Discord:   / discord  

💖 Support Me Financially
☕ PayPal, Revolut: marek.freedom.coding@gmail.com

Website - https://www.freedom-coding.com

Timestamps:
00:00 What Is Reflection?
00:18 Dynamic vs Static Code
00:43 Basics of Reflection
01:37 Instantiating Classes Dynamically
07:32 Selecting Types In Inspector
14:03 Loading Plugins
15:25 Dynamic Save System
17:30 Conclusion


Auf dieser Seite können Sie das Online-Video Write Dynamic Code Using Reflection || Unity, C# Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Freedom Coding 07 Oktober 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,526 Mal angesehen und es wurde von 65 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!