[System.Diagnostics.Conditional("DEFINE")]을 사용하면 되겠다.
C#
void Start()
{
    // 전처리기를 이용한 방법
    {
#if (DEBUG)
            Debug.Log("Print DebugLog!");
#endif
#if (RELEASE)
            Debug.Log("Print DebugLog!");
#endif
    }
    // attribute를 이용하는 방법
    {
        DebugLog("Print DebugLog!");
        ReleaseLog("Print ReleaseLog!");
    }
}
[System.Diagnostics.Conditional("DEBUG")]
void DebugLog(string log)
{
#if (DEBUG)
            Debug.Log(log);
#endif
}
[System.Diagnostics.Conditional("RELEASE")]
void ReleaseLog(string log)
{
#if (RELEASE)
            Debug.Log(log);
#endif
}