mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 08:47:13 +00:00
26 lines
591 B
C#
26 lines
591 B
C#
using System.Collections.Generic;
|
|
|
|
namespace SanAndreasUnity.UI
|
|
{
|
|
|
|
public class MenuEntry
|
|
{
|
|
public string name = "";
|
|
public int sortPriority = 0;
|
|
public List<MenuEntry> children = new List<MenuEntry>();
|
|
public System.Action drawAction = null;
|
|
|
|
public void AddChild(MenuEntry entry)
|
|
{
|
|
int index = this.children.FindIndex(e => e.sortPriority > entry.sortPriority);
|
|
|
|
if (index < 0)
|
|
this.children.Add(entry);
|
|
else
|
|
this.children.Insert(index, entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|