Код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pickup : MonoBehaviour
{
private Inventory inventory;
public GameObject slotButton;
private void Start()
{
inventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
for (int i = 0; i < inventory.slots.Length; i++)
{
if (inventory.isFull[i] != true)
{
inventory.isFull = true;
Instantiate(slotButton; inventory.slots[i].transform);
Destroy(gameObject);
break;
}
}
}
}
}
Ошибки:
-24,33 CS1026: )
-24,63 CS1002
-24,63 1513
30,3 CS1022
Unity самая новая версия