public RedPointBundle(string tag, int index, GameObject go, isActive activeFunc) { this.tag = tag; this.index = index; this.go = go; this.activeFunc = activeFunc; }
public void Reg(string tag, int index, GameObject go, isActive activeFunc) { if (dic.ContainsKey(tag)) { List <RedPointBundle> bs = dic [tag]; if (bs != null) { bool find = false; for (int i = 0; i < bs.Count; ++i) { if (bs [i].index == index) { find = true; //Debug.LogWarning(string.Format("find index {0} exsits", index)); bs [i] = new RedPointBundle(tag, index, go, activeFunc); break; } } if (!find) { bs.Add(new RedPointBundle(tag, index, go, activeFunc)); } } else { throw new System.Exception("null pointer exception"); } } else { List <RedPointBundle> bundles = new List <RedPointBundle> (); RedPointBundle b = new RedPointBundle(tag, index, go, activeFunc); bundles.Add(b); dic.Add(tag, bundles); } }
// Use this for initialization void Start() { isActiveScript = Object.FindObjectOfType <isActive>(); }