Я получаю несколько ошибок; может кто-нибудь помочь?
Код: Выделить всё
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Stove : MonoBehaviour
{
public GameObject rawSteakPrefab;
public GameObject cookedSteakPrefab;
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
// Assume the player is carrying a raw steak
if (PlayerInventory.HasItem("RawSteak"))
{
PlayerInventory.RemoveItem("RawSteak");
StartCoroutine(CookSteak());
}
}
}
public List CookSteak()
{
// Simulate cooking time
yield return new WaitForSeconds(5f);
Instantiate(cookedSteakPrefab, transform.position, Quaternion.identity);
}
}
Assets\Stove.cs(15,17): ошибка CS0103: имя «PlayerInventory» не существует в текущем контексте
Assets\Stove.cs(18,32): ошибка CS1503: Аргумент 1: невозможно преобразовать из
'System.Collections.Generic.List' в
'string'
Assets\Stove.cs(23,30): ошибка CS1624: тело Stove.CookSteak() не может быть блоком итератора, поскольку
List» не является интерфейсом итератора наберите
спасибо!
Я пробую Unity (относительно новый, 12 лет)
Подробнее здесь: https://stackoverflow.com/questions/786 ... ying-unity