-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathExecuteAuthoring.cs
81 lines (65 loc) · 2.07 KB
/
ExecuteAuthoring.cs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using Unity.Entities;
using UnityEngine;
namespace Tutorials.Kickball.Execute
{
public class ExecuteAuthoring : MonoBehaviour
{
[Header("Step 1")]
public bool ObstacleSpawner;
[Header("Step 2")]
public bool PlayerSpawner;
public bool PlayerMovement;
[Header("Step 3")]
public bool BallSpawner;
public bool BallMovement;
[Header("Step 4")]
public bool NewPlayerMovement;
public bool NewBallMovement;
[Header("Step 5")]
public bool BallCarry;
public bool BallKicking;
class Baker : Baker<ExecuteAuthoring>
{
public override void Bake(ExecuteAuthoring authoring)
{
var entity = GetEntity(TransformUsageFlags.None);
if (authoring.ObstacleSpawner) AddComponent<ObstacleSpawner>(entity);
if (authoring.PlayerMovement) AddComponent<PlayerMovement>(entity);
if (authoring.PlayerSpawner) AddComponent<PlayerSpawner>(entity);
if (authoring.BallSpawner) AddComponent<BallSpawner>(entity);
if (authoring.BallMovement) AddComponent<BallMovement>(entity);
if (authoring.NewPlayerMovement) AddComponent<NewPlayerMovement>(entity);
if (authoring.NewBallMovement) AddComponent<NewBallMovement>(entity);
if (authoring.BallCarry) AddComponent<BallCarry>(entity);
if (authoring.BallKicking) AddComponent<BallKicking>(entity);
}
}
}
public struct ObstacleSpawner : IComponentData
{
}
public struct PlayerMovement : IComponentData
{
}
public struct BallMovement : IComponentData
{
}
public struct NewPlayerMovement : IComponentData
{
}
public struct NewBallMovement : IComponentData
{
}
public struct PlayerSpawner : IComponentData
{
}
public struct BallSpawner : IComponentData
{
}
public struct BallCarry : IComponentData
{
}
public struct BallKicking : IComponentData
{
}
}