コード例 #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]);
        }