IEnumerator PassResources() { Debug.Log("Passing resources brickyard -> storehouse"); currentResources -= producedResources; while (timeSinceLastPass < passProductTime) { timeSinceLastPass += Time.deltaTime; passProgress = timeSinceLastPass / passProductTime; yield return(null); } timeSinceLastPass = 0f; passProgress = timeSinceLastPass / passProductTime; nextInChain.AddResourcess(producedResources); }
IEnumerator PassResources() { Debug.Log("Passing resources sawmill -> storehouse"); currentResources -= producedResources; while (timeSinceLastPass < passProductTime) { timeSinceLastPass += Time.deltaTime; passProgress = timeSinceLastPass / passProductTime; AssignCarrierDestination(); yield return(null); } timeSinceLastPass = 0f; passProgress = timeSinceLastPass / passProductTime; nextInChain.AddResourcess(producedResources); }
IEnumerator PassResources() { carrier.MoveToDestination(passProductTime); Debug.Log("Passing resources stone mine -> storehouse"); currentResources -= producedResources; while (timeSinceLastPass < passProductTime) { timeSinceLastPass += Time.deltaTime; passProgress = timeSinceLastPass / passProductTime; yield return(null); } timeSinceLastPass = 0f; passProgress = timeSinceLastPass / passProductTime; nextInChain.AddResourcess(producedResources); }