「Unity/Csharp/クラス」の版間の差分

提供: 初心者エンジニアの簡易メモ
ナビゲーションに移動 検索に移動
ページの作成:「==クラスやプロパティ== public class CanvasScript : MonoBehaviour { private int cnt = 1; void Start () { Debug.Log("helloworld" + cnt); Add(10, 15) }...」
 
編集の要約なし
 
(同じ利用者による、間の45版が非表示)
1行目: 1行目:
==クラスやプロパティ==
[[Unity/Csharp/クラス/基本]]
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になる。
[[Unity/Csharp/クラス/アクセス修飾子]]
 
[[Unity/Csharp/クラス/クラス分割]]
 
[[Unity/Csharp/クラス/継承元から継承先実行]]
 
[[Unity/Csharp/クラス/インターフェイス]]
 
[[Unity/Csharp/クラス/引数可変]]
 
[[Unity/Csharp/クラス/Tuple]]
 
[[Unity/Csharp/クラス/クラスメンバfor取得]]
 
[[Unity/Csharp/クラス/ジェネリックメソッド]]
 
[[Unity/Csharp/クラス/ジェネリックインターフェース]]

2025年5月9日 (金) 04:21時点における最新版