summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs45
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta8
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs44
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta8
8 files changed, 210 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs
new file mode 100644
index 00000000..83bf9367
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider
+{
+ [TaskCategory("Basic/BoxCollider")]
+ [TaskDescription("Stores the center of the BoxCollider. 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 BoxCollider")]
+ [RequiredField]
+ public SharedVector3 storeValue;
+
+ private BoxCollider boxCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ boxCollider = currentGameObject.GetComponent<BoxCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (boxCollider == null) {
+ Debug.LogWarning("BoxCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = boxCollider.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/BoxCollider/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta
new file mode 100644
index 00000000..61b2c34f
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9c3ae13d2bd0e5f4186835c672d9461f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs
new file mode 100644
index 00000000..d358a83b
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider
+{
+ [TaskCategory("Basic/BoxCollider")]
+ [TaskDescription("Stores the size of the BoxCollider. Returns Success.")]
+ public class GetSize : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The size of the BoxCollider")]
+ [RequiredField]
+ public SharedVector3 storeValue;
+
+ private BoxCollider boxCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ boxCollider = currentGameObject.GetComponent<BoxCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (boxCollider == null) {
+ Debug.LogWarning("BoxCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue.Value = boxCollider.size;
+
+ 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/BoxCollider/GetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta
new file mode 100644
index 00000000..934ee86c
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0afec21454700d3479c4f9767f9382f9
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs
new file mode 100644
index 00000000..e24eec2a
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider
+{
+ [TaskCategory("Basic/BoxCollider")]
+ [TaskDescription("Sets the center of the BoxCollider. 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 BoxCollider")]
+ public SharedVector3 center;
+
+ private BoxCollider boxCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ boxCollider = currentGameObject.GetComponent<BoxCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (boxCollider == null) {
+ Debug.LogWarning("BoxCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ boxCollider.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/BoxCollider/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta
new file mode 100644
index 00000000..9787d48f
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 45b3b4dc79247bd46a9c2b11fa9b125c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs
new file mode 100644
index 00000000..1ee03fa2
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider
+{
+ [TaskCategory("Basic/BoxCollider")]
+ [TaskDescription("Sets the size of the BoxCollider. Returns Success.")]
+ public class SetSize : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The size of the BoxCollider")]
+ public SharedVector3 size;
+
+ private BoxCollider boxCollider;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ boxCollider = currentGameObject.GetComponent<BoxCollider>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (boxCollider == null) {
+ Debug.LogWarning("BoxCollider is null");
+ return TaskStatus.Failure;
+ }
+
+ boxCollider.size = size.Value;
+
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ size = Vector3.zero;
+ }
+ }
+} \ No newline at end of file
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta
new file mode 100644
index 00000000..e00c7d4a
--- /dev/null
+++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d899b6ed83f6e264f8e5867cf68c0cda
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData: