Example #1
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);
        }
Example #2
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);
        }