UnityEngine.Networking.NetworkInstanceId.IsEmpty C# (CSharp) Method

IsEmpty() public method

Returns true if the value of the NetworkInstanceId is zero.

public IsEmpty ( ) : bool
return bool
        public bool IsEmpty()
        {
            return (this.m_Value == 0);
        }

Usage Example

コード例 #1
0
        public NetworkIdentity ReadNetworkIdentity()
        {
            NetworkInstanceId netId = ReadNetworkId();

            if (netId.IsEmpty())
            {
                return(null);
            }
            GameObject go;

            if (NetworkServer.active)
            {
                go = NetworkServer.FindLocalObject(netId);
            }
            else
            {
                go = ClientScene.FindLocalObject(netId);
            }
            if (go == null)
            {
                if (LogFilter.logDebug)
                {
                    Debug.Log("ReadNetworkIdentity netId:" + netId + "go: null");
                }
                return(null);
            }

            return(go.GetComponent <NetworkIdentity>());
        }
All Usage Examples Of UnityEngine.Networking.NetworkInstanceId::IsEmpty