UnityEditor.SerializedObject.GetIterator C# (CSharp) Method

GetIterator() public method

Get the first serialized property.

public GetIterator ( ) : UnityEditor.SerializedProperty
return UnityEditor.SerializedProperty
        public SerializedProperty GetIterator()
        {
            SerializedProperty property = this.GetIterator_Internal();
            property.m_SerializedObject = this;
            return property;
        }

Usage Example

示例#1
6
	private static void FindMissingReferences(string context, GameObject[] objects)
	{
		foreach (var go in objects)
		{
			var components = go.GetComponents<Component>();

			foreach (var c in components)
			{
				if (!c)
				{
					Debug.LogError("Missing Component in GO: " + FullPath(go), go);
					continue;
				}

				SerializedObject so = new SerializedObject(c);
				var sp = so.GetIterator();

				while (sp.NextVisible(true))
				{
					if (sp.propertyType == SerializedPropertyType.ObjectReference)
					{
						if (sp.objectReferenceValue == null
						    && sp.objectReferenceInstanceIDValue != 0)
						{
							ShowError(context, go, c.GetType().Name, ObjectNames.NicifyVariableName(sp.name));
						}
					}
				}
			}
		}
	}
All Usage Examples Of UnityEditor.SerializedObject::GetIterator