6 namespace droid.Runtime.Prototyping.Actuators {
8 [AddComponentMenu(ActuatorComponentMenuPath._ComponentMenuPath
9 +
"EulerTransformActuator1Dof" 10 + ActuatorComponentMenuPath._Postfix)]
20 [SerializeField]
protected string _Layer_Mask =
"Obstructions";
25 [SerializeField]
protected bool _No_Collisions =
true;
30 [SerializeField]
protected Space _Relative_To = Space.Self;
35 public override string PrototypingTypeName {
get {
return "Transform" + this._Axis_Of_Motion; } }
43 var layer_mask = 1 << LayerMask.NameToLayer(this._Layer_Mask);
44 var vec = Vector3.zero;
45 switch (this._Axis_Of_Motion) {
47 vec = Vector3.right * motion.
Strength;
53 vec = -Vector3.forward * motion.
Strength;
56 this.transform.Rotate(Vector3.left, motion.
Strength,
this._Relative_To);
59 this.transform.Rotate(Vector3.up, motion.
Strength,
this._Relative_To);
62 this.transform.Rotate(Vector3.forward, motion.
Strength,
this._Relative_To);
64 case Axis.Dir_x_:
break;
65 case Axis.Dir_y_:
break;
66 case Axis.Dir_z_:
break;
67 default:
throw new ArgumentOutOfRangeException();
70 if (this._No_Collisions) {
71 if (!Physics.Raycast(
this.transform.position, vec, Mathf.Abs(motion.
Strength), layer_mask)) {
72 this.transform.Translate(vec, this._Relative_To);
75 this.transform.Translate(vec, this._Relative_To);