GetString() private static method

private static GetString ( string name, string value ) : NetworkIdentityInfo
name string
value string
return NetworkIdentityInfo
Beispiel #1
0
 private void GetNetworkInformation(GameObject gameObject)
 {
     this.m_Identity = gameObject.GetComponent <NetworkIdentity>();
     if (!((Object)this.m_Identity != (Object)null))
     {
         return;
     }
     this.m_Info = new List <NetworkInformationPreview.NetworkIdentityInfo>();
     this.m_Info.Add(this.GetAssetId());
     this.m_Info.Add(NetworkInformationPreview.GetString("Scene ID", this.m_Identity.sceneId.ToString()));
     if (!Application.isPlaying)
     {
         return;
     }
     this.m_Info.Add(NetworkInformationPreview.GetString("Network ID", this.m_Identity.netId.ToString()));
     this.m_Info.Add(NetworkInformationPreview.GetString("Player Controller ID", this.m_Identity.playerControllerId.ToString()));
     this.m_Info.Add(NetworkInformationPreview.GetBoolean("Is Client", this.m_Identity.isClient));
     this.m_Info.Add(NetworkInformationPreview.GetBoolean("Is Server", this.m_Identity.isServer));
     this.m_Info.Add(NetworkInformationPreview.GetBoolean("Has Authority", this.m_Identity.hasAuthority));
     this.m_Info.Add(NetworkInformationPreview.GetBoolean("Is Local Player", this.m_Identity.isLocalPlayer));
     NetworkBehaviour[] components = gameObject.GetComponents <NetworkBehaviour>();
     if (components.Length <= 0)
     {
         return;
     }
     this.m_Behaviours = new List <NetworkInformationPreview.NetworkBehaviourInfo>();
     foreach (NetworkBehaviour networkBehaviour in components)
     {
         this.m_Behaviours.Add(new NetworkInformationPreview.NetworkBehaviourInfo()
         {
             name      = new GUIContent(networkBehaviour.GetType().FullName),
             behaviour = networkBehaviour
         });
     }
 }
Beispiel #2
0
        private NetworkInformationPreview.NetworkIdentityInfo GetAssetId()
        {
            string str = this.m_Identity.assetId.ToString();

            if (string.IsNullOrEmpty(str))
            {
                str = "<object has no prefab>";
            }
            return(NetworkInformationPreview.GetString("Asset ID", str));
        }