parent
e32c9e0819
commit
b35506e39f
@ -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<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();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue