Esempio n. 1
0
        //-------------------------------------------------------------------------
        //根据vib数据创建鱼的代码全部放在这里,ISpriteFish的实现类不在需要知道TbDataFish的任何事情?//
        public ISpriteFish buildSpriteFish(CRenderFish render_fish, int fish_vib_id)
        {
            TbDataFish  fish_data   = EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id);
            ISpriteFish sprite_fish = null;

            if (fish_data.Type == TbDataFish.FishType.Custom)
            {
                sprite_fish = new CSpriteCustomGroup();
            }
            else if (fish_data.Type == TbDataFish.FishType.EvenFour)
            {
                sprite_fish = new CSpriteEvenFourFish();
            }
            else if (fish_data.Type == TbDataFish.FishType.EvenFive)
            {
                sprite_fish = new CSpriteEvenFiveFish();
            }
            else
            {
                sprite_fish = new CSpriteFishGroup((int)fish_data.Type);
            }

            sprite_fish.create(mScene, fish_data);
            sprite_fish.setRenderFish(render_fish);
            sprite_fish.setTag("CSpriteFish");
            sprite_fish.setTrigger(true);
            sprite_fish.setLayer(mScene.getLayerAlloter().getFishLayer(fish_vib_id));

#if UNITY_EDITOR
            //ViDebuger.Warning("TkFish_vib_id_ " + fish_vib_id);
            sprite_fish.setGameobjectName("TkFish_vib_id_" + fish_vib_id);
#endif

            return(sprite_fish);
        }
Esempio n. 2
0
        //-------------------------------------------------------------------------
        //根据vib数据创建鱼的代码全部放在这里,ISpriteFish的实现类不在需要知道TbDataFish的任何事情?//
        public ISpriteFish buildSpriteFish(CRenderFish render_fish, int fish_vib_id)
        {
            TbDataFish fish_data = EbDataMgr.Instance.getData<TbDataFish>(fish_vib_id);
            ISpriteFish sprite_fish = null;

            if (fish_data.Type == TbDataFish.FishType.Custom)
            {
                sprite_fish = new CSpriteCustomGroup();
            }
            else if (fish_data.Type == TbDataFish.FishType.EvenFour)
            {
                sprite_fish = new CSpriteEvenFourFish();
            }
            else if (fish_data.Type == TbDataFish.FishType.EvenFive)
            {
                sprite_fish = new CSpriteEvenFiveFish();
            }
            else
            {
                sprite_fish = new CSpriteFishGroup((int)fish_data.Type);
            }

            sprite_fish.create(mScene, fish_data);
            sprite_fish.setRenderFish(render_fish);
            sprite_fish.setTag("CSpriteFish");
            sprite_fish.setTrigger(true);
            sprite_fish.setLayer(mScene.getLayerAlloter().getFishLayer(fish_vib_id));

            #if UNITY_EDITOR
            //ViDebuger.Warning("TkFish_vib_id_ " + fish_vib_id);
            sprite_fish.setGameobjectName("TkFish_vib_id_" + fish_vib_id);
            #endif

            return sprite_fish;
        }