List <UnityObjectReference> GetValueInternal(object container, SerializationMetadata metadata)
        {
            var value = m_MemberInfo.GetValue(container);

            if (value == null)
            {
                return(null);
            }

            // Use typeless IList cast to support reflected private element types
            if (!(value is IList list))
            {
                return(null);
            }

            var result = new List <UnityObjectReference>(list.Count);

            foreach (var element in list)
            {
                if (!(element is UnityObject unityObject))
                {
                    result.Add(UnityObjectReference.NullObjectReference);
                    continue;
                }

                result.Add(UnityObjectReference.GetReferenceForObject(unityObject, metadata));
            }

            return(result);
        }
        public static UnityObject GetObject(UnityObjectReference objectReference, SerializationMetadata metadata)
        {
            var guid = objectReference.guid;

            if (!string.IsNullOrEmpty(guid))
            {
                return(GetAsset(guid, objectReference.fileId, metadata?.AssetPack));
            }

            var sceneId = objectReference.sceneID;

            return(sceneId == SerializationMetadata.InvalidID ? null : metadata?.GetSceneObject(sceneId));
        }
        static void PreserveAOT()
        {
            var container = new UnityObjectReference();

            new ComponentVisitor(default, default, default, default).AcceptProperty(ref container, default, default);