/// <summary> /// Receive broadcast message form the message center, when a helper info button clicked this method /// will be call. /// </summary> /// <param name="keyWordIndex"></param> private void OnUpdateHelperInfoContext(int keyWordIndex) { HelperInfoManager.KeyWord[] keywordList = HelperInfoManager.GetHelperInfoCategoryContent((HelperInfoManager.HelpInfoCategory)m_CurrentSelectedCategoryIndex); if (keyWordIndex >= 0 && keyWordIndex < keywordList.Length) { m_HelperInfoHeader.text = HelperInfoManager.GetHeaderText(keywordList[keyWordIndex]); m_HelperInfoContext.text = HelperInfoManager.GetInfoText(keywordList[keyWordIndex]); } #if UNITY_EDITOR else { Debug.LogError("keyWord index out of range"); } #endif }
/// <summary> /// Receive broadcast message form the message center. /// When user selected a helper category form the dropdown menu on the list, the list will /// update its content base on the selected category. /// </summary> /// <param name="categoryIndex"></param> private void OnUpdateHelperInfoButtonList(int categoryIndex) { HelperInfoManager.KeyWord[] keywordList = HelperInfoManager.GetHelperInfoCategoryContent((HelperInfoManager.HelpInfoCategory)categoryIndex); for (int index = 0; index < m_ButtonList.Count; index++) { if (index < keywordList.Length) { m_ButtonList[index].UpdateHelpInfoButton(HelperInfoManager.GetHeaderText(keywordList[index])); } else { m_ButtonList[index].UpdateHelpInfoButton(null); } } }