Пример #1
0
 public static IEnumerator TransferDeltaEnergy(Imbue itemImbue, SpellCastCharge activeSpell, float energyDelta = 20.0f, int counts = 5)
 {
     for (int i = 0; i < counts; i++)
     {
         try { itemImbue.Transfer(activeSpell, energyDelta); }
         catch { }
         yield return(new WaitForSeconds(0.01f));
     }
     yield return(null);
 }
        private void LateUpdate()
        {
            if (itemMainImbue == null)
            {
                TryGetItemImbue();
            }

            if (isActive || itemMainImbue == null || autoImbueSpell == null || !module.permanentImbue)
            {
                return;
            }

            if (itemMainImbue.energy < itemMainImbue.maxEnergy)
            {
                try { itemMainImbue.Transfer(autoImbueSpell, module.energyStepSize); }
                catch { }
            }
        }
        private IEnumerator TransferDeltaEnergy(Imbue itemImbue, SpellCastCharge activeSpell, float energyDelta = 1.0f)
        {
            int counts = (int)Mathf.Round(200.0f / energyDelta);

            isActive = true;
            for (int i = 0; i < counts; i++)
            {
                try
                {
                    itemImbue.Transfer(activeSpell, energyDelta);
                    if (itemImbue.energy >= itemImbue.maxEnergy)
                    {
                        break;
                    }
                }
                catch { }
                yield return(null);
            }
            isActive = false;
            yield return(null);
        }