summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs')
-rw-r--r--Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs b/Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs
new file mode 100644
index 00000000..36cbfd05
--- /dev/null
+++ b/Assets/Scripts/Avatar/Conditions/ConditionTowardLeft.cs
@@ -0,0 +1,19 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ConditionTowardLeft : ConditionBase
+{
+ Transform m_Obj;
+
+ public ConditionTowardLeft(Transform obj)
+ {
+ m_Obj = obj;
+ }
+
+ public override bool Evaluate()
+ {
+ return Mathf.Approximately(m_Obj.rotation.eulerAngles.y, 270f)
+ || Mathf.Approximately(m_Obj.rotation.eulerAngles.y, -90f);
+ }
+}