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/AlchemyDrugBriefBehaviour.cs |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/System/Alchemy/AlchemyDrugBriefBehaviour.cs b/System/Alchemy/AlchemyDrugBriefBehaviour.cs
index 9bd5731..cec27f1 100644
--- a/System/Alchemy/AlchemyDrugBriefBehaviour.cs
+++ b/System/Alchemy/AlchemyDrugBriefBehaviour.cs
@@ -1,4 +1,5 @@
-锘縰sing System.Collections;
+锘縰sing System;
+using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
@@ -12,28 +13,29 @@
         [SerializeField] PropertyBehaviour[] m_Propertys;
         [SerializeField] Text m_Effect;
 
-        int alchemyId = 0;
-
         static Dictionary<int, int> s_Propertys = new Dictionary<int, int>();
 
-        public void Display(int alchemyId)
-        {
-            this.alchemyId = alchemyId;
+        AlchemyModel model { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
 
+        public void Display()
+        {
             DisplayItem();
             DisplayProperty();
             DisplayEffect();
+
+            model.selectAlchemyRefresh -= SelectAlchemyRefresh;
+            model.selectAlchemyRefresh += SelectAlchemyRefresh;
         }
 
         void DisplayItem()
         {
-            var config = AlchemyConfig.Get(alchemyId);
+            var config = AlchemyConfig.Get(model.selectAlchemy);
             m_Item.SetItem(config.AlchemItemID, 0);
         }
 
         void DisplayProperty()
         {
-            var config = AlchemyConfig.Get(alchemyId);
+            var config = AlchemyConfig.Get(model.selectAlchemy);
             m_ContainerProperty.gameObject.SetActive(config.drugPromoteType == 1);
             if (config.drugPromoteType == 1)
             {
@@ -58,7 +60,7 @@
 
         void DisplayEffect()
         {
-            var config = AlchemyConfig.Get(alchemyId);
+            var config = AlchemyConfig.Get(model.selectAlchemy);
             m_Effect.gameObject.SetActive(config.drugPromoteType == 2);
             if (config.drugPromoteType == 2)
             {
@@ -66,9 +68,16 @@
             }
         }
 
+        private void SelectAlchemyRefresh()
+        {
+            DisplayItem();
+            DisplayProperty();
+            DisplayEffect();
+        }
+
         public void Dispose()
         {
-
+            model.selectAlchemyRefresh -= SelectAlchemyRefresh;
         }
 
         static void GetItemPromoteProperty(ItemConfig config, ref Dictionary<int, int> dict)

--
Gitblit v1.8.0