Exemple #1
0
        private static bool IsUserType(UnityFieldDefinition fieldDefinition)
        {
            if (fieldDefinition.IsList || fieldDefinition.IsMap || fieldDefinition.IsOption)
            {
                return(false);
            }

            return(!fieldDefinition.RawFieldDefinition.singularType.IsBuiltInType);
        }
Exemple #2
0
        private static bool IsBuiltInBlittableType(UnityFieldDefinition fieldDefinition)
        {
            if (fieldDefinition.IsList || fieldDefinition.IsMap || fieldDefinition.IsOption)
            {
                return(false);
            }

            return(!nonBlittableSchemaBuiltInTypes.Contains(fieldDefinition.RawFieldDefinition.singularType
                                                            .builtInType));
        }
Exemple #3
0
        private static bool CanBlitFieldOfComponent(UnityFieldDefinition fieldDefinition,
                                                    Dictionary <string, bool> blittableTypeMap)
        {
            if (!IsUserType(fieldDefinition))
            {
                return(IsBuiltInBlittableType(fieldDefinition));
            }

            return(blittableTypeMap[fieldDefinition.RawFieldDefinition.singularType.userType]);
        }
Exemple #4
0
        private static bool CanBlitFieldOfTypeRecursively(UnityFieldDefinition fieldDefinition,
                                                          Dictionary <string, bool> blittableTypeMap, Dictionary <string, UnityTypeDefinition> unvisited)
        {
            if (!IsUserType(fieldDefinition))
            {
                return(IsBuiltInBlittableType(fieldDefinition));
            }

            var fieldTypeString = fieldDefinition.RawFieldDefinition.singularType.userType;

            if (!blittableTypeMap.ContainsKey(fieldTypeString))
            {
                return(ApplyBlittableMarkerToTypeRecursively(unvisited[fieldTypeString], blittableTypeMap, unvisited));
            }

            return(blittableTypeMap[fieldTypeString]);
        }