| | |
| | | public class UserHelpWin : Window |
| | | { |
| | | [SerializeField] Button m_Close; |
| | | [SerializeField] FunctionButton m_Issues; |
| | | [SerializeField] FunctionButton m_Contact; |
| | | [SerializeField] Toggle m_Issues; |
| | | [SerializeField] Toggle m_Contact; |
| | | |
| | | [SerializeField] RectTransform m_IssueContainer; |
| | | [SerializeField] ScrollRect m_IssueScrollRect; |
| | | [SerializeField] UserIssueBehaviour m_IssueBehaviourPattern; |
| | | [SerializeField] RectTransform m_ContactContainer; |
| | | [SerializeField] Text m_QQ; |
| | |
| | | [SerializeField] Button m_CopyQQ; |
| | | [SerializeField] Button m_CopyPhone; |
| | | |
| | | bool inited = false; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | InitIssues(); |
| | | InitContact(); |
| | | if (!inited) |
| | | { |
| | | inited = true; |
| | | InitIssues(); |
| | | InitContact(); |
| | | } |
| | | |
| | | m_Issues.isOn = true; |
| | | m_Contact.isOn = false; |
| | | DisplayIssues(true); |
| | | DisplayContact(false); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | } |
| | | #endregion |
| | | |
| | | private void InitIssues() |
| | | { |
| | |
| | | var behaviour = instance.GetComponent<UserIssueBehaviour>(); |
| | | behaviours.Add(behaviour); |
| | | |
| | | behaviour.transform.SetParentEx(m_IssueContainer, Vector3.zero, Vector3.zero, Vector3.one); |
| | | behaviour.transform.SetParentEx(m_IssueScrollRect.content, Vector3.zero, Vector3.zero, Vector3.one); |
| | | } |
| | | |
| | | for (var i = 0; i < behaviours.Count; i++) |
| | |
| | | private void InitContact() |
| | | { |
| | | var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId); |
| | | m_QQ.text = config.qq; |
| | | m_Phone.text = config.phone; |
| | | m_QQ.text = Language.GetFromLocal(31, config.qq); |
| | | m_Phone.text = Language.GetFromLocal(32, config.phone); |
| | | } |
| | | |
| | | private void DisplayIssues() |
| | | private void DisplayIssues(bool display) |
| | | { |
| | | m_IssueContainer.gameObject.SetActive(true); |
| | | m_ContactContainer.gameObject.SetActive(false); |
| | | m_IssueContainer.gameObject.SetActive(display); |
| | | } |
| | | |
| | | private void DisplayContact() |
| | | private void DisplayContact(bool display) |
| | | { |
| | | m_IssueContainer.gameObject.SetActive(false); |
| | | m_ContactContainer.gameObject.SetActive(true); |
| | | |
| | | m_ContactContainer.gameObject.SetActive(display); |
| | | } |
| | | |
| | | private void CopyQQ() |