Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why does NetworkBehaviour EventDelegate require NetworkReader?

Discussion in 'Multiplayer' started by Stone-Legion, Jan 14, 2016.

  1. Stone-Legion

    Stone-Legion

    Joined:
    Aug 16, 2013
    Posts:
    112
    When using an EventDelegate in MonoBehaviour scripts I simply add the public method that I wish to be stored by the delegate. While using EventDelegate in a NetworkBehaviour script, it is forcing me to include a NetworkReader variable.

    Just curious, why does this force us to require NetworkReader? I get that a NetworkBehaviour script is for networking functionality but not entirely sure how to include the NetworkReader or why it is required for an EventDelegate that will only happen on a local machine. Likewise, doesn't seem worth it to create an entirely new script for one method that I want to store in a delegate for execution later.