public static void GenerateTypeTree(TypeTreeContext context, string name) { QuaternionCurveLayout layout = context.Layout.AnimationClip.QuaternionCurve; context.AddNode(layout.Name, name); context.BeginChildren(); AnimationCurveTplLayout.GenerateTypeTree(context, layout.CurveName, QuaternionfLayout.GenerateTypeTree); context.AddString(layout.PathName); context.EndChildren(); }
public static void GenerateTypeTree(TypeTreeContext context, string name) { FloatCurveLayout layout = context.Layout.AnimationClip.FloatCurve; context.AddNode(layout.Name, name); context.BeginChildren(); AnimationCurveTplLayout.GenerateTypeTree(context, name, SingleLayout.GenerateTypeTree); context.AddString(layout.AttributeName); context.AddString(layout.PathName); context.AddNode(TypeTreeUtils.TypeStarName, layout.ClassIDName, 1, sizeof(int)); context.AddPPtr(context.Layout.MonoScript.Name, layout.ScriptName); context.EndChildren(); }
public void Read(AssetReader reader) { AnimationCurveTplLayout layout = reader.Layout.Serialized.AnimationCurveTpl; Curve = reader.ReadAssetArray <KeyframeTpl <T> >(); reader.AlignStream(); PreInfinity = (CurveLoopTypes)reader.ReadInt32(); PostInfinity = (CurveLoopTypes)reader.ReadInt32(); if (layout.HasRotationOrder) { RotationOrder = (RotationOrder)reader.ReadInt32(); } }
public void Write(AssetWriter writer) { AnimationCurveTplLayout layout = writer.Layout.Serialized.AnimationCurveTpl; Curve.Write(writer); writer.AlignStream(); writer.Write((int)PreInfinity); writer.Write((int)PostInfinity); if (layout.HasRotationOrder) { writer.Write((int)RotationOrder); } }
public static AnimationCurveTpl <T> Convert <T>(IExportContainer container, ref AnimationCurveTpl <T> origin) where T : struct, IAsset { AnimationCurveTplLayout exlayout = container.ExportLayout.Serialized.AnimationCurveTpl; AnimationCurveTpl <T> instance = new AnimationCurveTpl <T>(); instance.Curve = origin.Curve.Select(t => t.Convert(container)).ToArray(); instance.PreInfinity = origin.PreInfinity; instance.PostInfinity = origin.PostInfinity; if (exlayout.HasRotationOrder) { instance.RotationOrder = GetRotationOrder(container, ref origin); } return(instance); }
public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); AnimationCurveTplLayout layout = container.ExportLayout.Serialized.AnimationCurveTpl; node.AddSerializedVersion(layout.Version); node.Add(layout.CurveName, Curve.ExportYAML(container)); node.Add(layout.PreInfinityName, (int)PreInfinity); node.Add(layout.PostInfinityName, (int)PostInfinity); if (layout.HasRotationOrder) { node.Add(layout.RotationOrderName, (int)GetExportRotationOrder(layout)); } return(node); }
public SerializedLayoutCategory(LayoutInfo info) { AABB = new AABBLayout(info); AABBi = new AABBiLayout(info); AnimationCurveTpl = new AnimationCurveTplLayout(info); ColorRGBA32 = new ColorRGBA32Layout(info); ColorRGBAf = new ColorRGBAfLayout(info); Gradient = new GradientLayout(info); GUIStyle = new GUIStyleLayout(info); LayerMask = new LayerMaskLayout(info); Matrix4x4f = new Matrix4x4fLayout(info); Quaternionf = new QuaternionfLayout(info); Rectf = new RectfLayout(info); RectOffset = new RectOffsetLayout(info); Vector2f = new Vector2fLayout(info); Vector2i = new Vector2iLayout(info); Vector3f = new Vector3fLayout(info); Vector3i = new Vector3iLayout(info); Vector4f = new Vector4fLayout(info); }
private RotationOrder GetExportRotationOrder(AnimationCurveTplLayout layout) { return(layout.HasRotationOrder ? RotationOrder : RotationOrder.OrderZXY); }
private static void GenerateEngineStruct(TypeTreeContext context, SerializableType origin, string name) { switch (origin.Name) { case SerializableType.Vector2Name: Vector2fLayout.GenerateTypeTree(context, name); break; case SerializableType.Vector2IntName: Vector2iLayout.GenerateTypeTree(context, name); break; case SerializableType.Vector3Name: Vector3fLayout.GenerateTypeTree(context, name); break; case SerializableType.Vector3IntName: Vector3iLayout.GenerateTypeTree(context, name); break; case SerializableType.Vector4Name: Vector4fLayout.GenerateTypeTree(context, name); break; case SerializableType.RectName: RectfLayout.GenerateTypeTree(context, name); break; case SerializableType.BoundsName: AABBLayout.GenerateTypeTree(context, name); break; case SerializableType.BoundsIntName: AABBiLayout.GenerateTypeTree(context, name); break; case SerializableType.QuaternionName: QuaternionfLayout.GenerateTypeTree(context, name); break; case SerializableType.Matrix4x4Name: Matrix4x4fLayout.GenerateTypeTree(context, name); break; case SerializableType.ColorName: ColorRGBAfLayout.GenerateTypeTree(context, name); break; case SerializableType.Color32Name: ColorRGBA32Layout.GenerateTypeTree(context, name); break; case SerializableType.LayerMaskName: LayerMaskLayout.GenerateTypeTree(context, name); break; case SerializableType.AnimationCurveName: AnimationCurveTplLayout.GenerateTypeTree(context, name, SingleLayout.GenerateTypeTree); break; case SerializableType.GradientName: GradientLayout.GenerateTypeTree(context, name); break; case SerializableType.RectOffsetName: RectOffsetLayout.GenerateTypeTree(context, name); break; case SerializableType.GUIStyleName: GUIStyleLayout.GenerateTypeTree(context, name); break; case SerializableType.PropertyNameName: PropertyNameLayout.GenerateTypeTree(context, name); break; default: throw new Exception($"Unknown engine struct {origin.Name}"); } }