public virtual void Finish(bool interrupt)
        {
            usingChar.states.Consuming = false;
            int index = usingChar.anim.GetLayerIndex(Stats.animLayer);

            usingChar.anim.SetLayerWeight(index, 0);

            if (!interrupt)
            {
                ConsumableStats consumeStats = getConsumableStats();
                usingChar.Consume(consumeStats.EffectStrength, consumeStats.EffectStat);

                Units -= consumeStats.ConsumeRate;

                if (consumeStats.ShowOnUse)
                {
                    usingChar.ik.DisableLeftHand  = !consumeStats.DisableLeftHand;
                    usingChar.ik.DisableRightHand = !consumeStats.DisableRightHands;
                    this.Hide();
                }

                if (Units <= 0)
                {
                    usingChar.inventary.RemoveItem(this);
                    Destroy(this.gameObject);
                }
            }

            usingChar = null;
            deltaTime = 0;
        }
Beispiel #2
0
        public override void Drop(CharController character, Transform itemTransform, bool selected)
        {
            base.Drop(character, itemTransform, selected);
            ClothStats stats = GetClothStats();

            this.usingChar = character;
            character.inventary.HideCloth(stats.ItemViewerName, this);
            character.Consume(-armorLife, "armor");
        }
Beispiel #3
0
        public override void Use(CharController character)
        {
            base.Use(character);
            ClothStats stats = GetClothStats();

            this.usingChar = character;
            character.inventary.ShowCloth(stats.ItemViewerName, this);
            character.Consume(armorLife, "armor");
        }