I was working on a scriptable object type for any item in my game and I have a string called s_Type. I only want this string to be a certain value; "food", "story", "collectible", or "nothing". I though about using a class but it would create a loss of mess in my script and I would just prefer using a simple string. How could i return an error if the string's value is not one of the above?
Here is my current script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PickableItem : ScriptableObject
{
[Header("Properties")]
/// <summary>
///(string) The name of the item
/// </summary>
public string s_ItemName;
/// <summary>
/// (string) Description of the item
/// </summary>
public string s_Description;
/// <summary>
/// (string) types can be as followed: "food", "story", "collectible", "nothing"
/// </summary>
public string s_Type;
}