Search Unity

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:
    12
    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

    Joined:
    Sep 30, 2020
    Posts:
    306