3 Observer
Albin Corén редактировал(а) эту страницу 2018-07-24 15:10:41 +02:00

This documentation is outdated.

The Observer system is a replication of UNET HLAPI's Observer system. It allows for large world objects to be cheaply synchronized. The observer system allows you to set "observers" on a per object basis. This means that you can highly optimize your code to only send messages to observers.

Each Send overload has an optional boolean called respectObservers, it defaults to false. If it's set to true, the message will only be sent if the client(s) it's being sent to is an observer of the sender NetworkedObject. This can greatly optimize your game as long as you properly update the observer lists.

The MLAPI has a prototype component called NetworkedProximity which is a port of the HLAPI's NetworkedProximityChecker. It uses distance checking and is a great example and starting point for the topic.