- Home /
Question by
kirisakichioge · Apr 28, 2021 at 12:12 PM ·
script.
ScriptableObject Question
this is my code
[CreateAssetMenu(fileName ="New Action",menuName ="Action")]
public class Action : ScriptableObject
{
public List<Track> trackList;
}
[System.Serializable]
public class Track {
public TrackType tracktype;
public List<Event> eventList;
}
public enum TrackType
{
A,
B
}
[System.Serializable]
public class Event {
public string name;
}
public class EventA : Event {
public string A;
}
public class EventB : Event
{
public string B;
}
I hope that when I change the tracktype to A, the elements in the eventList will also change to EventA
for example:
now:
hope:
mugrn5onpmy9y6.png
(11.0 kB)
ss67.png
(10.9 kB)
Comment
Your answer
Follow this Question
Related Questions
Simplistic air/contamination flow between rooms 0 Answers
How can i make both two cameras to follow the player but only one with control on player ? 0 Answers
How can i spawn new gameobjects to be inside the terrain area ? 2 Answers
How can i make character head to rotate according to the mouse cursor position ? 0 Answers