Пример #1
0
    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();
    }
Пример #2
0
    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();
    }
Пример #3
0
 private void Awake()
 {
     instance = this;
 }
Пример #4
0
    private void Recruit(DynValue recruitKey)
    {
        var data = IndexDatabase.Instance().Recruits.GetData(recruitKey.String);

        RunRoutineFromLua(CoUtils.TaskRoutine(RecruitMenu.ShowDefault().DoMenuAsync(data)));
    }