* Fix ??

?? doesn't work on unitys objects

* Update NetworkBehaviour.cs
This commit is contained in:
MichalPetryka 2019-05-04 11:30:45 +02:00 committed by vis2k
parent f618e17366
commit e22f527eef

View File

@ -39,7 +39,10 @@ public NetworkIdentity netIdentity
{
get
{
netIdentityCache = netIdentityCache ?? GetComponent<NetworkIdentity>();
if (netIdentityCache == null)
{
netIdentityCache = GetComponent<NetworkIdentity>()
}
if (netIdentityCache == null)
{
Debug.LogError("There is no NetworkIdentity on " + name + ". Please add one.");