예제 #1
0
파일: EffectMgr.cs 프로젝트: yinlei/Fishing
 //---------------------------------------------------------------------
 public CEffect buildByEffectElementData(TbDataEffectCompose.EffectElementStruct data, Dictionary<string, object> param, EffectTypeEnum effect_type)
 {
     string effect_name = data.EffectName.EffectName;
     if (mDicEffectFactory.ContainsKey(effect_name))
     {
         if (mDicEffectFactory[effect_name].getEffectType() != effect_type) return null;
         CEffect effect_component = mDicEffectFactory[effect_name].createEffect(param);
         effect_component.setEffectElementData(data.EffectId, effect_name, (TbDataEffectCompose.EffectElementStruct.EffectTypeEnum)data.EffectType, data.EffectDelayTime * 0.01f);
         effect_component.create(param);
         effect_component.setName(effect_name);
         return effect_component;
     }
     return null;
 }
예제 #2
0
파일: EffectMgr.cs 프로젝트: yinlei/Fishing
 //---------------------------------------------------------------------
 public void setEffectElementData(int effect_id, string effect_name, TbDataEffectCompose.EffectElementStruct.EffectTypeEnum effect_type, float delay_time)
 {
     mEffectId = effect_id;
     mEffectName = effect_name;
     mEffectType = effect_type;
     mDelayTime = delay_time;
 }
예제 #3
0
        //-------------------------------------------------------------------------
        public override void load(EbPropSet prop_set)
        {
            Name = prop_set.getPropString("T_Name").get();
            var prop_state = prop_set.getPropInt("I_State");

            State           = prop_state == null ? DataState.Default : (DataState)prop_state.get();
            FishAnimMove    = prop_set.getPropString("T_FishAnimMove").get();
            FishAnimDie     = prop_set.getPropString("T_FishAnimDie").get();
            FishLevel       = prop_set.getPropInt("I_FishLevel").get();
            FishDieChance   = prop_set.getPropInt("I_FishDieChance").get();
            FishSpeed       = prop_set.getPropInt("I_FishSpeed").get();
            FishHitPoint    = prop_set.getPropInt("I_FishHitPoint").get();
            FishScore       = prop_set.getPropInt("I_FishScore").get();
            FishPixelHeight = prop_set.getPropInt("I_FishPixelHeight").get();
            FishHeight      = prop_set.getPropInt("I_FishHeight").get();
            FishNetCount    = prop_set.getPropInt("I_FishNetCount").get();
            //FishTrackPoint = prop_set.getPropString("T_FishTrackPoint").get();
            FishDepth = prop_set.getPropInt("I_FishNetCount").get();

            Effects = new List <TbDataEffectCompose>();
            string strEffects = prop_set.getPropString("T_EffectsFishEffectCompose").get();

            string[] arrayEffects = strEffects.Split(';');
            foreach (string str in arrayEffects)
            {
                TbDataEffectCompose dataEffectCompose = EbDataMgr.Instance.getData <TbDataEffectCompose>(int.Parse(str));
                if (null != dataEffectCompose)
                {
                    Effects.Add(dataEffectCompose);
                }
            }

            var prop_red = prop_set.getPropInt("I_Red");

            Red = prop_red == null ? IsRed.Default : (IsRed)prop_red.get();
            var prop_type = prop_set.getPropInt("I_Type");

            Type = prop_type == null ? FishType.Default : (FishType)prop_type.get();
            var prop_displayscoretype = prop_set.getPropInt("I_FishDisplayScoreType");

            FishDisplayScoreType = prop_displayscoretype == null ? _eDisplayScoreType.Default : (_eDisplayScoreType)prop_displayscoretype.get();
            var prop_canhitbyfishnet = prop_set.getPropInt("I_mCanHitByFishNet");

            mCanHitByFishNet   = prop_canhitbyfishnet == null ? CanHitByFishNet.Default : (CanHitByFishNet)prop_canhitbyfishnet.get();
            FishMinScore       = prop_set.getPropInt("I_FishMinScore").get();
            FishMaxScore       = prop_set.getPropInt("I_FishMaxScore").get();
            OutFishWeight      = prop_set.getPropInt("I_OutFishWeight").get();
            OutFishUpperBound  = prop_set.getPropInt("I_OutFishUpperBound").get();
            CycleAnimationName = prop_set.getPropString("T_CycleAnimationName").get();
            CyclePixelHeight   = prop_set.getPropInt("I_CyclePixelHeight").get();
            CycleHeight        = prop_set.getPropInt("I_CycleHeight").get();
            var prop_isfullscreen = prop_set.getPropInt("I_IsFullScreenAnimation");

            IsFullScreenAnimation = prop_isfullscreen == null ? IsFullScreen.Default : (IsFullScreen)prop_isfullscreen.get();
            FishCompose           = EbDataMgr.Instance.getData <TbDataFishCompose>(prop_set.getPropInt("I_FishCompose").get());
            LockFishWeight        = prop_set.getPropInt("I_LockFishWeight").get();
            LockCardFishScale     = prop_set.getPropInt("I_LockCardFishScale").get();

            ParticleArray = new List <ParticleDataStruct>();
            for (int i = 1; i <= 10; ++i)
            {
                string             strParticles       = prop_set.getPropString("T_ParticleArray" + i.ToString()).get();
                string[]           arrayStrParticles  = strParticles.Split(';');
                ParticleDataStruct particleDataStruct = new ParticleDataStruct();
                particleDataStruct.TbDataParticle      = EbDataMgr.Instance.getData <TbDataParticle>(int.Parse(arrayStrParticles[0]));
                particleDataStruct.ParticleProduceTime = string.IsNullOrEmpty(arrayStrParticles[1]) ? ParticleProduceTimeEnum.Default : (ParticleProduceTimeEnum)int.Parse(arrayStrParticles[1]);

                particleDataStruct.StartPoint = new ParticlePointStruct();
                particleDataStruct.StartPoint.ParticlePointType = string.IsNullOrEmpty(arrayStrParticles[2]) ? ParticlePointStruct.ParticlePointTypeEnum.Default : (ParticlePointStruct.ParticlePointTypeEnum) int.Parse(arrayStrParticles[2]);
                particleDataStruct.StartPoint.x = int.Parse(arrayStrParticles[3]);
                particleDataStruct.StartPoint.y = int.Parse(arrayStrParticles[4]);

                particleDataStruct.TargetPoint = new ParticlePointStruct();
                particleDataStruct.TargetPoint.ParticlePointType = string.IsNullOrEmpty(arrayStrParticles[5]) ? ParticlePointStruct.ParticlePointTypeEnum.Default : (ParticlePointStruct.ParticlePointTypeEnum) int.Parse(arrayStrParticles[5]);
                particleDataStruct.TargetPoint.x = int.Parse(arrayStrParticles[6]);
                particleDataStruct.TargetPoint.y = int.Parse(arrayStrParticles[7]);

                ParticleArray.Add(particleDataStruct);
            }

            FishEvenFour = EbDataMgr.Instance.getData <TbDataFishEvenFour>(prop_set.getPropInt("I_FishEvenFour").get());
            FishEvenFive = EbDataMgr.Instance.getData <TbDataFishEvenFive>(prop_set.getPropInt("I_FishEvenFive").get());
            var prop_fishroutecategory = prop_set.getPropInt("I_FishRouteCategory");

            fishRouteCategory = prop_fishroutecategory == null ? FishRouteCategory.Default : (FishRouteCategory)prop_fishroutecategory.get();
            TurnplateParticle = EbDataMgr.Instance.getData <TbDataParticle>(prop_set.getPropInt("I_TurnplateParticle").get());
            dataOutFishGroup  = EbDataMgr.Instance.getData <TbDataOutFishGroup>(prop_set.getPropInt("I_OutFishGroupData").get());
            FishPropKey       = prop_set.getPropString("T_FishPropKey").get();
            FishIcon          = prop_set.getPropString("T_FishIcon").get();
            var prop_fishdietype = prop_set.getPropInt("I_FishDieType");

            FishDieType     = prop_fishdietype == null ? FishDieTypeEnum.Default : (FishDieTypeEnum)prop_fishdietype.get();
            ChainFishNumber = prop_set.getPropInt("I_ChainFishNumber").get();
            ChainFish       = EbDataMgr.Instance.getData <TbDataFish>(prop_set.getPropInt("I_ChainFish").get());


            if (null != prop_set.getPropString("T_CoinParticle"))
            {
                CoinParticleStruct coinParticleStruct         = new CoinParticleStruct();
                string             strCointParticleDatas      = prop_set.getPropString("T_CoinParticle").get();
                string[]           arrayStrCointParticleDatas = strCointParticleDatas.Split(';');
                if (arrayStrCointParticleDatas.Length == 3)
                {
                    coinParticleStruct.CointParticleData = EbDataMgr.Instance.getData <TbDataParticle>(int.Parse(arrayStrCointParticleDatas[0]));
                    coinParticleStruct.CointCount        = int.Parse(arrayStrCointParticleDatas[1]);
                    coinParticleStruct.Radius            = int.Parse(arrayStrCointParticleDatas[2]);
                    mCoinParticle = coinParticleStruct;
                }
            }
        }