From 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Jan 2021 16:15:06 +0800 Subject: +behaviour designer --- .../Runtime/Basic Tasks/Debug/DrawLine.cs | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs') diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs new file mode 100644 index 00000000..2c5429fa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityDebug +{ + [TaskCategory("Basic/Debug")] + [TaskDescription("Draws a debug line")] + public class DrawLine : Action + { + [Tooltip("The start position")] + public SharedVector3 start; + [Tooltip("The end position")] + public SharedVector3 end; + [Tooltip("The color")] + public SharedColor color = Color.white; + + public override TaskStatus OnUpdate() + { + Debug.DrawLine(start.Value, end.Value, color.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + start = Vector3.zero; + end = Vector3.zero; + color = Color.white; + } + } +} \ No newline at end of file -- cgit v1.1-26-g67d0