From the course: Unity: AR Visualization 03 Complex Interactivity
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating a message handler - Unity Tutorial
From the course: Unity: AR Visualization 03 Complex Interactivity
Creating a message handler
- [Instructor] Now that we've got our connection all set up messages are going to be flying fast and furious. Let's learn how to deal with them. Double click on the network manager, now the best way to deal with messages is to aggregate them all into a list and deal with them once per update loop. So I'm going to need a list of messages. Let's go create that under username. I'm going to create a private list I'll type message. We're going to call this messages. I'm going to initialize it. Great. Now I'm going to go down to my message handler and I'm going to add it to the stack. So messages.Add and grab my message. Excellent. Now I'm going to add a method to process my messages. Just underneath disconnect I'm going to add a private void I'm going to call this process messages. All right. So what I'm going to do here is iterate through all the messages I receive and then when I'm done I'm going to clear. So I'm…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Create sync UI, state, and methods5m 45s
-
(Locked)
Creating your network manager5m 48s
-
(Locked)
Connecting to PlayerIO7m 42s
-
(Locked)
Starting a multiplayer connection5m 27s
-
(Locked)
Testing your multiplayer connection5m 51s
-
(Locked)
Creating a message handler6m 30s
-
(Locked)
Processing the join message4m 41s
-
(Locked)
Working with world state3m 51s
-
(Locked)
Sending hide messages10m 34s
-
(Locked)
Making your parts relative7m 35s
-
(Locked)
Syncing movement4m 39s
-
(Locked)
Syncing the addition of notes5m 44s
-
(Locked)
Syncing the deletion of notes6m 39s
-
AR app in action2m 9s
-
(Locked)
-