diff --git a/SingleWeapon.cs b/SingleWeapon.cs new file mode 100644 index 0000000..a9a1af2 --- /dev/null +++ b/SingleWeapon.cs @@ -0,0 +1,45 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.EventSystems; + +public class SingleWeapon : MonoBehaviour +{ + public string WeaponName; + public Sprite weaponSprite; + public int UpgradePrice; + public Weapon weapon; + + public Text WeaponNameText; + //public GoodsDatabase goodsDatabase; + // Start is called before the first frame update + void Start() + { + WeaponNameText.color = Color.white; + WeaponNameText.text = WeaponName + ""; + weaponSprite = weapon.weaponSprite; + UpgradePrice = (weapon.level + 1) * 10; + } + /*public void UpdataInfo() + { + WeaponNameText.text = WeaponName+""; + weapon = transform.Find(WeaponName).GetComponent(); + }*/ + // Update is called once per frame + void Update() + { + UpgradePrice = (weapon.level + 1) * 10; + } + public void IPointerClick() + { + //Debug.Log("Down"); + WeaponNameText.color = Color.green; + if (WeaponUpgradePandle.instance.singleWeapon != null && WeaponUpgradePandle.instance.singleWeapon != this) + { + WeaponUpgradePandle.instance.singleWeapon.WeaponNameText.color = Color.white; + } + WeaponUpgradePandle.instance.singleWeapon = this; + WeaponUpgradePandle.instance.UpdateUI(); + } +}