|
@@ -9,6 +9,7 @@ public struct Treasure
|
|
|
public int id;
|
|
public int id;
|
|
|
public string name;
|
|
public string name;
|
|
|
public Sprite sprite;
|
|
public Sprite sprite;
|
|
|
|
|
+ public Sprite qualityBackground;
|
|
|
public Sprite qualityBox;
|
|
public Sprite qualityBox;
|
|
|
public Color qualityText;
|
|
public Color qualityText;
|
|
|
public List<int> tagsId;
|
|
public List<int> tagsId;
|
|
@@ -18,11 +19,12 @@ public struct Treasure
|
|
|
public List<string> type;
|
|
public List<string> type;
|
|
|
public List<float> data;
|
|
public List<float> data;
|
|
|
|
|
|
|
|
- public Treasure(int id, string name, Sprite sprite, Sprite qualityBox, Color qualityText, List<int> tagsId, List<Sprite> tags, string attribute, int price, List<string> type, List<float>data)
|
|
|
|
|
|
|
+ public Treasure(int id, string name, Sprite sprite, Sprite qualityBackground, Sprite qualityBox, Color qualityText, List<int> tagsId, List<Sprite> tags, string attribute, int price, List<string> type, List<float>data)
|
|
|
{
|
|
{
|
|
|
this.id = id;
|
|
this.id = id;
|
|
|
this.name = name;
|
|
this.name = name;
|
|
|
this.sprite = sprite;
|
|
this.sprite = sprite;
|
|
|
|
|
+ this.qualityBackground = qualityBackground;
|
|
|
this.qualityBox = qualityBox;
|
|
this.qualityBox = qualityBox;
|
|
|
this.qualityText = qualityText;
|
|
this.qualityText = qualityText;
|
|
|
this.tagsId = new List<int>(tagsId);
|
|
this.tagsId = new List<int>(tagsId);
|
|
@@ -45,13 +47,20 @@ public class TreasuresSaleUI : MonoBehaviour
|
|
|
[FoldoutGroup("×é¼þ")] public TextMeshProUGUI attribute;
|
|
[FoldoutGroup("×é¼þ")] public TextMeshProUGUI attribute;
|
|
|
[FoldoutGroup("×é¼þ")] public ButtonUI buy;
|
|
[FoldoutGroup("×é¼þ")] public ButtonUI buy;
|
|
|
[FoldoutGroup("×é¼þ")] public TextMeshProUGUI price;
|
|
[FoldoutGroup("×é¼þ")] public TextMeshProUGUI price;
|
|
|
- [FoldoutGroup("×é¼þ")] public List<Sprite> TreasureBackgrounds;
|
|
|
|
|
[FoldoutGroup("×é¼þ")] public Image background;
|
|
[FoldoutGroup("×é¼þ")] public Image background;
|
|
|
|
|
|
|
|
public bool islock;
|
|
public bool islock;
|
|
|
public bool isNull;
|
|
public bool isNull;
|
|
|
public Treasure treasure;
|
|
public Treasure treasure;
|
|
|
public TreasureInBag owner;
|
|
public TreasureInBag owner;
|
|
|
|
|
+ private void OnEnable()
|
|
|
|
|
+ {
|
|
|
|
|
+ if(owner != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ transform.position = owner.transform.position;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
private void Update()
|
|
private void Update()
|
|
|
{
|
|
{
|
|
|
if(owner!=null && gameObject.activeSelf)
|
|
if(owner!=null && gameObject.activeSelf)
|
|
@@ -96,15 +105,8 @@ public class TreasuresSaleUI : MonoBehaviour
|
|
|
tag.gameObject.SetActive(false);
|
|
tag.gameObject.SetActive(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (treasure.tags.Count == 0)
|
|
|
|
|
- {
|
|
|
|
|
- background.sprite = TreasureBackgrounds[1];
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- background.sprite = TreasureBackgrounds[0];
|
|
|
|
|
- }
|
|
|
|
|
nameText.text = treasure.name;
|
|
nameText.text = treasure.name;
|
|
|
|
|
+ background.sprite = treasure.qualityBackground;
|
|
|
nameText.color = treasure.qualityText;
|
|
nameText.color = treasure.qualityText;
|
|
|
attribute.text = treasure.attribute;
|
|
attribute.text = treasure.attribute;
|
|
|
if (price != null)
|
|
if (price != null)
|