Пример #1
0
        private static bool IsUserType(UnityFieldDefinition fieldDefinition)
        {
            if (fieldDefinition.IsList || fieldDefinition.IsMap || fieldDefinition.IsOption)
            {
                return(false);
            }

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

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

            return(blittableTypeMap[fieldDefinition.RawFieldDefinition.singularType.userType]);
        }
Пример #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]);
        }