Example #1
0
    public static void DrawCircle(Circle _circle, Color _color)
    {
        Gizmos.color = _color;

        Vector3 pos = _circle.m_center.ToXZ() + Vector3.up * 0.01f; // 0.01fは地面と高さだと見づらいので調整用。

        Quaternion rot   = Quaternion.identity;
        Vector3    scale = Vector3.one * _circle.m_radius;

        Mesh fanMesh = VisualRange_GizmosEditor.CreateFanMesh(360f, 18);

        Gizmos.DrawMesh(fanMesh, pos, rot, scale);
    }
Example #2
0
    public static void DrawFan(Fan _fan, Color _color)
    {
        Gizmos.color = _color;

        Vector3 pos     = _fan.m_center.ToXZ() + Vector3.up * 0.01f; // 0.01fは地面と高さだと見づらいので調整用。
        Vector3 forward = _fan.forward.ToXZ();
        //Debug.Log(forward);
        Quaternion rot = Quaternion.identity;

        if (forward != Vector3.forward)
        {
            rot = Quaternion.LookRotation(forward, Vector3.up);
        }

        Vector3 scale = Vector3.one * _fan.Length;

        Mesh fanMesh = VisualRange_GizmosEditor.CreateFanMesh(_fan.OpenAngle, 16);

        Gizmos.DrawMesh(fanMesh, pos, rot, scale);

        Gizmos.DrawSphere(_fan.Left.ToXZ(), 0.1f);
        Gizmos.DrawSphere(_fan.Right.ToXZ(), 0.1f);
    }