Gizmo Stadium#
Debug / Gizmos / Gizmo Stadium
Description#
Displays a 2D capsule gizmo in the scene
Parameters#
| Name | Description |
|---|---|
| Mode | Whether to display a solid or a wireframe shape |
| Position | The position of the shape |
| Rotation | The rotation of the shape |
| Size | The width and height of the shape |
| Direction | Whether the shape caps are aligned vertically or horizontally |
| Color | The color of the shape |
| Duration | The amount of seconds the shape will be displayed |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Gizmo Stadium")]
[Image(typeof(IconCapsuleSolid), ColorTheme.Type.Lime, typeof(Badge2D))]
[Description("Displays a 2D capsule gizmo in the scene")]
[Category("Debug/Gizmos/Stadium")]
[Parameter("Mode", "Whether to display a solid or a wireframe shape")]
[Parameter("Position", "The position of the shape")]
[Parameter("Rotation", "The rotation of the shape")]
[Parameter("Size", "The width and height of the shape")]
[Parameter("Direction", "Whether the shape caps are aligned vertically or horizontally")]
[Parameter("Color", "The color of the shape")]
[Parameter("Duration", "The amount of seconds the shape will be displayed")]
[Keywords("Draw", "Debug", "Gizmo", "Pill", "2D", "Capsule")]
[Serializable]
public class InstructionCoreDebugGizmoStadium : Instruction
{
[SerializeField] private GizmoMode m_Mode = GizmoMode.Outline;
[SerializeField] private GetVector3 m_Position = new GetVector3();
[SerializeField] private GetQuaternion m_Rotation = new GetQuaternion();
[SerializeField] private GetVector2 m_Size = new GetVector2(new Vector2(1f, 2f));
[SerializeField] private CapsuleDirection2D m_Direction = CapsuleDirection2D.Vertical;
[SerializeField] private GetColor m_Color = new GetColor(Color.green.SetAlpha(0.5f));
[SerializeField] private GetNumber m_Duration = new GetNumber(1f);
protected override string GetTitle(GameObject source) => $"Display {this.m_Mode} Stadium at {this.m_Position}";
protected override Awaitable Run(Args args)
{
GizmosManager.Stadium(
this.m_Position.Get(args),
this.m_Rotation.Get(args),
this.m_Size.Get(args),
this.m_Direction,
this.m_Color.Get(args),
this.m_Mode,
this.m_Duration.GetFloat(args)
);
return Done;
}
}
}