-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
MovableComponentGeneratedExtension.cs
47 lines (42 loc) · 1.51 KB
/
MovableComponentGeneratedExtension.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
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Entitas.CodeGenerator.ComponentsGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Entitas {
public partial class Entity {
static readonly MovableComponent movableComponent = new MovableComponent();
public bool isMovable {
get { return HasComponent(ComponentIds.Movable); }
set {
if (value != isMovable) {
if (value) {
AddComponent(ComponentIds.Movable, movableComponent);
} else {
RemoveComponent(ComponentIds.Movable);
}
}
}
}
public Entity IsMovable(bool value) {
isMovable = value;
return this;
}
}
public partial class Matcher {
static IMatcher _matcherMovable;
public static IMatcher Movable {
get {
if (_matcherMovable == null) {
var matcher = (Matcher)Matcher.AllOf(ComponentIds.Movable);
matcher.componentNames = ComponentIds.componentNames;
_matcherMovable = matcher;
}
return _matcherMovable;
}
}
}
}