Debug.Log 记录

static function Log (message : object) : void

Description描述

Logs message to the Unity Console.

记录消息到Unity控制台。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		Debug.Log("Hello");

	}

}
Debug.Log("Hello");

o static function Log (message : object, context : Object) : void

Description描述

Logs message to the Unity Console.

记录消息到Unity控制台。

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 an error occurs.

当你在看控制台选择消息的时候,到上下文物体的一个连接将被绘制。如果你想知道在那个对象上发生了错误,这是非常有用的。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		Debug.Log("Hello", gameObject);

	}

}
Debug.Log("Hello", gameObject);
Page last updated: 2010-12-24