UnityEditor.NetworkManagerEditor.DrawChild C# (CSharp) Method

DrawChild() private method

private DrawChild ( Rect r, int index, bool isActive, bool isFocused ) : void
r UnityEngine.Rect
index int
isActive bool
isFocused bool
return void
        internal void DrawChild(Rect r, int index, bool isActive, bool isFocused)
        {
            GUIContent content;
            SerializedProperty arrayElementAtIndex = this.m_SpawnListProperty.GetArrayElementAtIndex(index);
            GameObject objectReferenceValue = (GameObject) arrayElementAtIndex.objectReferenceValue;
            if (objectReferenceValue == null)
            {
                content = new GUIContent("Empty", "Drag a prefab with a NetworkIdentity here");
            }
            else
            {
                NetworkIdentity component = objectReferenceValue.GetComponent<NetworkIdentity>();
                if (component != null)
                {
                    content = new GUIContent(objectReferenceValue.name, "AssetId: [" + component.assetId + "]");
                }
                else
                {
                    content = new GUIContent(objectReferenceValue.name, "No Network Identity");
                }
            }
            GameObject obj3 = (GameObject) EditorGUI.ObjectField(r, content, objectReferenceValue, typeof(GameObject), false);
            if (obj3 != objectReferenceValue)
            {
                if ((obj3 != null) && (obj3.GetComponent<NetworkIdentity>() == null))
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Prefab " + obj3 + " cannot be added as spawnable as it doesn't have a NetworkIdentity.");
                    }
                }
                else
                {
                    arrayElementAtIndex.objectReferenceValue = obj3;
                }
            }
        }