示例#1
0
 //-------------------------------------------------------------------------
 public void reloadAnimation()
 {
     mTurretBarrelSprite.playAnimation(mRenderTurret.getVibTurret().TurretBarrelAnimationName);
     mTurretBaseSprite.playAnimation(mRenderTurret.getVibTurret().TurretBaseAnimationName);
     mTurretTopSprite.playAnimation(mRenderTurret.getVibTurret().TurretTopCoverAnimationName);
     mTurretBlazeSprite.playAnimation(mRenderTurret.getVibTurret().TurretFireBlazeAnimationName);
 }
示例#2
0
        public LinkLockedFishFeature(CRenderScene scene, CRenderTurret turret)
        {
            mCRenderTurret = turret;
            mScene         = scene;

            mLayer = mScene.getLayerAlloter().getLayer(_eLevelLayer.LinkLockedFish);

            mArrow = mScene.getRenderObjectPool().newStillSprite();
            mArrow.setScale(0.5f);
            mArrow.playAnimation("locking_line_array");
            mArrow.setColor(mCRenderTurret.getTurretColor());
            mArrow.setLayer(mLayer);

            mNumber = mScene.getRenderObjectPool().newStillSprite();
            mNumber.setScale(1f);
            mNumber.playAnimation("locking_line_target_" + mCRenderTurret.getTurretId());
            mNumber.setColor(mCRenderTurret.getTurretColor());

            mNumber.setLayer(mLayer);

            setActive(false);

#if UNITY_EDITOR
            mArrow.gameObject.name  = "TkSpriteLinkLocked_locking_line_array";
            mNumber.gameObject.name = "TkSpriteLinkLocked_locking_line_target_" + mCRenderTurret.getTurretId();
#endif
        }
示例#3
0
    StillSprite _newStillSprite()
    {
        StillSprite still_sprite = mScene.getRenderObjectPool().newStillSprite();

        still_sprite.playAnimation("Fishnet11");
#if UNITY_EDITOR
        still_sprite.gameObject.name = "TkSpriteFishNet";
#endif
        return(still_sprite);
    }
示例#4
0
 //-------------------------------------------------------------------------
 void _initTurretUnit(ref StillSprite still_sprite, string animation_name, float scale, _eLevelLayer layer)
 {
     still_sprite = mScene.getRenderObjectPool().newStillSprite();
     still_sprite.playAnimation(animation_name);
     still_sprite.setScale(scale);
     still_sprite.setLayer(mScene.getLayerAlloter().getLayer(layer));
     still_sprite.setPosition(mRenderTurret.getTurretPos());
     still_sprite.setDirection(mScene.getTurretHelper().getBaseAngleByTurretId(mRenderTurret.getTurretId()));
     still_sprite.setTag("CSpriteTurret" + mRenderTurret.getTurretId());
 }
示例#5
0
        void newRectangleSprite()
        {
            StillSprite sprite = mScene.getRenderObjectPool().newStillSprite();

            sprite.playAnimation("locking_line_rectangle");
            sprite.setColor(mCRenderTurret.getTurretColor());
            sprite.setScale(0.5f);
            sprite.setLayer(mLayer);
            mRectangle.Add(sprite);

#if UNITY_EDITOR
            sprite.gameObject.name = "TkSpriteLinkLocked_locking_line_rectangle";
#endif
        }
示例#6
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
    }
示例#7
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);
    }
示例#8
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;
    }
示例#9
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
    }
示例#10
0
        //-------------------------------------------------------------------------
        void create(EbVector3 cur_pos)
        {
            string animation_name = "";

            float scale_x = 1f;
            float scale_y = 1f;
            float width_x = 10f;
            float width_y = 60f;

            if (mScene.getLevel().getRandoNumber(0, 100) < 50)
            {
                animation_name = "lightening-yellow";
                scale_y        = width_y / 132f;
                width_x        = 360f;
            }
            else
            {
                animation_name = "lightning-green";
                scale_y        = width_y / 85f;
                width_x        = 420f;
            }
            foreach (var n in fish_list)
            {
                float distance = n.Position.getDistance(cur_pos);
                if (distance > 1100)
                {
                    continue;
                }
                EbVector3   middle_pos   = EbVector3.lerp(n.Position, cur_pos, 0.5f);
                StillSprite still_sprite = mScene.getRenderObjectPool().newStillSprite();
                still_sprite.setPosition(middle_pos);
                still_sprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.FishSwim));

                still_sprite.setDirection(CLogicUtility.getAngle(CLogicUtility.getVector2ByRotateAngle(cur_pos - n.Position, 90)));
                still_sprite.setScale(n.Position.getDistance(cur_pos) / width_x, scale_y);

                still_sprite.playAnimation(animation_name);

                mListLight.Add(still_sprite);

#if UNITY_EDITOR
                still_sprite.gameObject.name = "TkSpriteEffectLighting_" + animation_name;
#endif
            }
        }
示例#11
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
    }
示例#12
0
    //-------------------------------------------------------------------------
    public override StillSprite newDigitSprite(int digit)
    {
        if (digit < 0)
        {
            digit = 0;
        }
        if (digit > 9)
        {
            digit = 9;
        }
        StillSprite still_sprite = mScene.getRenderObjectPool().newStillSprite();

        still_sprite.playAnimation("digit_panel_" + digit);

#if UNITY_EDITOR
        still_sprite.gameObject.name = "TkSpritePanelDigit_" + digit;
#endif

        return(still_sprite);
    }
示例#13
0
        //-------------------------------------------------------------------------
        void buildFrame(string pic_name, float scale, int vib_id)
        {
            mPicName = pic_name;
            vmVibId  = vib_id;

            if ((vib_id == 1 || vib_id == 2 || vib_id == 3 || vib_id == 4) && mMapParam.ContainsKey("NetColor"))
            {
                mAnimationName  = pic_name;
                mCSpriteFishNet = new CSpriteFishNet();
                Color color           = (Color)mMapParam["NetColor"];
                uint  et_player_rpcid = (uint)mMapParam["PlayerId"];
                mCSpriteFishNet.create(color, et_player_rpcid, (CRenderFish)mMapParam["BulletHitFish"], mScene, mAnimationName);
                mCSpriteFishNet.setScale(scale);
            }
            else
            {
                mStillSprite = mScene.getRenderObjectPool().newStillSprite();
                mStillSprite.setScale(scale);
                mStillSprite.playAnimation(pic_name);

#if UNITY_EDITOR
                mStillSprite.gameObject.name = "TkSpriteEffectFrameAnimation_" + pic_name;
#endif
            }

            EbVector3 v2 = (EbVector3)mMapParam["SourcePosition"];

            if (mCSpriteFishNet != null)
            {
                mCSpriteFishNet.setPosition(v2, 0);
                mCSpriteFishNet.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.FishNet));
            }
            if (mStillSprite != null)
            {
                mStillSprite.setPosition(v2);
                mStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.FishNet));
            }
        }
示例#14
0
 //-------------------------------------------------------------------------
 public void playAnimation(string name)
 {
     mStillSprite.playAnimation(name);
 }