【优化】背包中使用多个道具,明确标注数量

dev_chengFeng
jiaoyangna 2020-12-28 16:40:32 +08:00
parent 58111d30a2
commit 2e3ac84814
2 changed files with 9 additions and 4 deletions

View File

@ -2036,8 +2036,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 357.7, y: -0.0000022451}
m_SizeDelta: {x: 160, y: 97}
m_AnchoredPosition: {x: 397.2, y: -0.0000022451}
m_SizeDelta: {x: 81, y: 97}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &222484165078375402
CanvasRenderer:
@ -2569,7 +2569,7 @@ GameObject:
- component: {fileID: 222098663230714270}
- component: {fileID: 4194478678223721100}
m_Layer: 5
m_Name: numText
m_Name: numText1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@ -45,7 +45,8 @@ function BagResolveAnCompoundPanel:InitComponent()
this.propertyIma =Util.GetGameObject(self.gameObject, "bg/layout3/property")
this.icon=Util.GetGameObject(self.gameObject, "bg/layout3/icon"):GetComponent("Image")
this.Slider=Util.GetGameObject(self.gameObject, "bg/layout3/Slider")--:GetComponent("Slider")
this.numText=Util.GetGameObject(self.gameObject, "bg/layout3/Slider/numText"):GetComponent("Text")
this.numText=Util.GetGameObject(self.gameObject, "bg/layout3/Slider/numText1"):GetComponent("Text")
this.numText1=Util.GetGameObject(self.gameObject, "bg/layout3/Slider/numText"):GetComponent("Text")
this.resolveName=Util.GetGameObject(self.gameObject, "bg/layout3/name"):GetComponent("Text")
this.addBtn=Util.GetGameObject(self.gameObject, "bg/layout3/addBtn")
this.jianBtn=Util.GetGameObject(self.gameObject, "bg/layout3/jianBtn")
@ -425,11 +426,15 @@ function this.ShowCompoundNumData(value)
compoundNum=value
this.Slider:GetComponent("Slider").value=value
if itemData.itemConfig.ItemType==ItemType.HeroDebris then--碎片
this.numText1.gameObject:SetActive(true)
this.numText.text= Language[10216]..value*itemData.itemConfig.UsePerCount..Language[10217]..value..Language[10218].. string.gsub(itemData.itemConfig.Name,Language[10219],"")
this.numText1.text = value
elseif itemData.itemConfig.ItemType==ItemType.Box then--宝箱
this.numText.text= Language[10220]..value..Language[10218]..itemData.itemConfig.Name..""
this.numText1.gameObject:SetActive(false)
else
this.numText.text= Language[10213]..value..Language[10218]..itemData.itemConfig.Name..""
this.numText1.gameObject:SetActive(false)
end
end
--界面关闭时调用(用于子类重写)