Skip to content

Commit 8c70dc4

Browse files
committed
u
1 parent 769ec1b commit 8c70dc4

File tree

2 files changed

+10
-70
lines changed

2 files changed

+10
-70
lines changed
Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#nullable disable
2-
3-
using MemoryPack;
1+
using MemoryPack;
42
using System.Collections;
53
using System.Collections.Generic;
64
using UnityEngine;
@@ -22,60 +20,3 @@ public partial class MyPerson
2220
public int Age { get; set; }
2321
public string Name { get; set; }
2422
}
25-
26-
#nullable enable
27-
28-
[MemoryPackable]
29-
public readonly partial struct SerializableAnimationCurve
30-
{
31-
[MemoryPackIgnore]
32-
public readonly AnimationCurve AnimationCurve;
33-
34-
[MemoryPackInclude]
35-
WrapMode preWrapMode => AnimationCurve.preWrapMode;
36-
[MemoryPackInclude]
37-
WrapMode postWrapMode => AnimationCurve.postWrapMode;
38-
[MemoryPackInclude]
39-
Keyframe[] keys => AnimationCurve.keys;
40-
41-
[MemoryPackConstructor]
42-
SerializableAnimationCurve(WrapMode preWrapMode, WrapMode postWrapMode, Keyframe[] keys)
43-
{
44-
var curve = new AnimationCurve(keys);
45-
curve.preWrapMode = preWrapMode;
46-
curve.postWrapMode = postWrapMode;
47-
this.AnimationCurve = curve;
48-
}
49-
50-
public SerializableAnimationCurve(AnimationCurve animationCurve)
51-
{
52-
this.AnimationCurve = animationCurve;
53-
}
54-
}
55-
56-
public class AnimationCurveFormatter : MemoryPackFormatter<AnimationCurve>
57-
{
58-
// Unity does not support scoped and TBufferWriter so change signature to `Serialize(ref MemoryPackWriter writer, ref AnimationCurve value)`
59-
public override void Serialize(ref MemoryPackWriter writer, scoped ref AnimationCurve? value)
60-
{
61-
if (value == null)
62-
{
63-
writer.WriteNullObjectHeader();
64-
return;
65-
}
66-
67-
writer.WritePackable(new SerializableAnimationCurve(value));
68-
}
69-
70-
public override void Deserialize(ref MemoryPackReader reader, scoped ref AnimationCurve? value)
71-
{
72-
if (reader.PeekIsNull())
73-
{
74-
value = null;
75-
return;
76-
}
77-
78-
var wrapped = reader.ReadPackable<SerializableAnimationCurve>();
79-
value = wrapped.AnimationCurve;
80-
}
81-
}

src/MemoryPack.Unity/UserSettings/Layouts/default-2021.dwlt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ MonoBehaviour:
9797
m_MinSize: {x: 310, y: 221}
9898
m_MaxSize: {x: 4000, y: 4021}
9999
vertical: 0
100-
controlID: 112
100+
controlID: 174
101101
--- !u!114 &5
102102
MonoBehaviour:
103103
m_ObjectHideFlags: 52
@@ -175,7 +175,7 @@ MonoBehaviour:
175175
m_MinSize: {x: 300, y: 300}
176176
m_MaxSize: {x: 24288, y: 24288}
177177
vertical: 0
178-
controlID: 17
178+
controlID: 167
179179
--- !u!114 &8
180180
MonoBehaviour:
181181
m_ObjectHideFlags: 52
@@ -324,7 +324,7 @@ MonoBehaviour:
324324
m_MinSize: {x: 100, y: 300}
325325
m_MaxSize: {x: 8096, y: 24288}
326326
vertical: 1
327-
controlID: 174
327+
controlID: 245
328328
--- !u!114 &14
329329
MonoBehaviour:
330330
m_ObjectHideFlags: 52
@@ -447,22 +447,21 @@ MonoBehaviour:
447447
m_ShowAllHits: 0
448448
m_SkipHidden: 0
449449
m_SearchArea: 1
450-
m_Folders:
451-
- Assets/Plugins
450+
m_Folders: []
452451
m_Globs: []
453452
m_OriginalText:
454453
m_ViewMode: 0
455454
m_StartGridSize: 64
456455
m_LastFolders: []
457456
m_LastFoldersGridSize: -1
458-
m_LastProjectPath: C:\Users\S04451\Documents\GitHub\MemoryPack\src\MemoryPack.Unity
457+
m_LastProjectPath: C:\Users\owner\source\repos\MemoryPack\src\MemoryPack.Unity
459458
m_LockTracker:
460459
m_IsLocked: 0
461460
m_FolderTreeState:
462461
scrollPos: {x: 0, y: 0}
463462
m_SelectedIDs: 38600000
464463
m_LastClickedID: 24632
465-
m_ExpandedIDs: 00000000586000005a6000005c600000
464+
m_ExpandedIDs: 000000003a5f000000ca9a3bffffff7f
466465
m_RenameOverlay:
467466
m_UserAcceptedRename: 0
468467
m_Name:
@@ -490,7 +489,7 @@ MonoBehaviour:
490489
scrollPos: {x: 0, y: 0}
491490
m_SelectedIDs:
492491
m_LastClickedID: 0
493-
m_ExpandedIDs: ffffffff0000000058600000cc600000
492+
m_ExpandedIDs: ffffffff000000003a5f000000ca9a3bffffff7f
494493
m_RenameOverlay:
495494
m_UserAcceptedRename: 0
496495
m_Name:
@@ -618,9 +617,9 @@ MonoBehaviour:
618617
m_SceneHierarchy:
619618
m_TreeViewState:
620619
scrollPos: {x: 0, y: 0}
621-
m_SelectedIDs: 90600000
620+
m_SelectedIDs:
622621
m_LastClickedID: 0
623-
m_ExpandedIDs: 14fbffff
622+
m_ExpandedIDs: a4faffff
624623
m_RenameOverlay:
625624
m_UserAcceptedRename: 0
626625
m_Name:

0 commit comments

Comments
 (0)