在Unity GUI 中creat script时会自动生成一个模板
using UnityEngine;
using System.Collections;
public class MainPlayer : MonoBehaviour {
// Use this for initialization
void Start () {
<span style="white-space:pre"> </span>Debug.Log("Fuck Me");
}
// Update is called once per frame
void Update () {
}
}
其中class后面对应的MainPlayer需要和脚本名相同,update函数每帧刷新。
Debug.Log里面的内容会出现在Unity的console中。