内容へ移動
ユーザ用ツール
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
現在位置:
Home
»
wiki
»
Unity
»
Tips
»
090 Debug.Logの制御
トレース:
wiki:unity:tips:090
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 090 Debug.Logの制御 ====== ===== 概要 ===== UnityデフォルトのDebugクラスを上書きして、実機確認時にはログを出さない様にします。 ==== ソースコード ==== <code csharp> #if !UNITY_EDITOR #define DEBUG_LOG_OVERWRAP #endif using UnityEngine; #if DEBUG_LOG_OVERWRAP public static class Debug { static public void Break() { if(IsEnable()) { UnityEngine.Debug.Break(); } } static public void Log( object message ) { if( IsEnable() ) { UnityEngine.Debug.Log( message ); } } static public void Log( object message, Object context ) { if( IsEnable() ) { UnityEngine.Debug.Log( message, context ); } } static public void LogWarning( object message) { if( IsEnable() ) { UnityEngine.Debug.LogWarning( message ); } } static public void LogWarning(object message, Object context) { if (IsEnable()) { UnityEngine.Debug.LogWarning(message, context); } } static public void LogError( object message) { if( IsEnable() ) { UnityEngine.Debug.LogError( message ); } } static public void LogError( object message, Object context ) { if( IsEnable() ) { UnityEngine.Debug.LogError( message, context ); } } static bool IsEnable() { return UnityEngine.Debug.isDebugBuild; } } #endif // #if DEBUG_LOG_OVERWRAP </code>
Permalink
wiki/unity/tips/090.txt
· 最終更新: 2014/11/20 01:08 (外部編集)
ページ用ツール
ログイン
文書の表示
文書の先頭へ
印刷
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
oeffentlich