private async Task RecruitAsync(RecruitSelectionData data) { var menu = RecruitMenu.ShowDefault(); var recruitTask = menu.DoMenuAsync(data, autoclose: false); await fade.FadeInRoutine("black"); await recruitTask; await fade.FadeOutRoutine("black"); await menu.CloseRoutine(); }
public override void Init(object reg) { BaseRegiment = (BaseRegiment)reg; gameObject.SetActive(true); icon.sprite = BaseRegiment.Icon; for (int i = 0; i < 3; i++) { ArmPips[i].sprite = SpriteHandler.GetPipsSprite(BaseRegiment.ArmorLvl((DamageType)i)); } DamPips.sprite = SpriteHandler.GetPipsSprite(BaseRegiment.damageLvl); name.text = BaseRegiment.type.ToString(); descr.text = $"Стоимость {BaseRegiment.cost.ToArmyCost()}\nСодержание {BaseRegiment.upkeep.ToArmyCost()}\nВремя {BaseRegiment.time}"; bye.onClick.RemoveAllListeners(); if (Player.PlayerCheckRegion()) { bye.onClick.AddListener(() => RecruitMenu.AddToQueue(BaseRegiment)); } CheckCost(); }
private void Awake() { instance = this; }
private void Recruit(DynValue recruitKey) { var data = IndexDatabase.Instance().Recruits.GetData(recruitKey.String); RunRoutineFromLua(CoUtils.TaskRoutine(RecruitMenu.ShowDefault().DoMenuAsync(data))); }