Esempio n. 1
0
        public void Setup(UserMixCompleteMaterialModel userMixCompleteMaterialModel)
        {
            _userMixCompleteMaterialModel = userMixCompleteMaterialModel;

            _optionNameText.text = _userMixCompleteMaterialModel.MasterOptionModel.name.Value;
            _rateText.text       = _userMixCompleteMaterialModel.IncludeExtraRate().ToString() + "%";
            if (_userMixCompleteMaterialModel.IsExtraSlot())
            {
                OptionElementImage.color = new Color(1f, 0.6f, 0.6f);
            }
        }
        public void Setup(UserMixModel userMixModel, MasterOptionModel masterOptionModel, double rate)
        {
            _userMixModel = userMixModel;

            var userMixCompleteMaterial = _userMixCompleteMaterialDB.New();

            userMixCompleteMaterial.master_option_id.Value = masterOptionModel.id.Value;
            userMixCompleteMaterial.rate.Value             = rate;
            userMixCompleteMaterial.select_agenda.Value    = 0;
            userMixCompleteMaterial.user_mix_id.Value      = userMixModel.id.Value;
            _userMixCompleteMaterialModel = _userMixCompleteMaterialDB.Save(userMixCompleteMaterial).First().Value;

            _optionNameText.text = _userMixCompleteMaterialModel.MasterOptionModel.name.Value;
            _rateText.text       = _userMixCompleteMaterialModel.IncludePeriodBonusRate().ToString() + "%";
            _userMixCompleteMaterialModel.select_agenda.Subscribe(onoff => { _toggle.isOn = onoff == 0 ? false : true; }).AddTo(gameObject);
        }