Пример #1
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();
        }
Пример #2
0
        public static void GenerateTypeTree(TypeTreeContext context)
        {
            BehaviourLayout layout = context.Layout.Behaviour;

            ComponentLayout.GenerateTypeTree(context);
            context.AddByte(layout.EnabledName);
            if (layout.IsAlignEnabled)
            {
                context.Align();
            }
        }
Пример #3
0
        public static void GenerateTypeTree(TypeTreeContext context)
        {
            BehaviourLayout.GenerateTypeTree(context);

            MonoBehaviourLayout layout = context.Layout.MonoBehaviour;

            if (layout.HasEditorHideFlags)
            {
                context.AddUInt32(layout.EditorHideFlagsName);
            }
            if (layout.HasGeneratorAsset)
            {
                context.AddPPtr(context.Layout.Object.Name, layout.GeneratorAssetName);
            }
            context.AddPPtr(context.Layout.MonoScript.Name, layout.ScriptName);
            context.AddString(layout.NameName);
            if (layout.HasEditorClassIdentifier)
            {
                context.AddString(layout.EditorClassIdentifierName);
            }
        }
Пример #4
0
        public static void GenerateTypeTree(TypeTreeContext context, string name)
        {
            AnimationLayout layout = context.Layout.Animation;

            context.AddNode(layout.Name, name, layout.Version);
            context.BeginChildren();
            BehaviourLayout.GenerateTypeTree(context);
            context.AddPPtr(context.Layout.AnimationClip.Name, layout.AnimationName);
            if (layout.HasAnimations)
            {
                context.AddArray(layout.AnimationName, (c, n) => c.AddPPtr(c.Layout.AnimationClip.Name, n));
            }
            else
            {
                context.AddArray(layout.AnimationName, TupleLayout.GenerateTypeTree, StringLayout.GenerateTypeTree,
                                 (c, n) => c.AddPPtr(c.Layout.AnimationClip.Name, n));
            }

            context.AddInt32(layout.WrapModeName);
            context.AddBool(layout.PlayAutomaticallyName);
            context.AddBool(layout.AnimatePhysicsInvariantName);
            if (layout.HasAnimateOnlyIfVisible)
            {
                context.AddBool(layout.AnimateOnlyIfVisibleName);
            }
            if (layout.IsAlign)
            {
                context.Align();
            }

            if (layout.HasCullingType)
            {
                context.AddInt32(layout.CullingTypeName);
            }
            if (layout.HasUserAABB)
            {
                AABBLayout.GenerateTypeTree(context, layout.UserAABBName);
            }
            context.EndChildren();
        }