summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta8
16 files changed, 420 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs
new file mode 100644
index 00000000..05e4c8e4
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Stores the center of the CapsuleCollider. Returns Success.")]
+ public class GetCenter : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The center of the CapsuleCollider")]
+ [RequiredField]
+ public SharedVector3 storeValue;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = capsuleCollider.center;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = Vector3.zero;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta
new file mode 100644
index 00000000..3256d554
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3a032cb4c0b97b844ad53ad7bb2617c3
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs
new file mode 100644
index 00000000..56f394b9
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Stores the direction of the CapsuleCollider. Returns Success.")]
+ public class GetDirection : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The direction of the CapsuleCollider")]
+ [RequiredField]
+ public SharedInt storeValue;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = capsuleCollider.direction;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta
new file mode 100644
index 00000000..3e32e995
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7e9f2ebb599281345a458fab17aab5fd
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs
new file mode 100644
index 00000000..98c38d5e
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Gets the height of the CapsuleCollider. Returns Success.")]
+ public class GetHeight : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The height of the CapsuleCollider")]
+ [RequiredField]
+ public SharedFloat storeValue;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = capsuleCollider.height;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta
new file mode 100644
index 00000000..8f56770b
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 29e860749600e174aa61dd42be0a3126
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs
new file mode 100644
index 00000000..b1df3bc9
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Stores the radius of the CapsuleCollider. Returns Success.")]
+ public class GetRadius : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The radius of the CapsuleCollider")]
+ [RequiredField]
+ public SharedFloat storeValue;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = capsuleCollider.radius;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta
new file mode 100644
index 00000000..006177a6
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d03b50a6f076c75408ef6e843bd75539
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs
new file mode 100644
index 00000000..c72abb9b
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Sets the center of the CapsuleCollider. Returns Success.")]
+ public class SetCenter : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The center of the CapsuleCollider")]
+ public SharedVector3 center;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ capsuleCollider.center = center.Value;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ center = Vector3.zero;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta
new file mode 100644
index 00000000..8b888bdd
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f8292285661aa7e4086c0b59926632c3
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs
new file mode 100644
index 00000000..e07ee642
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Sets the direction of the CapsuleCollider. Returns Success.")]
+ public class SetDirection : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The direction of the CapsuleCollider")]
+ public SharedInt direction;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ capsuleCollider.direction = direction.Value;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ direction = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta
new file mode 100644
index 00000000..15fea291
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4146b45b3a598294f86dbbac03e6e8cb
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs
new file mode 100644
index 00000000..2f734d5d
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Sets the height of the CapsuleCollider. Returns Success.")]
+ public class SetHeight : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The height of the CapsuleCollider")]
+ public SharedFloat direction;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ capsuleCollider.height = direction.Value;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ direction = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta
new file mode 100644
index 00000000..60d24f8f
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 34f947c079c1159488c80854ee53ecd8
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs
new file mode 100644
index 00000000..963dfe47
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider
+{
+ [TaskCategory("Basic/CapsuleCollider")]
+ [TaskDescription("Sets the radius of the CapsuleCollider. Returns Success.")]
+ public class SetRadius : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The radius of the CapsuleCollider")]
+ public SharedFloat radius;
+
+ private CapsuleCollider capsuleCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ capsuleCollider = currentGameObject.GetComponent<CapsuleCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (capsuleCollider == null) {
+ Debug.LogWarning("CapsuleCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ capsuleCollider.radius = radius.Value;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ radius = 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta
new file mode 100644
index 00000000..ae2e46ca
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fed5a0f5604af324cb2e4a3ed9315793
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData: