mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
34 lines
773 B
C#
34 lines
773 B
C#
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace SanAndreasUnity.Utilities
|
|||
|
{
|
|||
|
|
|||
|
public class MenuBarEntry
|
|||
|
{
|
|||
|
public string name = "";
|
|||
|
public int sortPriority = 0;
|
|||
|
public List<MenuBarEntry> children = new List<MenuBarEntry>();
|
|||
|
public System.Action drawAction = null;
|
|||
|
public System.Action clickAction = null;
|
|||
|
|
|||
|
public int AddChild(MenuBarEntry entry)
|
|||
|
{
|
|||
|
int index = this.children.FindIndex(e => e.sortPriority > entry.sortPriority);
|
|||
|
|
|||
|
if (index < 0)
|
|||
|
{
|
|||
|
this.children.Add(entry);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.children.Insert(index, entry);
|
|||
|
return index;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|