言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Hashtable.Add(object, object)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

指定したキーおよび値でハッシュテーブルに要素を追加します

// Adds 2 elements to a hash table.

var h : Hashtable;
h = new Hashtable();
h.Add(1,"one");
h.Add(2,"two");
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Hashtable h;
    void Example() {
        h = new Hashtable();
        h.Add(1, "one");
        h.Add(2, "two");
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public h as Hashtable

	def Example() as void:
		h = Hashtable()
		h.Add(1, 'one')
		h.Add(2, 'two')