Follow naming conventions in NetworkBehaviour m_NetIdentity (#760)

* Follow naming conventions in NetworkBehaviour m_NetIdentity

* Use underscore prefix as per vis' suggestion

* renamed to netIdentityCache
This commit is contained in:
rodolphito 2019-04-08 00:42:47 -07:00 committed by vis2k
parent 1d3b3fcca9
commit 7775801625

View File

@ -34,17 +34,17 @@ public class NetworkBehaviour : MonoBehaviour
protected readonly List<SyncObject> syncObjects = new List<SyncObject>();
// NetworkIdentity component caching for easier access
NetworkIdentity m_netIdentity;
NetworkIdentity netIdentityCache;
public NetworkIdentity netIdentity
{
get
{
m_netIdentity = m_netIdentity ?? GetComponent<NetworkIdentity>();
if (m_netIdentity == null)
netIdentityCache = netIdentityCache ?? GetComponent<NetworkIdentity>();
if (netIdentityCache == null)
{
Debug.LogError("There is no NetworkIdentity on " + name + ". Please add one.");
}
return m_netIdentity;
return netIdentityCache;
}
}