Skip to content

Commit 702092c

Browse files
authored
AnimationCurve (#7)
* builder of `AnimationCurve` * update version
1 parent fc137c1 commit 702092c

File tree

9 files changed

+108
-17
lines changed

9 files changed

+108
-17
lines changed

Assets/Example.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Blob;
3+
using Unity.Animation;
34
using Unity.Entities;
45
using Unity.Mathematics;
56
using UnityEngine;
@@ -27,4 +28,5 @@ public struct ExampleBlob
2728
public BlobPtr<long> LongPtr;
2829
public Guid Guid;
2930
[CustomBuilder(typeof(ObjectName))] public BlobString GameObjectName;
31+
public AnimationCurveBlob AnimationCurve;
3032
}

Assets/Scenes/SampleScene.unity

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ MonoBehaviour:
685685
- LongPtr
686686
- Guid
687687
- GameObjectName
688+
- AnimationCurve
688689
Builders:
689690
- id: 0
690691
- id: 1
@@ -694,6 +695,7 @@ MonoBehaviour:
694695
- id: 5
695696
- id: 6
696697
- id: 7
698+
- id: 8
697699
references:
698700
version: 1
699701
00000000:
@@ -715,20 +717,20 @@ MonoBehaviour:
715717
type: {class: double2ArrayBuilder, ns: Blob.Mathematics, asm: Blob.Builder}
716718
data:
717719
Value:
718-
- id: 8
719720
- id: 9
721+
- id: 10
720722
00000004:
721723
type: {class: StringArrayBuilder, ns: Blob, asm: Blob.Builder}
722724
data:
723725
Value:
724-
- id: 10
725726
- id: 11
726727
- id: 12
728+
- id: 13
727729
00000005:
728730
type: {class: Int64PtrBuilder, ns: Blob.Primitive, asm: Blob.Builder}
729731
data:
730732
Value:
731-
id: 13
733+
id: 14
732734
00000006:
733735
type: {class: GuidBuilder, ns: , asm: Assembly-CSharp}
734736
data:
@@ -738,30 +740,57 @@ MonoBehaviour:
738740
data:
739741
GameObject: {fileID: 1805661907}
740742
00000008:
743+
type: {class: AnimationCurveBlobBuilder, ns: Blob, asm: Blob.Builder}
744+
data:
745+
Value:
746+
serializedVersion: 2
747+
m_Curve:
748+
- serializedVersion: 3
749+
time: 0
750+
value: 0
751+
inSlope: 2
752+
outSlope: 2
753+
tangentMode: 0
754+
weightedMode: 0
755+
inWeight: 0
756+
outWeight: 0
757+
- serializedVersion: 3
758+
time: 1
759+
value: 1
760+
inSlope: 0
761+
outSlope: 0
762+
tangentMode: 0
763+
weightedMode: 0
764+
inWeight: 0
765+
outWeight: 0
766+
m_PreInfinity: 2
767+
m_PostInfinity: 2
768+
m_RotationOrder: 4
769+
00000009:
741770
type: {class: double2Builder, ns: Blob.Mathematics, asm: Blob.Builder}
742771
data:
743772
Value:
744773
x: 6
745774
y: 7
746-
00000009:
775+
0000000A:
747776
type: {class: double2Builder, ns: Blob.Mathematics, asm: Blob.Builder}
748777
data:
749778
Value:
750779
x: 8
751780
y: 9
752-
0000000A:
781+
0000000B:
753782
type: {class: StringBuilder, ns: Blob, asm: Blob.Builder}
754783
data:
755784
Value: 111111
756-
0000000B:
785+
0000000C:
757786
type: {class: StringBuilder, ns: Blob, asm: Blob.Builder}
758787
data:
759788
Value: 222222
760-
0000000C:
789+
0000000D:
761790
type: {class: StringBuilder, ns: Blob, asm: Blob.Builder}
762791
data:
763792
Value: 333333
764-
0000000D:
793+
0000000E:
765794
type: {class: Int64Builder, ns: Blob.Primitive, asm: Blob.Builder}
766795
data:
767796
Value: 456778

Packages/blob-editor/Editor/Drawer/BlobDataBuilderDrawer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32
using System.Reflection;
43
using UnityEditor;
54
using UnityEngine;

Packages/blob-editor/Runtime/Blob.Builder.asmdef

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"rootNamespace": "Blob.Builder",
44
"references": [
55
"GUID:734d92eba21c94caba915361bd5ac177",
6-
"GUID:d8b63aba1907145bea998dd612889d6b"
6+
"GUID:d8b63aba1907145bea998dd612889d6b",
7+
"GUID:39174d49d2befe84d9c54bf8b8d32755",
8+
"GUID:cf3547b97f3ec664f9eca740d393c07c"
79
],
810
"includePlatforms": [],
911
"excludePlatforms": [],
@@ -17,6 +19,11 @@
1719
"name": "com.unity.mathematics",
1820
"expression": "1.0.1",
1921
"define": "ENABLE_UNITY_MATHEMATICS"
22+
},
23+
{
24+
"name": "com.unity.animation",
25+
"expression": "0.7.1-preview.2",
26+
"define": "ENABLE_UNITY_ANIMATION"
2027
}
2128
],
2229
"noEngineReferences": false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#if ENABLE_UNITY_ANIMATION
2+
3+
using Unity.Animation;
4+
using Unity.Animation.Hybrid;
5+
using Unity.Entities;
6+
using AnimationCurve = UnityEngine.AnimationCurve;
7+
8+
namespace Blob
9+
{
10+
public class AnimationCurveBlobBuilder : Builder<AnimationCurveBlob>
11+
{
12+
public AnimationCurve Value;
13+
public override void Build(BlobBuilder builder, ref AnimationCurveBlob data)
14+
{
15+
CurveConversion.FillAnimationCurveBlob(Value, ref builder, ref data);
16+
}
17+
}
18+
}
19+
20+
#endif

Packages/blob-editor/Runtime/Builder/AnimationCurveBlobBuilder.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/blob-editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.quabug.blob-editor",
33
"description": "Inspector-editor of blob asset",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"unity": "2020.3",
66
"displayName": "BlobEditor",
77
"dependencies": {

Packages/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"dependencies": {
3+
"com.unity.animation": "0.7.1-preview.2",
34
"com.unity.ide.rider": "2.0.7",
45
"com.unity.ide.visualstudio": "2.0.9",
56
"com.unity.ide.vscode": "1.2.3",

Packages/packages-lock.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,26 @@
88
"com.unity.entities": "0.14.0-preview.19"
99
}
1010
},
11+
"com.unity.animation": {
12+
"version": "0.7.1-preview.2",
13+
"depth": 0,
14+
"source": "registry",
15+
"dependencies": {
16+
"com.unity.mathematics": "1.2.1",
17+
"com.unity.entities": "0.14.0-preview.19",
18+
"com.unity.collections": "0.12.0-preview.13",
19+
"com.unity.jobs": "0.5.0-preview.14",
20+
"com.unity.burst": "1.3.2",
21+
"com.unity.test-framework": "1.1.13",
22+
"com.unity.dataflowgraph": "0.17.0-preview.4",
23+
"com.unity.test-framework.performance": "2.0.8-preview",
24+
"com.unity.modules.animation": "1.0.0"
25+
},
26+
"url": "https://packages.unity.com"
27+
},
1128
"com.unity.burst": {
1229
"version": "1.3.2",
13-
"depth": 2,
30+
"depth": 1,
1431
"source": "registry",
1532
"dependencies": {
1633
"com.unity.mathematics": "1.1.0"
@@ -19,14 +36,27 @@
1936
},
2037
"com.unity.collections": {
2138
"version": "0.12.0-preview.13",
22-
"depth": 2,
39+
"depth": 1,
2340
"source": "registry",
2441
"dependencies": {
2542
"com.unity.test-framework.performance": "2.3.1-preview",
2643
"com.unity.burst": "1.3.2"
2744
},
2845
"url": "https://packages.unity.com"
2946
},
47+
"com.unity.dataflowgraph": {
48+
"version": "0.17.0-preview.4",
49+
"depth": 1,
50+
"source": "registry",
51+
"dependencies": {
52+
"com.unity.entities": "0.11.1-preview.4",
53+
"com.unity.jobs": "0.2.10-preview.12",
54+
"com.unity.collections": "0.9.0-preview.6",
55+
"com.unity.mathematics": "1.1.0",
56+
"com.unity.burst": "1.3.0"
57+
},
58+
"url": "https://packages.unity.com"
59+
},
3060
"com.unity.entities": {
3161
"version": "0.14.0-preview.19",
3262
"depth": 1,
@@ -79,7 +109,7 @@
79109
},
80110
"com.unity.jobs": {
81111
"version": "0.5.0-preview.14",
82-
"depth": 2,
112+
"depth": 1,
83113
"source": "registry",
84114
"dependencies": {
85115
"com.unity.collections": "0.12.0-preview.13",
@@ -88,8 +118,8 @@
88118
"url": "https://packages.unity.com"
89119
},
90120
"com.unity.mathematics": {
91-
"version": "1.1.0",
92-
"depth": 2,
121+
"version": "1.2.1",
122+
"depth": 1,
93123
"source": "registry",
94124
"dependencies": {},
95125
"url": "https://packages.unity.com"
@@ -105,7 +135,7 @@
105135
},
106136
"com.unity.nuget.newtonsoft-json": {
107137
"version": "2.0.0-preview",
108-
"depth": 3,
138+
"depth": 2,
109139
"source": "registry",
110140
"dependencies": {},
111141
"url": "https://packages.unity.com"

0 commit comments

Comments
 (0)