C# Events in Unity

Опубликовано: 13 Октябрь 2023
на канале: XR Terra Class
31
3

This video explains how you can create your own custom events and subscribe functions to them from your C# scripts in Unity. Using an event system can help you when writing manager scripts and lets you avoid needing a reference to every component that needs to react to an event in your scene.

XRTerra Links:
Programs and Courses: http://www.xrterra.com/programs
Newsletter Signup: https://www.xrterra.com/mailing-list-...

00:00 Introducing Events
01:41 How to declare events
03:19 Remember to unsubscribe
04:02 Setting up a looping timer
06:07 Declaring and invoking the event
06:52 Null reference error
07:25 Creating Cube subscriber
07:52 Subscribing to event
09:06 Unsubscribing OnDestroy()
09:48 Testing move up cube event
10:13 Subscribing a second cube
12:22 Passing a parameter through the event
13:14 Subscription parameter mismatch
14:09 Testing out passed parameter

Instructor: Gregory Osborne


Смотрите видео C# Events in Unity онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь XR Terra Class 13 Октябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 31 раз и оно понравилось 3 людям.