・インデックスパターン
dic["キー名"] = "値";
と
・Addメソッドパターン
dic.Add("キー名", "値");
の2種類あるが、
Addメソッドパターンだと、キーが既にあるときはエラーになる。
しかし、インデックスパターンは大丈夫だし、もともとなくても追加されるので便利
・テストした↓
void Start () { Debug.Log ("pattern indexing"); Dictionary<string,string> dic = new Dictionary<string,string>(); dic["key"] = "value1"; dic["key"] = "value2"; Debug.Log ("pattern Add method"); Dictionary<string,string> dic2 = new Dictionary<string,string>(); dic2.Add ("key", "value1"); dic2.Add ("key", "value1"); }