Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

NetworkVariableBase.m_NetworkBehaviour should be protected instead of private protected

Discussion in 'Netcode for GameObjects' started by cajphrase, May 5, 2022.

  1. cajphrase

    cajphrase

    Joined:
    Apr 24, 2021
    Posts:
    9
    See post title.
    The built-in NetworkVariable has a use for the m_NetworkBehaviour so the creators obviously see a need to have the variable protected. However I'm not sure why this would need to be private - I'm trying to make use of access to the host NetworkBehaviour in a custom NetworkVariable I am implementing but can't access it due to the private modifier.
     
  2. luke-unity

    luke-unity

    Unity Technologies

    Joined:
    Sep 30, 2020
    Posts:
    306