コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】デバッグ用にギズモを簡単に描画できる「Debug Draw API for Unity」紹介

はじめに

「Debug Draw API for Unity」を Unity プロジェクトに導入することで
デバッグ用にギズモを簡単に描画できるようになります

使用例

using Oddworm.Framework;
using UnityEngine;

public class Example : MonoBehaviour
{
    private void Update()
    {
        DbgDraw.WireCube( new Vector3( -1, 1, 0 ), Quaternion.identity, Vector3.one, Color.red );
        DbgDraw.WireSphere( new Vector3( 1, 1, 0 ), Quaternion.identity, Vector3.one, Color.green );
        DbgDraw.Cube( new Vector3( -1, -1, 0 ), Quaternion.identity, Vector3.one, Color.blue );
        DbgDraw.Sphere( new Vector3( 1, -1, 0 ), Quaternion.identity, Vector3.one, Color.magenta );
    }
}