forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnakeComponents.cs
More file actions
41 lines (36 loc) · 888 Bytes
/
Copy pathSnakeComponents.cs
File metadata and controls
41 lines (36 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Unity.Entities;
using Unity.Mathematics;
namespace Graphical.Splines
{
public struct SnakeSettings : IComponentData
{
public Entity Prefab;
public int NumPartsPerSnake;
public int NumSnakes;
public float Speed;
public float Spacing;
}
public struct SplineData
{
public BlobArray<float3> Points;
public BlobArray<float> Distance;
}
public struct Spline : IComponentData
{
public BlobAssetReference<SplineData> Data;
}
[MaximumChunkCapacity(4)]
public struct Snake : IComponentData
{
public float Offset;
public float3 Anchor;
public Entity SplineEntity;
public float Speed;
public float Spacing;
}
[InternalBufferCapacity(0)]
public struct SnakePart : IBufferElementData
{
public Entity Value;
}
}