6 namespace droid.Runtime.Prototyping.Actuators {
10 [AddComponentMenu(ActuatorComponentMenuPath._ComponentMenuPath
11 +
"EulerTransform3DofActuator" 12 + ActuatorComponentMenuPath._Postfix)]
17 protected string _Layer_Mask =
"Obstructions";
22 protected bool _No_Collisions =
true;
27 protected Space _Relative_To = Space.Self;
37 protected bool _Use_Mask =
true;
56 public override string PrototypingTypeName {
get {
return "Transform"; } }
60 protected override void Setup() {
61 if (!this._Rotational_Actuators) {
62 this._x = this.Identifier +
"X_";
63 this._y = this.Identifier +
"Y_";
64 this._z = this.Identifier +
"Z_";
66 this._x = this.Identifier +
"RotX_";
67 this._y = this.Identifier +
"RotY_";
68 this._z = this.Identifier +
"RotZ_";
87 var layer_mask = 1 << LayerMask.NameToLayer(this._Layer_Mask);
88 if (!this._Rotational_Actuators) {
90 var vec = Vector3.right * motion.
Strength;
91 if (this._No_Collisions) {
92 if (!Physics.Raycast(
this.transform.position, vec, Mathf.Abs(motion.
Strength), layer_mask)) {
93 this.transform.Translate(vec, this._Relative_To);
96 this.transform.Translate(vec, this._Relative_To);
99 var vec = -Vector3.up * motion.
Strength;
100 if (this._No_Collisions) {
101 if (!Physics.Raycast(
this.transform.position, vec, Mathf.Abs(motion.
Strength), layer_mask)) {
102 this.transform.Translate(vec, this._Relative_To);
105 this.transform.Translate(vec, this._Relative_To);
108 var vec = -Vector3.forward * motion.
Strength;
109 if (this._No_Collisions) {
110 if (!Physics.Raycast(
this.transform.position, vec, Mathf.Abs(motion.
Strength), layer_mask)) {
111 this.transform.Translate(vec, this._Relative_To);
114 this.transform.Translate(vec, this._Relative_To);
119 this.transform.Rotate(Vector3.left, motion.
Strength,
this._Relative_To);
121 this.transform.Rotate(Vector3.up, motion.
Strength,
this._Relative_To);
123 this.transform.Rotate(Vector3.forward, motion.
Strength,
this._Relative_To);