public Prefab(AssetInfo assetInfo) : base(assetInfo) { Modification = new PrefabModification(AssetsFile); ParentPrefab = new PPtr <Prefab>(AssetsFile); RootGameObject = new PPtr <GameObject>(AssetsFile); ThisPrefab = new InnerPPtr <Prefab>(this); }
public Prefab(GameObject root) : base(CreateAssetsInfo(root)) { Modification = new PrefabModification(AssetsFile); ParentPrefab = new PPtr <Prefab>(AssetsFile); RootGameObject = new PPtr <GameObject>(root); ThisPrefab = new InnerPPtr <Prefab>(this); IsPrefabParent = true; ObjectHideFlags = 1; if (Config.IsGenerateGUIDByContent) { CalculatePrefabHash(); } }
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(); }
public PrefabInstance(AssetLayout layout) : base(layout) { Objects = Array.Empty <PPtr <EditorExtension> >(); Modification = new PrefabModification(layout); }
public PrefabInstance(Version version) : base(version) { Objects = Array.Empty <PPtr <EditorExtension> >(); Modification = new PrefabModification(version); }