Exemplo n.º 1
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
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------
        void _initCSprite(string name, string tag)
        {
            if (mAnimationName == "")
            {
                return;
            }

            mSprite = mScene.getRenderObjectPool().newStillSprite();
            mSprite.setTag(tag);
            mSprite.playAnimation(mAnimationName);
            mSprite.setScale(1f);
            mSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Buffer));
            //if (name == "BufLock")
            //{
            //    mSprite.setScale(0.47f);
            //}
            //else
            //{
            //    mSprite.setScale(0.38f * 2.7f);
            //}

#if UNITY_EDITOR
            mSprite.gameObject.name = "TkSpriteBuffer_" + name;
#endif
        }
Exemplo n.º 3
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
        }
Exemplo n.º 4
0
 //-------------------------------------------------------------------------
 void _initRippleBackground()
 {
     mRippleBackgroundStillSprite = _loadRippleStillSprite();
     mRippleBackgroundStillSprite.setPosition(new EbVector3(-mScene.getSceneLength() / 2, -mScene.getSceneWidth() / 2, 0));
     mRippleBackgroundStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Wave));
     mRippleBackgroundStillSprite.setActive(false);
 }
Exemplo n.º 5
0
 //-------------------------------------------------------------------------
 public virtual void setPosition(EbVector3 position, float angle)
 {
     if (mSprite != null)
     {
         mSprite.setPosition(position);
         mSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Buffer));
         mSprite.setDirection(angle);
     }
 }
Exemplo n.º 6
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());
 }
Exemplo n.º 7
0
        //-------------------------------------------------------------------------
        void _newShockBackground(string background_name)
        {
            mShockBackgroundStillSprite = mBackgroundLoader.newBackgroundStillSprite(background_name, mScene);
            mShockBackgroundStillSprite.setPosition(EbVector3.Zero);
            mShockBackgroundStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.ShockBackground));
            mShockBackgroundStillSprite.setActive(false);

#if UNITY_EDITOR
            mShockBackgroundStillSprite.gameObject.name = "TkBackground";
#endif
        }
Exemplo n.º 8
0
            //-------------------------------------------------------------------------
            public void load(string prefab_name, _eLevelLayer layer)
            {
                mBgSprite = mBackgroundLoader.newBackgroundStillSprite(prefab_name, mScene);
                mBgSprite.setPosition(EbVector3.Zero);
                mBgSprite.setDirection(0);
                mBgSprite.setLayer(mScene.getLayerAlloter().getLayer(layer));
                mBgClippedSprite = mBgSprite.gameObject.GetComponent <tk2dClippedSprite>();

#if UNITY_EDITOR
                mBgSprite.gameObject.name = "TkBackground";
#endif
            }
Exemplo n.º 9
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
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
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
            }
        }
Exemplo n.º 12
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
        }
Exemplo n.º 13
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
        }
Exemplo n.º 14
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));
            }
        }
Exemplo n.º 15
0
        //-------------------------------------------------------------------------
        void _newShockBackground(string background_name)
        {
            mShockBackgroundStillSprite = mBackgroundLoader.newBackgroundStillSprite(background_name, mScene);
            mShockBackgroundStillSprite.setPosition(EbVector3.Zero);
            mShockBackgroundStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.ShockBackground));
            mShockBackgroundStillSprite.setActive(false);

            #if UNITY_EDITOR
            mShockBackgroundStillSprite.gameObject.name = "TkBackground";
            #endif
        }
Exemplo n.º 16
0
 //-------------------------------------------------------------------------
 public void setLayer(float layer)
 {
     mStillSprite.setLayer(layer);
 }
Exemplo n.º 17
0
        //-------------------------------------------------------------------------
        void _initCSprite(string name, string tag)
        {
            if (mAnimationName == "") return;

            mSprite = mScene.getRenderObjectPool().newStillSprite();
            mSprite.setTag(tag);
            mSprite.playAnimation(mAnimationName);
            mSprite.setScale(1f);
            mSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Buffer));
            //if (name == "BufLock")
            //{
            //    mSprite.setScale(0.47f);
            //}
            //else
            //{
            //    mSprite.setScale(0.38f * 2.7f);
            //}

            #if UNITY_EDITOR
            mSprite.gameObject.name = "TkSpriteBuffer_" + name;
            #endif
        }
Exemplo n.º 18
0
 //-------------------------------------------------------------------------
 public void setBgPosition(EbVector3 position, float up_angle)
 {
     mBackground.setPosition(position);
     mBackground.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.TurretScoreBg));
     mBackground.setDirection(up_angle);
 }
Exemplo n.º 19
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());
 }
Exemplo n.º 20
0
 //-------------------------------------------------------------------------
 void _initRippleBackground()
 {
     mRippleBackgroundStillSprite = _loadRippleStillSprite();
     mRippleBackgroundStillSprite.setPosition(new EbVector3(-mScene.getSceneLength() / 2, -mScene.getSceneWidth() / 2, 0));
     mRippleBackgroundStillSprite.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Wave));
     mRippleBackgroundStillSprite.setActive(false);
 }
Exemplo n.º 21
0
            //-------------------------------------------------------------------------
            public void load(string prefab_name, _eLevelLayer layer)
            {
                mBgSprite = mBackgroundLoader.newBackgroundStillSprite(prefab_name, mScene);
                mBgSprite.setPosition(EbVector3.Zero);
                mBgSprite.setDirection(0);
                mBgSprite.setLayer(mScene.getLayerAlloter().getLayer(layer));
                mBgClippedSprite = mBgSprite.gameObject.GetComponent<tk2dClippedSprite>();

                #if UNITY_EDITOR
                mBgSprite.gameObject.name = "TkBackground";
                #endif
            }