private void AssignObjectReferenceFromScene(SerializedProperty property)
            {
                var targetType = GetSerializedPropertyTarget.From(property);

                property.objectReferenceValue = GameObject.FindObjectOfType(targetType);
                property.serializedObject.ApplyModifiedProperties();
            }
Exemple #2
0
            private void AssignObjectFieldFromChildren(SerializedProperty property)
            {
                var targetType   = GetSerializedPropertyTarget.From(property);
                var targetObject = property.serializedObject.targetObject as Component;

                property.objectReferenceValue = targetObject.GetComponentInChildren(targetType);
                property.serializedObject.ApplyModifiedProperties();
            }