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

Parámetros

message String u objeto a ser convertido a representación string para ser mostrado.
context Objeto al cual el mensaje se aplica.

Descripción

Una variante de Debug.Log que registra un mensaje de advertencia a la consola.

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.

Cuando el mensaje es un string, el marcador de texto enriquecido se puede utilizar para agregar enfasis. Mire la página del manual acerca de rich text , para detalles sobre las etiquetas marcadoras diferentes disponibles.

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); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961