diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs b/Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs new file mode 100644 index 00000000..1f575725 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XJadeSlotDrawer.cs @@ -0,0 +1,72 @@ +using System;
+using UILib;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XJadeSlotDrawer : XItemDrawer
+ {
+ private IXUISprite cover;
+
+ private IXUISprite back;
+
+ private IXUISprite total;
+
+ private IXUISprite lockJade;
+
+ public void DrawItem(GameObject go, uint slot, bool hasLock, XJadeItem realItem)
+ {
+ this._GetUI(go);
+ this.SetupCoverAndBack(slot, hasLock);
+ this._SetupAttrIcon(null);
+ XSingleton<XItemDrawerMgr>.singleton.jadeItemDrawer.DrawItem(go, realItem, false);
+ this._ClearVariables();
+ }
+
+ private void SetupCoverAndBack(uint slot, bool hasLock)
+ {
+ bool flag = !XJadeInfo.SlotExists(slot);
+ if (flag)
+ {
+ if (hasLock)
+ {
+ this.cover.SetVisible(true);
+ this.lockJade.SetVisible(true);
+ this.total.SetVisible(true);
+ }
+ else
+ {
+ this.lockJade.SetVisible(false);
+ this.cover.SetVisible(false);
+ this.back.SetVisible(false);
+ this.total.SetVisible(false);
+ }
+ }
+ else
+ {
+ this.total.SetVisible(true);
+ this.lockJade.SetVisible(false);
+ this.cover.SetVisible(false);
+ this.back.SetVisible(true);
+ this.back.SetSprite("iconly_" + slot);
+ }
+ }
+
+ protected override void _GetUI(GameObject uiGo)
+ {
+ base._GetUI(uiGo);
+ this.cover = (uiGo.transform.Find("Cover").GetComponent("XUISprite") as IXUISprite);
+ this.back = (uiGo.transform.Find("Back").GetComponent("XUISprite") as IXUISprite);
+ this.total = (uiGo.transform.GetComponent("XUISprite") as IXUISprite);
+ this.lockJade = (uiGo.transform.Find("Lock").GetComponent("XUISprite") as IXUISprite);
+ }
+
+ protected override void _ClearVariables()
+ {
+ base._ClearVariables();
+ this.cover = null;
+ this.back = null;
+ }
+ }
+}
|