Ejemplo n.º 1
0
 public static void GenerateTypeTree(TypeTreeContext context, string name)
 {
     context.AddNode(nameof(Prefab), name);
     context.BeginChildren();
     Object.GenerateTypeTree(context);
     context.AddPPtr(nameof(GameObject), RootGameObjectName);
     context.EndChildren();
 }
Ejemplo n.º 2
0
        public static void GenerateTypeTree(TypeTreeContext context, string name)
        {
            string className = GetPrefabInstanceName(context.Version);

            context.AddNode(className, name, 0, ToSerializedVersion(context.Version));
            context.BeginChildren();
            if (IsModificationsFormat(context.Version))
            {
                Object.GenerateTypeTree(context);

                bool hasRootGameObject     = IsRootGameObjectRelevant(context.Flags);
                bool isRootGameObjectFirst = IsRootGameObjectFirst(context.Version);
                if (hasRootGameObject && isRootGameObjectFirst)
                {
                    context.AddPPtr(nameof(GameObject), RootGameObjectName);
                }

                PrefabModification.GenerateTypeTree(context, ModificationName);
                context.AddPPtr(className, GetSourcePrefabName(context.Version));
                if (hasRootGameObject && !isRootGameObjectFirst)
                {
                    context.AddPPtr(nameof(GameObject), RootGameObjectName);
                }
                if (IsPrefabAssetRelevant(context.Version))
                {
                    context.AddBool(GetIsPrefabAssetName(context.Version));
                }
                if (IsExplodedRelevant(context.Version))
                {
                    context.AddBool(IsExplodedName);
                }
                context.Align();
            }
            else
            {
                GUID.GenerateTypeTree(context, LastMergeIdentifierName);
                if (HasLastTemplateIdentifier(context.Version))
                {
                    GUID.GenerateTypeTree(context, LastTemplateIdentifierName);
                }
                context.AddArray(ObjectsName, PPtr <EditorExtension> .GenerateTypeTree);
                context.AddPPtr(className, FatherName);
                context.AddBool(IsDataTemplateName, TransferMetaFlags.AlignBytesFlag);
                NamedObject.GenerateTypeTree(context);
            }
            context.EndChildren();
        }
Ejemplo n.º 3
0
 protected new static void GenerateTypeTree(TypeTreeContext context)
 {
     Object.GenerateTypeTree(context);
     if (HasEditorPtrs(context.Flags))
     {
         if (HasCorrespondingSourceObject(context.Version, context.Flags))
         {
             context.AddPPtr(nameof(EditorExtension), CorrespondingSourceObjectName);
             context.AddPPtr(Classes.PrefabInstance.GetPrefabInstanceName(context.Version), PrefabInstanceName);
         }
         else
         {
             context.AddPPtr(nameof(Object), ExtensionPtrName);
         }
         if (HasPrefabAsset(context.Version, context.Flags))
         {
             context.AddPPtr(nameof(Prefab), PrefabAssetName);
         }
     }
 }