mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
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:
parent
1d3b3fcca9
commit
7775801625
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user