Add sub action button.
This commit is contained in:
@@ -7,13 +7,20 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
internal class ActionBar : MonoBehaviour {
|
||||
[SerializeField]
|
||||
ActionButton m_mainButton;
|
||||
[SerializeField]
|
||||
ActionButton m_subButton;
|
||||
|
||||
public void Load(ResourceBrowser browser, IReadOnlyCollection<IResourceAction> actions) {
|
||||
var enumerator = actions.OrderBy(i => i.Priority).GetEnumerator();
|
||||
if (enumerator.MoveNext()) {
|
||||
gameObject.SetActive(true);
|
||||
m_mainButton.Load(browser, enumerator.Current);
|
||||
// TODO Subactions
|
||||
if (enumerator.MoveNext()) {
|
||||
m_subButton.Load(browser, enumerator.Current);
|
||||
}
|
||||
else {
|
||||
m_subButton.Clear();
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_mainButton.Clear();
|
||||
|
Reference in New Issue
Block a user