IEnumerator Procedure() { while (Base.IsAlive) { if (Base.Units.Count < Enemy.Base.Units.Count + AILevelData.Agression) { if (Selection.Count > 0) { var random = Selection.Random; if (Base.Units.Creator.CanDeploy(random.Template)) { if (deployment == null) { deployment = Base.Units.Creator.Deploy(random.Template); } else { if (deployment.isComplete) { deployment = null; } } } } } yield return(new WaitForEndOfFrame()); } }
IEnumerator ClickProcedure() { Deployment = Player.Base.Units.Creator.Deploy(Template); button.interactable = false; Progress.Value = 1f; UpdateState(); while (Deployment.Timer > 0f) { Progress.Value = Deployment.Rate; yield return(new WaitForEndOfFrame()); } Deployment = null; Progress.Value = 0f; UpdateState(); }
void OnUnitDeploymentComplete(BaseUnitsCreator.Deployment deployment) { this.deployment = null; }
void UnitDeploymentCallback(BaseUnitsCreator.Deployment deployment) => UpdateState();