public override void Hide() { base.Hide(); Model?.Dispose(); Model = null; _disposablesForModel.DisposeAllAndClear(); }
private void AddSkill(Model.SkillView model) { foreach (var skill in skillsArea.skills.Where(skill => !skill.IsShown)) { skill.SetData(model); skill.Show(); return; } }
public void SetData(Model.SkillView model) { if (model is null) { Hide(); return; } _disposablesForModel.DisposeAllAndClear(); Model = model; Model.name.SubscribeTo(nameText).AddTo(_disposablesForModel); Model.power.SubscribeTo(powerText).AddTo(_disposablesForModel); Model.chance.SubscribeTo(chanceText).AddTo(_disposablesForModel); base.SetData(model.iconSprite.Value); }