197 lines
8.8 KiB
C#
197 lines
8.8 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class StatItemEquiped : MonoBehaviour
|
|
{
|
|
public Image itemIconImage;
|
|
|
|
public Text itemNameText;
|
|
|
|
public Text itemStatText;
|
|
|
|
[HideInInspector]
|
|
public EquipmentManager equipmentManager;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
public void Setup(GameManager.ItemType itemType, int index)
|
|
{
|
|
Debug.Log(itemType.ToString() + " index: " + index);
|
|
switch (itemType)
|
|
{
|
|
case GameManager.ItemType.Rod:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameRods[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameRods[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameRods[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameRods[index].name;
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameRods[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("STRENGTH") + ": </b>" + GameManager.Instance.ConvertWeight(GameManager.Instance.gameRods[index].strength) + "\n";
|
|
text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("LENGTH") + ": </b>" + GameManager.Instance.gameRods[index].length + "m\n";
|
|
text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("CW_ROD") + ": </b>" + GameManager.Instance.gameRods[index].cw.x + " - " + GameManager.Instance.gameRods[index].cw.y + "\n";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Reel:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameReels[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameReels[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameReels[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameReels[index].name;
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameReels[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("STRENGTH") + ": </b>" + GameManager.Instance.ConvertWeight(GameManager.Instance.gameReels[index].strength) + "\n";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Line:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameLines[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameLines[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameLines[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameLines[index].name;
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameLines[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("SIZE") + ": </b>" + GameManager.Instance.gameLines[index].size + " mm\n";
|
|
text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("STRENGTH") + ": </b>" + GameManager.Instance.ConvertWeight(GameManager.Instance.gameLines[index].strength) + "\n";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Float:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameFloats[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameFloats[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameFloats[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameFloats[index].name;
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameFloats[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("DISPLACEMENT") + ": </b>" + GameManager.Instance.gameFloats[index].displacement + " g";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Hook:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameHooks[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameHooks[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameHooks[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameHooks[index].GetName();
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameHooks[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("SIZE") + ": </b>" + GameManager.Instance.gameHooks[index].GetSizetext() + "\n";
|
|
text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("COLOR") + ": </b>" + LanguageManager.Instance.GetText(GameManager.Instance.gameHooks[index].color.ToString().ToUpper() + "_COLOR") + "\n";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Bait:
|
|
itemIconImage.sprite = GameManager.Instance.gameBaits[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameBaits[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameBaits[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameBaits[index].GetName();
|
|
if (GameManager.Instance.gameBaits[index].type == GameManager.GameBaits.Type.Spinning)
|
|
{
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + LanguageManager.Instance.GetText(GameManager.Instance.gameBaits[index].typeOfLure.ToString().ToUpper() + "_TYPE") + "\n";
|
|
}
|
|
else
|
|
{
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + LanguageManager.Instance.GetText(GameManager.Instance.gameBaits[index].type.ToString().ToUpper() + "_TYPE") + "\n";
|
|
}
|
|
break;
|
|
case GameManager.ItemType.Feeder:
|
|
itemIconImage.sprite = GameManager.Instance.gameFeeders[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameFeeders[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameFeeders[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameFeeders[index].name;
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameFeeders[index].type.ToString() + "\n";
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("CAPACITY") + ": </b>" + GameManager.Instance.gameFeeders[index].capacity + " g";
|
|
break;
|
|
case GameManager.ItemType.Leader:
|
|
{
|
|
itemIconImage.sprite = GameManager.Instance.gameLeaders[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameLeaders[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameLeaders[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameLeaders[index].GetName();
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("TYPE") + ": </b>" + GameManager.Instance.gameLeaders[index].type.ToString() + "\n";
|
|
Text text = itemStatText;
|
|
text.text = text.text + "<b>" + LanguageManager.Instance.GetText("STRENGTH") + ": </b>" + GameManager.Instance.ConvertWeight(GameManager.Instance.gameLeaders[index].strength) + "\n";
|
|
break;
|
|
}
|
|
case GameManager.ItemType.Weight:
|
|
itemIconImage.sprite = GameManager.Instance.gameWeights[index].GetIconImage();
|
|
if (!string.IsNullOrEmpty(GameManager.Instance.gameWeights[index].logoBrandImagePath))
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = true;
|
|
equipmentManager.brandLogoImage.sprite = GameManager.Instance.gameWeights[index].GetLogoBrandImage();
|
|
}
|
|
else
|
|
{
|
|
equipmentManager.brandLogoImage.enabled = false;
|
|
}
|
|
itemNameText.text = GameManager.Instance.gameWeights[index].GetName();
|
|
itemStatText.text = "<b>" + LanguageManager.Instance.GetText("ITEM_WEIGHT") + ": </b>" + GameManager.Instance.gameWeights[index].weight + " g";
|
|
break;
|
|
}
|
|
}
|
|
}
|