示例#1
0
        //-------------------------------------------------------------------------
        public void create(CRenderScene scene, TbDataFish vib_fish_data)
        {
            mScene        = scene;
            mVibFishData  = vib_fish_data;
            mFishCycleGap = mScene.getLayerAlloter().EachFishGap / 10f;

            if (mVibFishData.Type == TbDataFish.FishType.Custom)
            {
                mCycle = mScene.getRenderObjectPool().newFishStillSprite();
                mCycle.init(this, scene);
                mCycle.playAnimation(mVibFishData.FishCompose.BackGroundAniName);
                mCycle.setScale((float)mVibFishData.FishCompose.BackGroundAnimationScale / 100.0f);
                foreach (var it in mVibFishData.FishCompose.FishComposes)
                {
                    if (null != it && it.Id > 0)
                    {
                        TbDataFish      fish_data   = EbDataMgr.Instance.getData <TbDataFish>(it.FishVibId);
                        FishStillSprite fish_sprite = mScene.getRenderObjectPool().newFishStillSprite();

                        fish_sprite.init(this, scene);
                        fish_sprite.playAnimation(fish_data.FishAnimMove);
                        fish_sprite.setScale(mFixFishScale * (float)fish_data.FishHeight / (float)fish_data.FishPixelHeight);

                        mFishs.Add(new FishSpriteAndOffset(
                                       fish_sprite,
                                       new EbVector3(it.OffsetX, it.OffsetY, 0),
                                       fish_data.FishAnimDie));
                    }
                }
            }
        }
示例#2
0
        //-------------------------------------------------------------------------
        protected FishStillSprite _loadFishStillSprite(string animation_name, float scale = 1f)
        {
            FishStillSprite fish_sprite = mScene.getRenderObjectPool().newFishStillSprite();

            fish_sprite.init(this, mScene);
            fish_sprite.setScale(scale);
            fish_sprite.playAnimation(animation_name);
            return(fish_sprite);
        }