Question by
DrSpritz · Dec 09, 2017 at 11:13 AM ·
editorinspectorserializationeventsystemevents
UnityEvent Generic (Inspector Serialization)
Hi there!
I have some issue with UnityEvent serialization in Inspector.
My abstract class
using System;
using UnityEngine;
using UnityEngine.Events;
public abstract class RandomSelector<T> : MonoBehaviour where T: UnityEngine.Object
{
[Serializable]
public class RandomSelectorEvent : UnityEvent<T> { }
[SerializeField]
public RandomSelectorEvent onSelectEvent = new RandomSelectorEvent();
}
I want to inherit this class to implement random selection of type that I need.
Something like this
using UnityEngine;
public class GameObjectRandomSelector : RandomSelector<GameObject> { }
As result I have got this
What I doing wrong? If all, it is possible to do, that I want, without additional editor code? Thank in advance for any help!
screen-shot-2017-12-09-at-140559.png
(33.0 kB)
Comment
Your answer
Follow this Question
Related Questions
UnityEvent with all derived types in listeners serialized in Inspector 0 Answers
Tooltip on Unity event 1 Answer
UnityEvent NullreferenceException in inspector 0 Answers
How to save a two-dimensional array, as part of the variable inspector? 0 Answers
ScrollBar and scrollrect seem not working on mobile 0 Answers