コード例 #1
0
 private void TriggerGoodsAttachEffectPattern(MonoGoods entity)
 {
     if (!string.IsNullOrEmpty(entity.AttachEffectPattern))
     {
         bool flag = true;
         switch (GraphicsSettingData.GetGraphicsRecommendGrade())
         {
         case GraphicsRecommendGrade.Off:
         case GraphicsRecommendGrade.Low:
         {
             ConfigGraphicsPersonalSetting personalGraphicsSetting = Singleton <MiHoYoGameData> .Instance.GeneralLocalData.PersonalGraphicsSetting;
             if (!personalGraphicsSetting.IsUserDefinedGrade)
             {
                 flag = false;
             }
             else if (personalGraphicsSetting.RecommendGrade != GraphicsRecommendGrade.High)
             {
                 flag = false;
             }
             break;
         }
         }
         if (flag)
         {
             Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(entity.AttachEffectPattern, entity, true);
         }
     }
 }
コード例 #2
0
        public uint CreateMaterialItem(uint ownerID, int metaId, Vector3 initPos, Vector3 initDir, bool actDropAnim, int level = 1)
        {
            int rarity = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(metaId, 1).rarity;

            string type = (rarity > 2) ? "MaterialItem_02" : "MaterialItem_01";
            BaseMonoDynamicObject entity = this.CreateDynamicObjectEntityInstance(ownerID, type, initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());
            MonoGoods             goods  = entity as MonoGoods;

            goods.actDropAnim    = actDropAnim;
            goods.DropItemMetaID = metaId;
            goods.DropItemLevel  = level;
            goods.DropItemNum    = 1;
            if (!string.IsNullOrEmpty(goods.InsideEffectPattern))
            {
                List <MonoEffect> list = Singleton <EffectManager> .Instance.TriggerEntityEffectPatternReturnValue(goods.InsideEffectPattern, entity, true);

                int num2  = 0;
                int count = list.Count;
                while (num2 < count)
                {
                    this.SetParticleColorByRarity(list[num2].gameObject, rarity);
                    num2++;
                }
            }
            EquipItemActor actor = Singleton <EventManager> .Instance.CreateActor <EquipItemActor>(entity);

            actor.rarity = rarity;
            return(actor.runtimeID);
        }
コード例 #3
0
        public uint CreateCoin(uint ownerID, Vector3 initPos, Vector3 initDir, float scoinReward, bool actDropAnim)
        {
            MonoGoods entity = this.CreateDynamicObjectEntityInstance <MonoGoods>(ownerID, "Coin", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.actDropAnim = actDropAnim;
            this.TriggerGoodsAttachEffectPattern(entity);
            CoinActor actor = Singleton <EventManager> .Instance.CreateActor <CoinActor>(entity);

            actor.scoinReward = scoinReward;
            return(actor.runtimeID);
        }
コード例 #4
0
        public uint CreateHPMedic(uint ownerID, Vector3 initPos, Vector3 initDir, float healHP, bool actDropAnim)
        {
            MonoGoods entity = this.CreateDynamicObjectEntityInstance <MonoGoods>(ownerID, "HPMedic", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.actDropAnim = actDropAnim;
            this.TriggerGoodsAttachEffectPattern(entity);
            HPMedicActor actor = Singleton <EventManager> .Instance.CreateActor <HPMedicActor>(entity);

            actor.healHP = healHP;
            return(actor.runtimeID);
        }
コード例 #5
0
        public uint CreateGood(uint ownerID, string goodType, string abilityName, float argument, Vector3 initPos, Vector3 initDir, bool actDropAnimation, bool forceFlyToAvatar = false)
        {
            MonoGoods entity = this.CreateDynamicObjectEntityInstance <MonoGoods>(ownerID, goodType, initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.actDropAnim      = actDropAnimation;
            entity.forceFlyToAvatar = forceFlyToAvatar;
            this.TriggerGoodsAttachEffectPattern(entity);
            AbilityGoodActor actor = Singleton <EventManager> .Instance.CreateActor <AbilityGoodActor>(entity);

            actor.abilityName     = abilityName;
            actor.abilityArgument = argument;
            return(0);
        }
コード例 #6
0
        public uint CreateSPMedic(uint ownerID, Vector3 initPos, Vector3 initDir, float healSP, bool actDropAnim)
        {
            MonoGoods entity = this.CreateDynamicObjectEntityInstance <MonoGoods>(ownerID, "SPMedic", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.actDropAnim = actDropAnim;
            if (!string.IsNullOrEmpty(entity.AttachEffectPattern))
            {
                Singleton <EffectManager> .Instance.TriggerEntityEffectPattern(entity.AttachEffectPattern, entity, true);
            }
            SPMedicActor actor = Singleton <EventManager> .Instance.CreateActor <SPMedicActor>(entity);

            actor.healSP = healSP;
            return(actor.runtimeID);
        }
コード例 #7
0
        public uint CreateAvatarFragmentItem(uint ownerID, int metaId, Vector3 initPos, Vector3 initDir, bool actDropAnim, int level = 1)
        {
            int rarity = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(metaId, 1).rarity;

            BaseMonoDynamicObject entity = this.CreateDynamicObjectEntityInstance(ownerID, "AvatarFragmentItem", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());
            MonoGoods             goods  = entity as MonoGoods;

            goods.actDropAnim    = actDropAnim;
            goods.DropItemMetaID = metaId;
            goods.DropItemLevel  = level;
            goods.DropItemNum    = 1;
            EquipItemActor actor = Singleton <EventManager> .Instance.CreateActor <EquipItemActor>(entity);

            actor.rarity = rarity;
            return(actor.runtimeID);
        }
コード例 #8
0
ファイル: BaseGoodsActor.cs プロジェクト: slb1988/agame
 public override void Init(BaseMonoEntity entity)
 {
     this._entity   = entity as MonoGoods;
     base.runtimeID = this._entity.GetRuntimeID();
 }