Пример #1
0
        public static void GenerateTypeTree(TypeTreeContext context)
        {
            GameObjectLayout layout = context.Layout.GameObject;

            context.AddNode(layout.Name, TypeTreeUtils.BaseName);
            context.BeginChildren();
            ObjectLayout.GenerateTypeTree(context);
            if (layout.IsComponentTuple)
            {
                context.AddArray(layout.ComponentName, TupleLayout.GenerateTypeTree, Int32Layout.GenerateTypeTree,
                                 (c, n) => c.AddPPtr(c.Layout.Component.Name, n));
            }
            else
            {
                context.AddArray(layout.ComponentName, ComponentPairLayout.GenerateTypeTree);
            }
            if (layout.IsActiveFirst)
            {
                context.AddBool(layout.IsActiveName);
            }
            context.AddUInt32(layout.LayerName);
            if (layout.IsNameFirst)
            {
                context.AddString(layout.NameName);
            }
            if (layout.HasTag)
            {
                context.AddUInt16(layout.TagName);
            }
            if (layout.HasTagString)
            {
                context.AddString(layout.TagStringName);
            }
            if (layout.HasIcon && layout.IsIconFirst)
            {
                context.AddPPtr(context.Layout.Texture2D.Name, layout.IconName);
            }
            if (layout.HasNavMeshLayer)
            {
                context.AddUInt32(layout.NavMeshLayerName);
                context.AddUInt32(layout.StaticEditorFlagsName);
            }
            if (!layout.IsNameFirst)
            {
                context.AddString(layout.NameName);
            }
            if (!layout.IsActiveFirst)
            {
                context.AddBool(layout.IsActiveName);
            }
            if (layout.HasIsStatic)
            {
                context.AddBool(layout.IsStaticName);
            }
            if (layout.HasIcon && !layout.IsIconFirst)
            {
                context.AddPPtr(context.Layout.Texture2D.Name, layout.IconName);
            }
            context.EndChildren();
        }
Пример #2
0
        public AssetLayout(LayoutInfo info)
        {
            Info = info;

            IsAlign              = info.Version.IsGreaterEqual(2, 1);
            IsAlignArrays        = info.Version.IsGreaterEqual(2017);
            IsStructSerializable = info.Version.IsGreaterEqual(4, 5);

            PPtr = new PPtrLayout(info);

            Misc       = new MiscLayoutCategory(info);
            Serialized = new SerializedLayoutCategory(info);

            Animation       = new AnimationLayout(info);
            AnimationClip   = new AnimationClipLayout(info);
            Behaviour       = new BehaviourLayout(info);
            Component       = new ComponentLayout(info);
            EditorExtension = new EditorExtensionLayout(info);
            Font            = new FontLayout(info);
            GameObject      = new GameObjectLayout(info);
            MonoBehaviour   = new MonoBehaviourLayout(info);
            MonoScript      = new MonoScriptLayout(info);
            NamedObject     = new NamedObjectLayout(info);
            Object          = new ObjectLayout(info);
            Prefab          = new PrefabLayout(info);
            PrefabInstance  = new PrefabInstanceLayout(info);
            Texture2D       = new Texture2DLayout(info);
            Transform       = new TransformLayout(info);

            ClassNames = CreateClassNames();
        }