예제 #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
        }
예제 #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
        }
예제 #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
        }
예제 #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);
 }
예제 #5
0
        //-------------------------------------------------------------------------
        public void freeBackgroundStillSprite(StillSprite still_sprite)
        {
            if (still_sprite == null) return;
            //Resources.UnloadAsset(still_sprite.renderer.material.mainTexture);
            still_sprite.destroy();

            //Resources.UnloadUnusedAssets();
        }
예제 #6
0
 //-------------------------------------------------------------------------
 public virtual void destroy()
 {
     if (mSprite != null)
     {
         mScene.getRenderObjectPool().freeStillSprite(mSprite);
         mSprite = null;
     }
 }
예제 #7
0
 //-------------------------------------------------------------------------
 public virtual void destroy()
 {
     if (mSprite != null)
     {
         mScene.getRenderObjectPool().freeStillSprite(mSprite);
         mSprite = null;
     }
 }
예제 #8
0
 public SpriteBox(StillSprite sprite, bool horizontal_scale, bool vertical_scale, float width, float height)
 {
     mStillSprite     = sprite;
     mHorizontalScale = horizontal_scale;
     mVerticalScale   = vertical_scale;
     mFixedWidth      = width;
     mFixedHeight     = height;
 }
예제 #9
0
 //-------------------------------------------------------------------------
 void _freeShockBackground()
 {
     if (mShockBackgroundStillSprite == null)
     {
         return;
     }
     mBackgroundLoader.freeBackgroundStillSprite(mShockBackgroundStillSprite);
     mShockBackgroundStillSprite = null;
 }
예제 #10
0
        public void destroy()
        {
            destroyRectangle();
            mScene.getRenderObjectPool().freeStillSprite(mArrow);
            mScene.getRenderObjectPool().freeStillSprite(mNumber);

            mArrow = null;
            mNumber = null;
        }
예제 #11
0
        public void destroy()
        {
            destroyRectangle();
            mScene.getRenderObjectPool().freeStillSprite(mArrow);
            mScene.getRenderObjectPool().freeStillSprite(mNumber);

            mArrow  = null;
            mNumber = null;
        }
예제 #12
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            mLevelScreenShocker.destroy();
            mLevelBackgroundMgr.destroy();
            mLevelSeaStarMgr.destroy();

            if (mRippleBackgroundStillSprite == null) return;
            mRippleBackgroundStillSprite.destroy();
            mRippleBackgroundStillSprite = null;
        }
예제 #13
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());
 }
예제 #14
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);
        }
예제 #15
0
        //-------------------------------------------------------------------------
        public override void destroy()
        {
            if (mHasDestroy) return;
            mHasDestroy = true;
            if (mCSpriteFishNet != null) { mCSpriteFishNet.destroy(); }
            mScene.getRenderObjectPool().freeStillSprite(mStillSprite);

            mStillSprite = null;
            mCSpriteFishNet = null;
        }
예제 #16
0
        //-------------------------------------------------------------------------
        public void freeStillSprite(StillSprite still_sprite)
        {
#if UNITY_EDITOR
            if (still_sprite != null && still_sprite.GetType().ToString() == "FishStillSprite")
            {
                EbLog.Error("freeStillSprite::error");
            }
#endif

            mStillSpritePool.freeStillSprite(still_sprite);
        }
예제 #17
0
        //-------------------------------------------------------------------------
        public void freeBackgroundStillSprite(StillSprite still_sprite)
        {
            if (still_sprite == null)
            {
                return;
            }
            //Resources.UnloadAsset(still_sprite.renderer.material.mainTexture);
            still_sprite.destroy();

            //Resources.UnloadUnusedAssets();
        }
예제 #18
0
 //-------------------------------------------------------------------------
 bool notInList(StillSprite fish, List <FishStillSprite> fish_list)
 {
     foreach (var it in fish_list)
     {
         if (it == fish)
         {
             return(false);
         }
     }
     return(true);
 }
예제 #19
0
        //-------------------------------------------------------------------------
        public void freeStillSprite(StillSprite still_sprite)
        {
            #if UNITY_EDITOR
            if (still_sprite != null && still_sprite.GetType().ToString() == "FishStillSprite")
            {
                EbLog.Error("freeStillSprite::error");
            }
            #endif

            mStillSpritePool.freeStillSprite(still_sprite);
        }
예제 #20
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
        }
예제 #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
            }
예제 #22
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            mLevelScreenShocker.destroy();
            mLevelBackgroundMgr.destroy();
            mLevelSeaStarMgr.destroy();

            if (mRippleBackgroundStillSprite == null)
            {
                return;
            }
            mRippleBackgroundStillSprite.destroy();
            mRippleBackgroundStillSprite = null;
        }
예제 #23
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;
        }
예제 #24
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;
        }
예제 #25
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
        }
예제 #26
0
        //-------------------------------------------------------------------------
        public override void destroy()
        {
            if (mHasDestroy)
            {
                return;
            }
            mHasDestroy = true;
            if (mCSpriteFishNet != null)
            {
                mCSpriteFishNet.destroy();
            }
            mScene.getRenderObjectPool().freeStillSprite(mStillSprite);

            mStillSprite    = null;
            mCSpriteFishNet = null;
        }
예제 #27
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
        }
예제 #28
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);
        }
예제 #29
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
        }
예제 #30
0
        //-------------------------------------------------------------------------
        StillSprite _loadRippleStillSprite()
        {
            UnityEngine.Object prefab_object = Resources.Load("Game/Background/water_ani_movePrefab");
            GameObject         game_object   = GameObject.Instantiate(prefab_object) as GameObject;
            StillSprite        still_sprite  = game_object.GetComponent <StillSprite>();

            still_sprite.init(mScene);

#if UNITY_EDITOR
            still_sprite.gameObject.name = "TkSprite_Water_Wave";
            mTKGameObject = GameObject.Find("TKGameObject");
            still_sprite.transform.parent = mTKGameObject.transform;
            //still_sprite.transform.localScale = new Vector3(2.34f, 2.34f, 1);
#endif

            return(still_sprite);
        }
예제 #31
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;
        }
예제 #32
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;
        }
예제 #33
0
        public void load(float elapsed_tm)
        {
            if (mLoaded)
            {
                return;
            }

            for (int i = 0; i < 3 * mLoadCountPerSecond; i++)
            {
                StillSprite still_sprite = newStillSprite();
                mListPreloadStillSprite.Add(still_sprite);

#if UNITY_EDITOR
                still_sprite.gameObject.name = "TkSprite_Loading";
#endif
            }

            for (int i = 0; i < 1 * mLoadCountPerSecond; i++)
            {
                FishStillSprite fish_still_sprite = newFishStillSprite();
                mListPreloadFishStillSprite.Add(fish_still_sprite);

#if UNITY_EDITOR
                fish_still_sprite.gameObject.name = "TkFish_Loading";
#endif
            }

            mProgress = (float)mListPreloadFishStillSprite.Count / (float)mPreLoadCount;
            if (mListPreloadFishStillSprite.Count >= mPreLoadCount)
            {
                foreach (var it in mListPreloadStillSprite)
                {
                    freeStillSprite(it);
                }
                mListPreloadStillSprite.Clear();

                foreach (var it in mListPreloadFishStillSprite)
                {
                    freeFishStillSprite(it);
                }
                mListPreloadFishStillSprite.Clear();

                mProgress = 1;
                mLoaded   = true;
            }
        }
예제 #34
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
        }
예제 #35
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
        }
예제 #36
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
            }
        }
예제 #37
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
        }
예제 #38
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);
        }
예제 #39
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
        }
예제 #40
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));
            }
        }
예제 #41
0
 public abstract void freeDigitSprite(StillSprite digit_sprite);
예제 #42
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);
 }
예제 #43
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
        }
예제 #44
0
 //-------------------------------------------------------------------------
 public override void freeDigitSprite(StillSprite digit_sprite)
 {
     mScene.getRenderObjectPool().freeStillSprite(digit_sprite);
 }
예제 #45
0
 //-------------------------------------------------------------------------
 public override void freeDigitSprite(StillSprite digit_sprite)
 {
     mScene.getRenderObjectPool().freeStillSprite(digit_sprite);
 }
예제 #46
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
            }
예제 #47
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());
 }
예제 #48
0
 public SpriteAndOffset(StillSprite sprite, EbVector3 offset)
 {
     mStillSprite = sprite;
     mOffset = offset;
 }
예제 #49
0
 public SpriteAndOffset(StillSprite sprite, EbVector3 offset)
 {
     mStillSprite = sprite;
     mOffset      = offset;
 }
예제 #50
0
 public SpriteBox(StillSprite sprite, bool horizontal_scale, bool vertical_scale, float width, float height)
 {
     mStillSprite = sprite;
     mHorizontalScale = horizontal_scale;
     mVerticalScale = vertical_scale;
     mFixedWidth = width;
     mFixedHeight = height;
 }
예제 #51
0
 //-------------------------------------------------------------------------
 public void destroy()
 {
     mBackgroundLoader.freeBackgroundStillSprite(mBgSprite);
     mBgSprite = null;
     mBgClippedSprite = null;
 }
예제 #52
0
 //-------------------------------------------------------------------------
 void _freeShockBackground()
 {
     if (mShockBackgroundStillSprite == null) return;
     mBackgroundLoader.freeBackgroundStillSprite(mShockBackgroundStillSprite);
     mShockBackgroundStillSprite = null;
 }
예제 #53
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));
            }
        }
예제 #54
0
 //-------------------------------------------------------------------------
 bool notInList(StillSprite fish, List<FishStillSprite> fish_list)
 {
     foreach (var it in fish_list)
     {
         if (it == fish) return false;
     }
     return true;
 }
예제 #55
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
        }