Version: 2019.4
public static void LogWarning (object message);
public static void LogWarning (object message, Object context);

パラメーター

message表示の際に文字列として変換対象となる文字列やオブジェクト
contextメッセージが適用されるオブジェクト

説明

Debug.Log の派生で警告メッセージをコンソール出力します。

When you select the message in the console a connection to the context object will be drawn. This is very useful if you want know on which object a warning occurs.

メッセージが文字列であるとき、リッチテキストマークアップを使用して強調することができます。利用可能であるさまざまなマークアップタグについてはマニュアルの リッチテキスト を参照してください。

See Also: Debug.unityLogger, ILogger, Logger.LogWarning.

using UnityEngine;
using System.Collections;

public class MyGameClass : MonoBehaviour { private Transform transform;

void MyGameMethod() { if (transform == null) Debug.LogWarning("A warning assigned to this transform!", transform); } }