protected virtual void SetResponseButton(StandardUIResponseButton button, Response response, Transform target, int buttonNumber)
        {
            if (button != null)
            {
                button.gameObject.SetActive(true);
                button.isVisible   = true;
                button.isClickable = response.enabled;
                button.target      = target;
                if (response != null)
                {
                    button.SetFormattedText(response.formattedText);
                }
                button.response = response;

                // Auto-number:
                if (autonumber.enabled)
                {
                    button.text = string.Format(autonumber.format, buttonNumber + 1, button.text);
                    var keyTrigger = button.GetComponent <UIButtonKeyTrigger>();
                    if (autonumber.regularNumberHotkeys)
                    {
                        if (keyTrigger == null)
                        {
                            keyTrigger = button.gameObject.AddComponent <UIButtonKeyTrigger>();
                        }
                        keyTrigger.key = (KeyCode)((int)KeyCode.Alpha1 + buttonNumber);
                    }
                    if (autonumber.numpadHotkeys)
                    {
                        if (autonumber.regularNumberHotkeys || keyTrigger == null)
                        {
                            keyTrigger = button.gameObject.AddComponent <UIButtonKeyTrigger>();
                        }
                        keyTrigger.key = (KeyCode)((int)KeyCode.Keypad1 + buttonNumber);
                    }
                }
            }
        }
        /// <summary>
        /// Sets the response buttons.
        /// </summary>
        /// <param name='responses'>Responses.</param>
        /// <param name='target'>Target that will receive OnClick events from the buttons.</param>
        protected virtual void SetResponseButtons(Response[] responses, Transform target)
        {
            firstSelected = null;
            DestroyInstantiatedButtons();

            if ((buttons != null) && (responses != null))
            {
                // Add explicitly-positioned buttons:
                int buttonNumber = 0;
                for (int i = 0; i < responses.Length; i++)
                {
                    if (responses[i].formattedText.position != FormattedText.NoAssignedPosition)
                    {
                        int position = responses[i].formattedText.position;
                        if (0 <= position && position < buttons.Length && buttons[position] != null)
                        {
                            SetResponseButton(buttons[position], responses[i], target, buttonNumber++);
                        }
                        else
                        {
                            Debug.LogWarning("Dialogue System: Buttons list doesn't contain a button for position " + position + ".", this);
                        }
                    }
                }

                if ((buttonTemplate != null) && (buttonTemplateHolder != null))
                {
                    // Reset scrollbar to top:
                    if (buttonTemplateScrollbar != null)
                    {
                        if (buttonTemplateScrollbarResetValue >= 0)
                        {
                            buttonTemplateScrollbar.value = buttonTemplateScrollbarResetValue;
                            if (scrollbarEnabler != null)
                            {
                                scrollbarEnabler.CheckScrollbarWithResetValue(buttonTemplateScrollbarResetValue);
                            }
                        }
                        else if (scrollbarEnabler != null)
                        {
                            scrollbarEnabler.CheckScrollbar();
                        }
                    }

                    // Instantiate buttons from template:
                    for (int i = 0; i < responses.Length; i++)
                    {
                        if (responses[i].formattedText.position != FormattedText.NoAssignedPosition)
                        {
                            continue;
                        }
                        GameObject buttonGameObject = InstantiateButton();
                        if (buttonGameObject == null)
                        {
                            Debug.LogError("Dialogue System: Couldn't instantiate response button template.");
                        }
                        else
                        {
                            instantiatedButtons.Add(buttonGameObject);
                            buttonGameObject.transform.SetParent(buttonTemplateHolder.transform, false);
                            buttonGameObject.transform.SetAsLastSibling();
                            buttonGameObject.SetActive(true);
                            StandardUIResponseButton responseButton = buttonGameObject.GetComponent <StandardUIResponseButton>();
                            SetResponseButton(responseButton, responses[i], target, buttonNumber++);
                            if (responseButton != null)
                            {
                                buttonGameObject.name = "Response: " + responseButton.text;
                            }
                            if (firstSelected == null)
                            {
                                firstSelected = buttonGameObject;
                            }
                        }
                    }
                }
                else
                {
                    // Auto-position remaining buttons:
                    if (buttonAlignment == ResponseButtonAlignment.ToFirst)
                    {
                        // Align to first, so add in order to front:
                        for (int i = 0; i < Mathf.Min(buttons.Length, responses.Length); i++)
                        {
                            if (responses[i].formattedText.position == FormattedText.NoAssignedPosition)
                            {
                                int position = Mathf.Clamp(GetNextAvailableResponseButtonPosition(0, 1), 0, buttons.Length - 1);
                                SetResponseButton(buttons[position], responses[i], target, buttonNumber++);
                                if (firstSelected == null)
                                {
                                    firstSelected = buttons[position].gameObject;
                                }
                            }
                        }
                    }
                    else
                    {
                        // Align to last, so add in reverse order to back:
                        for (int i = Mathf.Min(buttons.Length, responses.Length) - 1; i >= 0; i--)
                        {
                            if (responses[i].formattedText.position == FormattedText.NoAssignedPosition)
                            {
                                int position = Mathf.Clamp(GetNextAvailableResponseButtonPosition(buttons.Length - 1, -1), 0, buttons.Length - 1);
                                SetResponseButton(buttons[position], responses[i], target, buttonNumber++);
                                firstSelected = buttons[position].gameObject;
                            }
                        }
                    }
                }
            }

            if (explicitNavigationForTemplateButtons)
            {
                SetupTemplateButtonNavigation();
            }

            NotifyContentChanged();
        }