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.
30 lines
675 B
30 lines
675 B
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using UnityEngine.UI;
|
||
|
using System;
|
||
|
|
||
|
public class ConfirmSelectEquipNum : MonoBehaviour {
|
||
|
public int equipNum;
|
||
|
public GameObject selectedEquipLable;
|
||
|
// Use this for initialization
|
||
|
void Start () {
|
||
|
this.GetComponent<Button>().onClick.AddListener(OnClick);
|
||
|
}
|
||
|
|
||
|
private void OnClick()
|
||
|
{
|
||
|
selectedEquipLable.GetComponent<Text>().text = equipNum.ToString();
|
||
|
this.transform.parent.gameObject.SetActive(false);
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update () {
|
||
|
|
||
|
}
|
||
|
|
||
|
void OnDestroy()
|
||
|
{
|
||
|
this.GetComponent<Button>().onClick.RemoveListener(OnClick);
|
||
|
}
|
||
|
}
|