public class Inventory1 : MonoBehaviour
{
public static Inventory1 _instance;
private TweenPosition tween;
public List itemGridList = new List();
private int coinCount=1000;
public UILabel coinNumberlabel;
public GameObject inventoryItem;
private void Awake(){
_instance = this;
tween = this.GetComponent();
this.gameObject.SetActive(false);
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.X)){
GetId(Random.Range(1001, 1004));
}
if (Input.GetKeyDown(KeyCode.Z)){
GetId(Random.Range(2001, 2023));
}
}
public void GetId(int id,int count =1 ) {//ID =1001
InventoryItemGrid1 itemGrid1 = null;
//第一步 查找在所有的物品中是否存在该物体
//第二步 如果存在 则num加一
foreach (InventoryItemGrid1 temp in itemGridList) {//TEMP.id 等于ID
if (temp.id == id)//如果temp.id =1001 //temp.id是itemGridList中的id temp.id 怎么来的值是多少
{