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

Publicado el: 07 octubre 2024
en el canal de: 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


En esta página del sitio puede ver el video en línea Write Dynamic Code Using Reflection || Unity, C# Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario Freedom Coding 07 octubre 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,526 veces y le gustó 65 a los espectadores. Disfruta viendo!