Storing a list of methods in a Scriptable Object?
I'm currently working on a game in which Cards can be played on Objects. However, I've run into an issue that, if I don't address now, I foresee becoming a massive headache.
The ideal is for Cards to contain a list of methods pulled from a common pool, that are called when they're played, but I'm not sure how to accomplish this, except by way of an enum, a list, and a massive switch-case statement.
I looked at delegates, but I'm fairly sure they aren't what I'm looking for, as they don't seem to be able to be saved in a Scriptable Object.
Here's the current Card code:
[CreateAssetMenu(fileName = "New Card", menuName = "Card")]
[System.Serializable]
public class Card : ScriptableObject
{
public new string name;
public string description;
public Sprite artwork;
public int timeCost;
public CardType type;
}
Your answer
Follow this Question
Related Questions
Different methods for instances of a ScriptableObject 0 Answers
Any Resources Load Method? or How to asing ScritableObjects to instanciated GO? 0 Answers
Custom Editor for embedded ScriptableObjects list 2 Answers
Instantiating a GameObject from a ScriptableObject 1 Answer
Public jagged array not showing up in scriptable object inspector 0 Answers