本章讓我們學習註釋工具的用途
我們自己寫的代碼一定要給註釋 時間一長也許什麼都會忘記
註釋工具也可以寫在一些類型上
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public Transform target;
void Start () {
transform.rotation = Quaternion.Inverse(target.rotation);
Debug.Log(target.rotation);
//Debug.Log("打印的值爲: "+c+"-------"+d);
}
TestA aa;
void Update() {
aa = new TestA();
aa.Big("aaa"); //
}
}
//*************************注視寫在類名的上面***********************************
/// <summary>
/// 這個一個類名
/// </summary>
public class TestA {
private static TestA instance;
public static TestA GetInstance() {
if (instance == null)
{
instance = new TestA();
}
return instance;
}
//*************************注視一定要寫在函數的上面********************************
/// <summary>
/// 這是一個Big的函數
/// </summary>
/// <param name="str"></param>
public void Big(string str) {
}
}