Exemplo n.º 1
0
        public FightNumber GetNumber(int ibit, HPNumberType type)
        {
            FightNumber ret = null;

            List <FightNumber> list = null;

            if (!mFightDict.ContainsKey(ibit))
            {
                list = new List <FightNumber>();
                mFightDict.Add(ibit, list);
            }
            list = mFightDict[ibit];

            for (int index = 0; index < list.Count; index++)
            {
                if (!list[index].isShowing)
                {
                    ret = list[index];
                }
            }

            if (ret == null)
            {
                ret = UI_ShowPanel.inst.CreateFightNumber(type);
                list.Add(ret);
            }

            return(ret);
        }
Exemplo n.º 2
0
        public void showNumber(int inum, HPNumberType type, Vector3 position)
        {
            string num  = inum.ToString();
            int    ibit = num.Length;

            FightNumberDict dict = null;

            if (!mNumberDict.ContainsKey(type))
            {
                dict = new FightNumberDict();
                mNumberDict.Add(type, dict);
            }
            dict = mNumberDict[type];

            FightNumber number = dict.GetNumber(ibit, type);

            if (number && !number.isShowing)
            {
                number.onStart(num, position);
            }
        }
Exemplo n.º 3
0
        public FightNumber CreateFightNumber(HPNumberType type)
        {
            GameObject obj = Instantiate(UI_ShowPanel.inst.numberObj) as GameObject;

            obj.transform.SetParent(transform, false);
            switch (type)
            {
            case HPNumberType.HP_ENEMY_HURT:
                return(obj.AddComponent <MonsterNumber>());

            case HPNumberType.HP_SELF_HURT:
                return(obj.AddComponent <HeroNumber>());

            case HPNumberType.HP_HEAL:
                return(obj.AddComponent <HealNumber>());

            case HPNumberType.HP_HEAVY:
                return(obj.AddComponent <HeavyNumber>());

            case HPNumberType.HP_MISS:
                return(obj.AddComponent <MissNumber>());
            }
            return(null);
        }
Exemplo n.º 4
0
 private void onHPNumberCall(int inum, HPNumberType type, Vector3 position)
 {
     mNumberMgr.showNumber(inum, type, position);
 }