Neodroid
0.2.0
Machine Learning Environment Prototyping Tool
KillableActor.cs
Go to the documentation of this file.
1
using
droid
.
Runtime
.
Interfaces
;
2
using
UnityEngine
;
3
4
namespace
droid
.Runtime.Prototyping.Actors {
7
[AddComponentMenu(ActorComponentMenuPath._ComponentMenuPath +
"Killable"
+ ActorComponentMenuPath._Postfix)]
8
public
class
KillableActor
:
Actor
{
9
[SerializeField]
bool
_is_alive =
true
;
13
public
bool
IsAlive {
get
{
return
this._is_alive; } }
14
18
public
override
string
PrototypingTypeName {
get
{
return
"KillableActor"
; } }
22
public
void
Kill
() { this._is_alive =
false
; }
23
24
public
override
void
ApplyMotion
(
IMotion
motion) {
25
if
(this._is_alive) {
26
base.ApplyMotion(motion);
27
}
else
{
28
#if NEODROID_DEBUG
29
if
(this.Debugging) {
30
Debug.Log(
"Actor is dead, cannot apply motion"
);
31
}
32
#endif
33
}
34
}
35
36
public
override
void
EnvironmentReset
() {
37
base.EnvironmentReset();
38
39
this._is_alive =
true
;
40
}
41
}
42
}
droid.Runtime.Prototyping.Actors.KillableActor
Definition:
KillableActor.cs:8
droid.Runtime.Prototyping.Actors.KillableActor.ApplyMotion
override void ApplyMotion(IMotion motion)
Definition:
KillableActor.cs:24
droid.Runtime.Interfaces
Definition:
IAbstractPrototypingEnvironment.cs:5
droid.Runtime.Prototyping.Actors.Actor
Definition:
Actor.cs:16
droid
droid.Runtime.Prototyping.Actors.KillableActor.Kill
void Kill()
Definition:
KillableActor.cs:22
droid.Runtime
droid.Runtime.Interfaces.IMotion
Definition:
IMotion.cs:2
droid.Runtime.Prototyping.Actors.KillableActor.EnvironmentReset
override void EnvironmentReset()
Definition:
KillableActor.cs:36
UnityEngine
Runtime
Prototyping
Actors
KillableActor.cs
Generated by
1.8.13