Exemple #1
0
        private void loadObjectType(ObjectData data)
        {
            TypeNode         typeNode     = null;
            EmbeddedTypeInfo embeddedtype = null;

            if (typeTreeStruct.embeddedTypeMap.ContainsKey(data.typeID))
            {
                embeddedtype = typeTreeStruct.embeddedTypeMap[data.typeID];
                if (embeddedtype != null)
                {
                    typeNode = embeddedtype.typeTree;
                }
            }

            // get type from database if the embedded one is missing
            if (typeNode == null)
            {
                typeNode = TypeTreeUtils.getTypeNode(data.unityClass(),
                                                     versionInfo.unityRevision, false);
            }

            data.typeTree = typeNode;

            //// Add typeless objects to an internal list. They can't be
            //// (de)serialized, but can still be written to the file.
            //if (typeNode == null)
            //{
            //    // log warning if it's not a MonoBehaviour
            //    if (info.classID != 114)
            //    {
            //        //Logger.Log("{0} has no type information!" + data.ToString());
            //    }
            //    objectListBroken.Add(data);
            //}
            //else
            //{
            //    objectList.Add(data);
            //}
        }
Exemple #2
0
 public static TypeNode getTypeNode(ObjectData obj, bool strict)
 {
     return(TypeTreeUtils.getTypeNode(obj.unityClass(), obj.versionInfo.unityRevision, strict));
 }