IEnumerator setDelay(Interactable interactor, UnitSupply unitSupply) { yield return(new WaitForSeconds(dropDelay)); UnitSupply supplier = unitSupply; if (supplier == null) { Debug.LogError("Builders Unit Supply component missing!"); yield return(null); } if (supplier.mannaAmount <= 0) { supplier.StartBehaviour(); } CmdUpdateManna(interactor.GetComponent <NetworkIdentity> (), supplier.mannaAmount); supplier.mannaAmount = 0; supplier.StartBehaviour(); }
IEnumerator getDelay(UnitSupply unitSupply) { yield return(new WaitForSeconds(pickupDelay)); if (supplyStash.MannaAmount >= unitSupply.mannaCapacity) { supplyStash.MannaAmount -= unitSupply.mannaCapacity; unitSupply.mannaAmount = unitSupply.mannaCapacity; } else { unitSupply.mannaAmount = supplyStash.MannaAmount; supplyStash.MannaAmount = 0; } unitSupply.supplyChainInteract = null; unitSupply.StartBehaviour(); }