| | |
| | | public class UserHelpWin : Window |
| | | { |
| | | [SerializeField] Button m_Close; |
| | | [SerializeField] Button m_Issues; |
| | | [SerializeField] Button m_Contact; |
| | | [SerializeField] FunctionButton m_Issues; |
| | | [SerializeField] FunctionButton m_Contact; |
| | | |
| | | [SerializeField] RectTransform m_IssueContainer; |
| | | [SerializeField] UserIssueBehaviour m_IssueBehaviourPattern; |
| | |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_Close.SetListener(CloseClick); |
| | | m_Issues.SetListener(DisplayIssues); |
| | | m_Contact.SetListener(DisplayContact); |
| | | m_CopyQQ.SetListener(CopyQQ); |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | InitIssues(); |
| | | InitContact(); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | |
| | | private void InitIssues() |
| | | { |
| | | |
| | | var configs = Config.Instance.GetAllValues<HelpInfoConfig>(); |
| | | var needCount = configs.Count; |
| | | |
| | | var behaviours = new List<UserIssueBehaviour>(); |
| | | behaviours.Add(m_IssueBehaviourPattern); |
| | | |
| | | for (var i = 0; i < needCount; i++) |
| | | for (var i = 1; i < needCount; i++) |
| | | { |
| | | var instance = GameObject.Instantiate(m_IssueBehaviourPattern.gameObject) as GameObject; |
| | | var instance = Instantiate(m_IssueBehaviourPattern.gameObject) as GameObject; |
| | | var behaviour = instance.GetComponent<UserIssueBehaviour>(); |
| | | behaviours.Add(behaviour); |
| | | |
| | | behaviour.transform.SetParentEx(m_IssueContainer, Vector3.zero, Vector3.zero, Vector3.one); |
| | | } |
| | | |
| | | for (var i = 0; i < behaviours.Count; i++) |
| | | { |
| | | behaviours[i].Display(configs[i].title, configs[i].help); |
| | | } |
| | | } |
| | | |
| | | private void InitContact() |
| | | { |
| | | |
| | | var config = Config.Instance.Get<ContactConfig>(VersionConfig.Get().appId); |
| | | m_QQ.text = config.qq; |
| | | m_Phone.text = config.phone; |
| | | } |
| | | |
| | | private void DisplayIssues() |
| | |
| | | |
| | | private void CopyQQ() |
| | | { |
| | | |
| | | SDKUtility.Instance.CopyContent(m_QQ.text); |
| | | } |
| | | |
| | | private void CopyPhone() |
| | | { |
| | | |
| | | SDKUtility.Instance.CopyContent(m_Phone.text); |
| | | } |
| | | |
| | | } |