From 924bda63ce0ea083df42007d0e7a87426c44185d Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 18 四月 2019 14:36:57 +0800
Subject: [PATCH] 3335 炼丹功能
---
System/Alchemy/AlchemyStudyBehaviour.cs | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/System/Alchemy/AlchemyStudyBehaviour.cs b/System/Alchemy/AlchemyStudyBehaviour.cs
index 4249424..0a9ef35 100644
--- a/System/Alchemy/AlchemyStudyBehaviour.cs
+++ b/System/Alchemy/AlchemyStudyBehaviour.cs
@@ -14,8 +14,6 @@
[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>(); } }
@@ -24,10 +22,8 @@
m_Func.SetListener(Learn);
}
- public void Display(int alchemyId)
+ public void Display()
{
- this.alchemyId = alchemyId;
-
DisplayItem();
DisplayStoveCondition();
DisplayPropertyCondition();
@@ -36,13 +32,13 @@
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)
{
@@ -54,7 +50,7 @@
void DisplayPropertyCondition()
{
- var config = AlchemyConfig.Get(alchemyId);
+ var config = AlchemyConfig.Get(model.selectAlchemy);
m_PropertyCondition.gameObject.SetActive(config.LearnNeedLuck > 0);
if (config.LearnNeedLuck > 0)
{
@@ -78,7 +74,7 @@
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);
}
@@ -91,7 +87,7 @@
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)
{
@@ -129,7 +125,6 @@
public void Dispose()
{
-
}
}
}
--
Gitblit v1.8.0