public virtual void RemoveElement(BaseMenuElement element) { MenuElements.Remove(element); //DeselectAll(); // SelectFirstActiveIndex(); ArrangeMenuElements(); }
// Update is called once per frame void Update() { if (actual.before != null) { actual.before.ElementActive = false; } if (actual.next != null) { actual.next.ElementActive = false; } actual.ElementActive = true; float direction = InputManager.PovVertical(); if (direction > 0) { if (actual.before != null) { GameObject.FindGameObjectWithTag("SoundUtility").GetComponent <SoundListUtility>().PlayElementByName("selection_menu_option"); actual = actual.before; } } if (direction < 0) { if (actual.next != null) { GameObject.FindGameObjectWithTag("SoundUtility").GetComponent <SoundListUtility>().PlayElementByName("selection_menu_option"); actual = actual.next; } } }
/// <summary> /// Adds an element to the elment list. /// </summary> public virtual void AddElement(BaseMenuElement element) { MenuElements.Add(element); ArrangeMenuElements(); }