You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.4 KiB
46 lines
1.4 KiB
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<Weapon>();
|
|
}*/
|
|
// 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();
|
|
}
|
|
}
|