Open mmar58 opened 10 months ago
NaughtyAttributes only works as CustomEditor and PropertyAttributeDrawer, which does not work on Serializable
A working one is here but you need to switch the decorator inside Serialieable
from NA to SaintsField's version
[Serializable]
public class VideoItem
{
// DeEditorUtils.List titles = new();
[Dropdown("titles"), BelowRichLabel(nameof(value), true)]
public string value;
public DropdownList<string> titles = new DropdownList<string>
{
{ "Example1", "Example1" },
{ "Example2", "Example2" },
{ "Example3", "Example3" },
};
public VideoItem() {
// titles = TimelineCreator.sectionTitles;
}
}
// [SaintsRow] public VideoItem[] videoItem;
[Serializable]
public class TimelineItem
{
string name = "";
public TimelineItem()
{
name = "TImeline Elemenet";
}
public bool label;
[ShowIf("label")]
public string LabelText = "Round 1";
[SaintsRow]
public List<VideoItem> videos = new List<VideoItem>();
public bool loop;
[ShowIf("ShouldShowLoop")]
public int loopCount=1;
public bool startTimer;
[ShowIf("startTimer")]
public float timerTime = 60;
bool ShouldShowLoop()
{
return loop&&!label;
}
}
[SerializeField, SaintsRow] List<TimelineItem> Timeline = new List<TimelineItem>();
`public class TimelineItem {
} [Serializable] public class VideoItem { List titles = new();
[Dropdown("titles")]
public string value;
public VideoItem() {
titles = TimelineCreator.sectionTitles;
}
}`
This is my class and I am using
[SerializeField] List<TimelineItem> Timeline = new();
in the mono behavior. The dropdown is working great, no matter how deep it is. But the show if and enable if isn't working inside the list view.So I will be greatful if you fix this issue. But I loved your work, thanks, will use it in every project I will create.