For both ScriptableObject and MonoBehaviours, they need to be in separate script files per class. Can’t have multiple in the same script asset. You also need to make sure the script asset name matches the class name inside.
So you need to move MaterialItem into its own script file here.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "NewCatchItem", menuName = "NewItem/CatchItem")]
[System.Serializable]
public class CatchItem : BasicItem
{
[SerializeField] protected int CatchPower;
[SerializeField] protected GameObject SpriteForCatching;
public GameObject GetSpriteForCatching()
{
return SpriteForCatching;
}
public int GetCatchPower()
{
return CatchPower;
}
}
BasicItem
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public abstract class BasicItem : ScriptableObject
{
[SerializeField] protected string ItemName;
[SerializeField] [TextArea] protected string ItemDescribtion;
[SerializeField] protected int ItemID;
[SerializeField] protected Sprite ItemSprite;
[SerializeField] protected int BasePrice;
[SerializeField] protected List<BasicItem> IngridientList = new List<BasicItem>();
public string GetItemName()
{
return ItemName;
}
public string GetItemDescribtion()
{
return ItemDescribtion;
}
public int GetItemID()
{
return ItemID;
}
public Sprite GetItemSprite()
{
return ItemSprite;
}
public int GetItemBasePrice()
{
return BasePrice;
}
public List<BasicItem> GetItemIngridientList()
{
return IngridientList;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "NewMaterialItem", menuName = "NewItem/MaterialItem")]
[System.Serializable]
public class MaterialItem : BasicItem
{
}