Exemplo n.º 1
0
 //---------------------------------------------------------------------
 public EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     string type_name = affector_data.GetType().ToString();
     if (mDicAffectorFactory.ContainsKey(type_name))
     {
         return mDicAffectorFactory[type_name].buildAffector(affector_data);
     }
     else
     {
         EbLog.Error(@"BaseFishLordMgr::buildAffector::error::there are no " + type_name + " factory");
         return null;
     }
 }
Exemplo n.º 2
0
        //---------------------------------------------------------------------
        public EntityAffector buildAffector(EntityAffectorData affector_data)
        {
            string type_name = affector_data.GetType().ToString();

            if (mDicAffectorFactory.ContainsKey(type_name))
            {
                return(mDicAffectorFactory[type_name].buildAffector(affector_data));
            }
            else
            {
                EbLog.Error(@"BaseFishLordMgr::buildAffector::error::there are no " + type_name + " factory");
                return(null);
            }
        }
        //---------------------------------------------------------------------
        public ParticleSystemDataPrototype(List <JsonPacket> json_packet_list, ParticleSystemFactory factory)
        {
            mParticleSystemFactory = factory;

            foreach (var json_packet in json_packet_list)
            {
                // 根据Json字符串来生成BaseFishLordData
                BaseFishLordDataJson     fish_lord_json = BaseJsonSerializer.deserialize <BaseFishLordDataJson>(json_packet.JsonString);
                EntityParticleSystemData fish_lord      = new EntityParticleSystemData();

                // 根据Json字符串来生成
                fish_lord.mFishLordCommonData = BaseJsonSerializer.deserialize <FishLordCommonData>
                                                    (fish_lord_json.mFishLordCommonDataString);

                // 根据Json字符串来生成BaseGeneratorData
                foreach (var it in fish_lord_json.mListBaseGenerator)
                {
                    EntityGeneratorData generator_data = mParticleSystemFactory.buildGeneratorData(it);
                    if (generator_data == null)
                    {
                        continue;
                    }
                    fish_lord.mListBaseGenerator.Add(generator_data);
                }

                // 根据Json字符串来生成BaseAffectorData
                foreach (var it in fish_lord_json.mListBaseAffector)
                {
                    EntityAffectorData affector_data = mParticleSystemFactory.buildAffectorData(it);
                    if (affector_data == null)
                    {
                        continue;
                    }
                    fish_lord.mListBaseAffector.Add(affector_data);
                }

                // 读出特效发射器和影响器的映射表。
                fish_lord.mGeneratorAffectorMap = BaseJsonSerializer.deserialize <List <GeneratorAffectorkeyValuePair> >
                                                      (fish_lord_json.mGeneratorAffectorMapString);

                mDicBaseFishLordDataPrototype.Add(json_packet.FileName.Substring(json_packet.FileName.LastIndexOf("/") + 1), fish_lord);
            }
        }
Exemplo n.º 4
0
 public abstract EntityAffector buildAffector(EntityAffectorData affector_data);
Exemplo n.º 5
0
 //---------------------------------------------------------------------
 public override EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     return(new AddRandomRouteAffector((AddRandomRouteAffectorData)affector_data));
 }
Exemplo n.º 6
0
 //---------------------------------------------------------------------
 public override EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     return(new StopAffector((StopAffectorData)affector_data));
 }
Exemplo n.º 7
0
 public abstract EntityAffector buildAffector(EntityAffectorData affector_data);
Exemplo n.º 8
0
 //---------------------------------------------------------------------
 public EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     return(mParticleSystemFactory.buildAffector(affector_data));
 }
Exemplo n.º 9
0
 //---------------------------------------------------------------------
 public override EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     return(new AngleSpeedAffector((AngleSpeedAffectorData)affector_data));
 }
Exemplo n.º 10
0
 //---------------------------------------------------------------------
 public EntityAffector buildAffector(EntityAffectorData affector_data)
 {
     return mParticleSystemFactory.buildAffector(affector_data);
 }