I've adapted the default conversation menu using the Unity UI, and added next/previous buttons to it to scroll through dialogue options. The list understands that the maximum number of slots is 4, and I initially set the buttons to
Only Show When Effective.
When running the game, only the Next button appears, and when it reaches the bottom of the list, produces an error.
IndexOutOfRangeException: Array index is out of range.
AC.MenuDialogList.RecalculateSize (MenuSource source) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuDialogList.cs:465)
AC.MenuButton.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuButton.cs:537)
AC.MenuElement.ProcessClickUI (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:230)
AC.MenuElement+<CreateUIEvent>c__AnonStorey1B.<>m__2 () (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:196)
UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
UnityEngine.EventSystems.EventSystem:Update()
I unselected Only Show When Effective, and the buttons both appear, and both function as expected, but the Next button still produces the same error at the bottom of the list. Have I forgotten to set something, or is this the result of the UnityUI system malfunctioning?
Thank you!
Comments
Does the Menu work if you switch its Source back to Adventure Creator? We'll know the problem lies with Unity UI if so.