- Home /
Question by
Langyn · Aug 07, 2021 at 06:29 PM ·
inspectorscriptableobjectevents
Why Can't I see this UnityEvent in the inspector?
Why can't I see
public UER UnityEventResponse;
In the editor?
CardData can be any data type you want :)
Base Game Listener
public abstract class GameEventListener<T, GE, UER> : MonoBehaviour
where GE : GameEvent<T>
where UER : UnityEvent<T>
{
public GE GameEvent;
public UER UnityEventResponse;
Base Game Event
public abstract class GameEvent<T> : ScriptableObject
{
public event Action<T> EventListeners = delegate { };
public void Raise(T item)
{
EventListeners(item);
}
}
Specific Listener Implementation
public class CardDataEventListener : GameEventListener<CardData, CardDataEvent, UnityCardDataEvent> {}
Specific Game Event Implementation
[CreateAssetMenu(fileName = "New CardData Event", menuName = "Event")]
public class CardDataEvent : GameEvent<CardData> {}
Unity Event Type Implementation
public class UnityCardDataEvent : UnityEvent<CardData> {}
This is ticking me off a little :^)
Comment
Best Answer
Answer by Langyn · Aug 07, 2021 at 06:40 PM
Found the issue...
For anyone with a similar issue, I had to add [System.Serializable] to the UnityCardDataEvent class
Your answer
![](https://koobas.hobune.stream/wayback/20220613041342im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Handling hundreds of conditions in ScriptableObjects 1 Answer
Unity inspector field overlap with eachother 1 Answer
Can a ScriptableObject contain a List of ScriptableObjects? 2 Answers
Method that runs every time unity clears non-serializable properties 0 Answers
Why doesn't my ScriptableObject save using a custom EditorWindow? 3 Answers