diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light')
44 files changed, 1159 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs new file mode 100644 index 00000000..29a084c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the color of the light.")]
+ public class GetColor : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The color to store")]
+ public SharedColor storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.color;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = Color.white;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta new file mode 100644 index 00000000..c391a19f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 935c3e08c991a524fa451ba010bb7077
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs new file mode 100644 index 00000000..85dfd53b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the light's cookie size.")]
+ public class GetCookieSize : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The size to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.cookieSize;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+}
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta new file mode 100644 index 00000000..a86579e2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 4c382d40893d45d46842714355d4cab4
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs new file mode 100644 index 00000000..7ee3f1b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the intensity of the light.")]
+ public class GetIntensity : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The intensity to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.intensity;
+ 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/Light/GetIntensity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta new file mode 100644 index 00000000..dfad40c2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 8af031ee741aec645bcf65ae806e78a7
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs new file mode 100644 index 00000000..3156c745 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the range of the light.")]
+ public class GetRange : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The range to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.range;
+ 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/Light/GetRange.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta new file mode 100644 index 00000000..220a3c67 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 5ebab1924e0212c4ca589526a033fda6
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs new file mode 100644 index 00000000..796f4fe0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the shadow bias of the light.")]
+ public class GetShadowBias : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The shadow bias to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.shadowBias;
+ 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/Light/GetShadowBias.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta new file mode 100644 index 00000000..7b99160f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 9d0cbb27de892b44193aaa9f12842ed2
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs new file mode 100644 index 00000000..be58b1c9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the color of the light.")]
+ public class GetShadowSoftness : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The color to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.shadowSoftness;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+}
+#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta new file mode 100644 index 00000000..3121127e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 6d9f46302c54f694684428de8562238e
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs new file mode 100644 index 00000000..7df7ed4b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the color of the light.")]
+ public class GetShadowSoftnessFade : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The color to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.shadowSoftnessFade;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeValue = 0;
+ }
+ }
+}
+#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta new file mode 100644 index 00000000..33b3ec32 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 070cb15a90d2ab3458792de8fdf6eae9
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs new file mode 100644 index 00000000..81e3ca68 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the color of the light.")]
+ public class GetShadowStrength : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The color to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.shadowStrength;
+ 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/Light/GetShadowStrength.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta new file mode 100644 index 00000000..76739e89 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 7a7fe83e412ff344888939e6a974a064
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs new file mode 100644 index 00000000..d6b98562 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs @@ -0,0 +1,45 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Stores the spot angle of the light.")]
+ public class GetSpotAngle : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [RequiredField]
+ [Tooltip("The spot angle to store")]
+ public SharedFloat storeValue;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ storeValue = light.spotAngle;
+ 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/Light/GetSpotAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta new file mode 100644 index 00000000..74436066 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 4dfc8df823e06cd45a09d929a060f99d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs new file mode 100644 index 00000000..43232caf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the color of the light.")]
+ public class SetColor : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The color to set")]
+ public SharedColor color;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.color = color.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ color = Color.white;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta new file mode 100644 index 00000000..403db7c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 0ba683b0b18385042b3351c660f29d33
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs new file mode 100644 index 00000000..5037c250 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the cookie of the light.")]
+ public class SetCookie : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The cookie to set")]
+ public Texture2D cookie;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.cookie = cookie;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ cookie = null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta new file mode 100644 index 00000000..ad8cc7b0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 374f9a87dc387a04585b87f187d019c5
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs new file mode 100644 index 00000000..b70581e3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the light's cookie size.")]
+ public class SetCookieSize : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The size to set")]
+ public SharedFloat cookieSize;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.cookieSize = cookieSize.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ cookieSize = 0;
+ }
+ }
+}
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta new file mode 100644 index 00000000..e06f1769 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: fbc2d3865f928144ea551b1d927ddc96
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs new file mode 100644 index 00000000..5f6ef3e2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the culling mask of the light.")]
+ public class SetCullingMask : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The culling mask to set")]
+ public LayerMask cullingMask;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.cullingMask = cullingMask.value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ cullingMask = -1;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta new file mode 100644 index 00000000..8968b4e5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 3f67673818b7e914ebf088b3752d716b
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs new file mode 100644 index 00000000..9bbf21c8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the intensity of the light.")]
+ public class SetIntensity : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The intensity to set")]
+ public SharedFloat intensity;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.intensity = intensity.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ intensity = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta new file mode 100644 index 00000000..137b45cd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 1f32aa9b9681f0a4285bd60ac0607d00
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs new file mode 100644 index 00000000..975421ee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the range of the light.")]
+ public class SetRange : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The range to set")]
+ public SharedFloat range;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.range = range.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ range = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta new file mode 100644 index 00000000..d2bb5bd3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: f0b5d0c0a07806244a3c5b15e29cf90c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs new file mode 100644 index 00000000..b286c041 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the shadow bias of the light.")]
+ public class SetShadowBias : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The shadow bias to set")]
+ public SharedFloat shadowBias;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.shadowBias = shadowBias.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ shadowBias = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta new file mode 100644 index 00000000..c364894d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: f2b374e3c2e26e94ba76dd68290ff538
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs new file mode 100644 index 00000000..1f9122e8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the shadow softness of the light.")]
+ public class SetShadowSoftness : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The shadow softness to set")]
+ public SharedFloat shadowSoftness;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.shadowSoftness = shadowSoftness.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ shadowSoftness = 0;
+ }
+ }
+}
+#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta new file mode 100644 index 00000000..1276066d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: ca82eb780880d17499dc6de132631073
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs new file mode 100644 index 00000000..2c5047f0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the shadow softness fade value of the light.")]
+ public class SetShadowSoftnessFade : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The shadow softness fade to set")]
+ public SharedFloat shadowSoftnessFade;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.shadowSoftnessFade = shadowSoftnessFade.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ shadowSoftnessFade = 0;
+ }
+ }
+}
+#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta new file mode 100644 index 00000000..074f1119 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 5e7db120bd152164eb6d586a39e53175
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs new file mode 100644 index 00000000..b30cf243 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the shadow strength of the light.")]
+ public class SetShadowSoftnessStrength : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The shadow strength to set")]
+ public SharedFloat shadowStrength;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.shadowStrength = shadowStrength.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ shadowStrength = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta new file mode 100644 index 00000000..f5ba4379 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 611e5846c0413be46bbc44fbd256b4e9
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs new file mode 100644 index 00000000..8310dd27 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs @@ -0,0 +1,43 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the shadow type of the light.")]
+ public class SetShadows : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The shadow type to set")]
+ public LightShadows shadows;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.shadows = shadows;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta new file mode 100644 index 00000000..f528500b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: b6226eb03ad729445bc7ccfb1f0cd89d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs new file mode 100644 index 00000000..f017a652 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs @@ -0,0 +1,44 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the spot angle of the light.")]
+ public class SetSpotAngle : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The spot angle to set")]
+ public SharedFloat spotAngle;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.spotAngle = spotAngle.Value;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ spotAngle = 0;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta new file mode 100644 index 00000000..b6d09a90 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 9a8b9b0654618fe48953e059d4aa5ee3
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs new file mode 100644 index 00000000..2d103ed9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs @@ -0,0 +1,43 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight
+{
+ [TaskCategory("Basic/Light")]
+ [TaskDescription("Sets the type of the light.")]
+ public class SetType : Action
+ {
+ [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The type to set")]
+ public LightType type;
+
+ // cache the light component
+ private Light light;
+ private GameObject prevGameObject;
+
+ public override void OnStart()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ light = currentGameObject.GetComponent<Light>();
+ prevGameObject = currentGameObject;
+ }
+ }
+
+ public override TaskStatus OnUpdate()
+ {
+ if (light == null) {
+ Debug.LogWarning("Light is null");
+ return TaskStatus.Failure;
+ }
+
+ light.type = type;
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ }
+ }
+}
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta new file mode 100644 index 00000000..c0ba834c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2
+guid: 85cae5f82bfcbfb41ac7c66464eef85f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
|