| | |
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] Text m_FuncLabel;
|
| | |
|
| | | int alchemyId = 0;
|
| | |
|
| | | AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | |
| | | m_Func.SetListener(Learn);
|
| | | }
|
| | |
|
| | | public void Display(int alchemyId)
|
| | | public void Display()
|
| | | {
|
| | | this.alchemyId = alchemyId;
|
| | |
|
| | | DisplayItem();
|
| | | DisplayStoveCondition();
|
| | | DisplayPropertyCondition();
|
| | |
| | |
|
| | | void DisplayItem()
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | m_Item.SetItem(config.LearnNeedItemID, 1);
|
| | | }
|
| | |
|
| | | void DisplayStoveCondition()
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | m_StoveCondition.gameObject.SetActive(config.LearnNeedAlchemLV > 0);
|
| | | if (config.LearnNeedAlchemLV > 0)
|
| | | {
|
| | |
| | |
|
| | | void DisplayPropertyCondition()
|
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | m_PropertyCondition.gameObject.SetActive(config.LearnNeedLuck > 0);
|
| | | if (config.LearnNeedLuck > 0)
|
| | | {
|
| | |
| | | if (TryLearn(out error))
|
| | | {
|
| | | var pak = new CA576_tagCMPlayerRefine();
|
| | | pak.AlchemyID = (uint)alchemyId;
|
| | | pak.AlchemyID = (uint)model.selectAlchemy;
|
| | | pak.DoType = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
| | | bool TryLearn(out int error)
|
| | | {
|
| | | error = 0;
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | var count = packModel.GetItemCountByID(PackType.Item, config.LearnNeedItemID);
|
| | | if (count <= 0)
|
| | | {
|
| | |
| | |
|
| | | public void Dispose()
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | | } |