UnityEngine.Debug ログを非表示にするのではなく、アプリからコードを一発除去する

# 前提
- Unity 2019.4.9f1 (LTS)

# 参考
- [Unityで完全にログを消し去る方法 (Qiita)](https://qiita.com/jun_moka/items/f496f16dff5e592ca4a8)
- [【Unity】リリース時にDebug.Logを出力しないようにする (のらくるノート)](https://noracle.jp/unity-no-debug/)
- [ConditionalAttribute クラス (MS Docs)](https://docs.microsoft.com/ja-jp/dotnet/api/system.diagnostics.conditionalattribute?view=netcore-3.1)

どうもありがとうございました。

# 仕組み
- ラッパークラスは、`#if !DEBUGLOG`によって、`DEBUGLOG`シンボルが未定義の場合だけ有効になります。
- クラスでは、`UnityEngine.Debug`のメソッドを一通り網羅して、同名の何もしないメソッドを定義します。
- 定義されたメソッドは、`[System.Diagnostics.Conditional ("DEBUGLOG")]`によって、呼び出し自体が無視されコンパイルされません。
    - `Conditional`アトリビュートは、シンボルが未定義の際に呼び出しを無視するようにコンパイラに指示します。
- クラスが有効だと、`Debug`に対して、本来の`UnityEngine.Debug`に置き換わって、このクラスが参照されます。
- `DEBUGLOG`シンボルが定義されるとクラスの定義自体が無効になり、`UnityEngine.Debug`が使われるようになります。

# 使い方
- 一般に、ログを出力する際は、下記の`Debug`クラスを定義したソース冒頭で`DEBUGLOG`を定義し、除去する際はコメントアウトします。
    - あるいは、ログを出力する際は`Project Settings` > `Player` > `Scripting Define Symbols`へ`DEBUGLOG`を記入し、除去する際は消します。
- 下記のシンボル`DEBUGLOG`を`DEBUG`に置き換えると、そのようにシンボルを制御せずとも、開発時は出力され、リリース時には除去されるようになります。

# 結果
```cs:
#if !DEBUGLOG
public class Debug {
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, string message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, object message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, string message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, object message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Assert (bool condition, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void AssertFormat (bool condition, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void AssertFormat (bool condition, Object context, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Break () { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void ClearDeveloperConsole () { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DebugBreak () { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawLine (Vector3 start, Vector3 end, Color color, float duration, bool depthTest) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawLine (Vector3 start, Vector3 end, Color color, float duration) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawLine (Vector3 start, Vector3 end) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawLine (Vector3 start, Vector3 end, Color color) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawRay (Vector3 start, Vector3 dir, Color color, float duration) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawRay (Vector3 start, Vector3 dir, Color color, float duration, bool depthTest) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawRay (Vector3 start, Vector3 dir) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void DrawRay (Vector3 start, Vector3 dir, Color color) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Log (object message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void Log (object message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogAssertion (object message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogAssertion (object message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogAssertionFormat (Object context, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogAssertionFormat (string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogError (object message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogError (object message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogErrorFormat (string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogErrorFormat (Object context, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogException (System.Exception exception, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogException (System.Exception exception) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogFormat (Object context, string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogFormat (string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogWarning (object message) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogWarning (object message, Object context) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogWarningFormat (string format, params object [] args) { }
	[System.Diagnostics.Conditional ("DEBUGLOG")] public static void LogWarningFormat (Object context, string format, params object [] args) { }
}
#endif
```