Hashtable.Add 添加

function Add (key : Object, value : Object) : void

Description描述

Adds an element with the specified key and value into the Hashtable.

添加一个带有指定键和值元素到哈希表。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Hashtable h;
	public void Awake() {
		h = new Hashtable();
		h.Add(1, "one");
		h.Add(2, "two");
	}
}
// Adds 2 elements to a hash table.
//添加2个元素到哈希表

var h : Hashtable;
h = new Hashtable();
h.Add(1,"one");
h.Add(2,"two");
Page last updated: 2011-3-10