Unity/Csharp/クラス

提供: 初心者エンジニアの簡易メモ
2017年9月15日 (金) 23:01時点におけるAdmin (トーク | 投稿記録)による版 (ページの作成:「==クラスやプロパティ== public class CanvasScript : MonoBehaviour { private int cnt = 1; void Start () { Debug.Log("helloworld" + cnt); Add(10, 15) }...」)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動 検索に移動

クラスやプロパティ

public class CanvasScript : MonoBehaviour {
	private int cnt = 1;
	void Start () {
		Debug.Log("helloworld" + cnt);
		Add(10, 15)
	}
	void Update () {
	}
	public int Add(int x, int y) {
		return x + y;
	}
}

メンバはpublicとprivateがあり省略するとprivateになる。