Пример #1
0
 //-------------------------------------------------------------------------
 public void destroy()
 {
     foreach (var it in mStillSpriteList)
     {
         mScene.getRenderObjectPool().freeStillSprite(it.mStillSprite);
         it.mStillSprite = null;
     }
     mStillSpriteList.Clear();
 }
Пример #2
0
    void initFish(string animation, EbVector3 offset, float angle_speed, float layer_offset, ISpriteFish sprite_fish)
    {
        SpriteAndOffset sprite_offset =
            new SpriteAndOffset(mScene.getRenderObjectPool().newFishStillSprite(),
                                EbVector3.Zero, angle_speed, layer_offset);

        sprite_offset.mFishStillSprite.init(sprite_fish, mScene);
        sprite_offset.mFishStillSprite.playAnimation(animation);
        mSprite.Add(sprite_offset);
    }
Пример #3
0
    //-------------------------------------------------------------------------
    public void destroy()
    {
        endGlow();

        mScene.getRenderObjectPool().freeStillSprite(mTurretBaseSprite);
        mScene.getRenderObjectPool().freeStillSprite(mTurretTopSprite);
        mScene.getRenderObjectPool().freeStillSprite(mTurretBlazeSprite);
        mScene.getRenderObjectPool().freeStillSprite(mTurretBarrelSprite);

        mTurretBaseSprite   = null;
        mTurretTopSprite    = null;
        mTurretBlazeSprite  = null;
        mTurretBarrelSprite = null;
    }
Пример #4
0
    void _newChip()
    {
        StillSprite still_sprite = mScene.getRenderObjectPool().newStillSprite();

        still_sprite.playAnimation("chip");
        still_sprite.setScale(mScene.getRenderConfigure().ChipSacle);
        still_sprite.setLayer(mHeapLayer);
        mStackChips.Add(still_sprite);


#if UNITY_EDITOR
        still_sprite.gameObject.name = "TkSpriteChips_chip";
#endif

        _updateChipsView(mHeapScruct.Position, mHeapScruct.UpAngle);
    }
Пример #5
0
    //-------------------------------------------------------------------------
    public LevelBackgroundMgr(CRenderScene scene, CSpriteBackgroundLoader loader)
    {
        mScene            = scene;
        mBackgroundLoader = loader;

        mSpeed = 960f / mMaxTime;

        mWaveStillSprite = mScene.getRenderObjectPool().newStillSprite();
        mWaveStillSprite.playAnimation("WaterWave");
        mWaveStillSprite.setActive(false);
        mWaveStillSprite.setScale(700f / 550f);

#if UNITY_EDITOR
        mWaveStillSprite.gameObject.name = "TkSpriteWaterWave";
#endif
    }
Пример #6
0
    //-------------------------------------------------------------------------
    public void create(CRenderScene scene, CRenderBullet render_bullet, string animation_name, TbDataParticle hit_particle)
    {
        mScene       = scene;
        mBullet      = render_bullet;
        mHitParticle = hit_particle;

        mStillSprite = mScene.getRenderObjectPool().newStillSprite();
        mStillSprite.setTrigger(true);
        mStillSprite.playAnimation(animation_name);
        mStillSprite.onTriggerEnter += OnTriggerEnter;

#if UNITY_EDITOR
        mStillSprite.gameObject.name = "TkSpriteBullet_" + animation_name;
#endif

        mBoxY = mStillSprite.getBoxColliderSize().y;
    }
Пример #7
0
    //-------------------------------------------------------------------------
    public CSpriteScore(CRenderScene scene, EbVector3 position, float angle, int turret_no)
    {
        mScene = scene;

        mSpriteNumber = new CSpriteNumber(mScene, new CPanelDigitFactory(mScene));
        mSpriteNumber.create(0, position, angle, CSpriteNumber._eNumberSize.Small1, CSpriteNumber._eNumberAlign.Right);
        mSpriteNumber.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScore));
        mBackground = mScene.getRenderObjectPool().newStillSprite();
        mBackground.playAnimation("score_panel_" + turret_no);
        mBackground.setScale(1, 1f);

        setScore(0);

#if UNITY_EDITOR
        mBackground.gameObject.name = "TkSpriteSpriteScore_score_panel_" + turret_no;
#endif
    }
Пример #8
0
    //-------------------------------------------------------------------------
    public CSpriteBgNumber(CRenderScene scene, BgColorEnum color, int number)
    {
        mScene = scene;
        float number_layer = mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScore);

        mCSpriteNumber = new CSpriteNumber(mScene, new CPanelDigitFactory(mScene));
        mCSpriteNumber.create(number, EbVector3.Zero, 0, CSpriteNumber._eNumberSize.Small2);
        mCSpriteNumber.setLayer(number_layer);

        mNumberBackgroundCSprite = mScene.getRenderObjectPool().newStillSprite();

        mNumberBackgroundCSprite.setLayer(number_layer + mScene.getLayerAlloter().EachFishGap / 100f);
        mNumberBackgroundCSprite.setScale(0.65f * number.ToString().Length, 0.8f);

        mNumberBackgroundCSprite.playAnimation(getAnimationNameByColor(color));

#if UNITY_EDITOR
        mNumberBackgroundCSprite.gameObject.name = "TkSpriteChips_" + getAnimationNameByColor(color);
#endif
    }
Пример #9
0
 //-------------------------------------------------------------------------
 public void destroy()
 {
     mStillSprite.onTriggerEnter -= OnTriggerEnter;
     mScene.getRenderObjectPool().freeStillSprite(mStillSprite);
 }
Пример #10
0
 StillSprite newStillSprite()
 {
     return(mScene.getRenderObjectPool().newStillSprite());
 }
Пример #11
0
 //-------------------------------------------------------------------------
 public void destroy()
 {
     mCSpriteNumber.destroy();
     mScene.getRenderObjectPool().freeStillSprite(mNumberBackgroundCSprite);
 }
Пример #12
0
 //-------------------------------------------------------------------------
 public void release()
 {
     mSpriteNumber.destroy();
     mScene.getRenderObjectPool().freeStillSprite(mBackground);
 }