Пример #1
0
 public RedPointBundle(string tag, int index, GameObject go, isActive activeFunc)
 {
     this.tag        = tag;
     this.index      = index;
     this.go         = go;
     this.activeFunc = activeFunc;
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     isActiveScript = Object.FindObjectOfType <isActive>();
 }