SocialView.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace SmartBow
  6. {
  7. public class SocialView : MonoBehaviour, MenuBackInterface
  8. {
  9. [SerializeField] Transform panelLeftContent;
  10. void Start()
  11. {
  12. PersistenHandler.ins?.menuBackCtr.views.Add(this);
  13. ShowFriendList(true);
  14. }
  15. void OnDestroy()
  16. {
  17. PersistenHandler.ins?.menuBackCtr.views.Remove(this);
  18. }
  19. public bool OnMenuBack()
  20. {
  21. ViewManager2.HideView(ViewManager2.Path_SettingsView);
  22. return true;
  23. }
  24. public void OnClick_PanelLeftItem(Transform target)
  25. {
  26. foreach (Transform item in panelLeftContent)
  27. {
  28. if (item == target)
  29. {
  30. item.Find("Text").GetComponent<Text>().fontStyle = FontStyle.Bold;
  31. item.Find("Text").GetComponent<Text>().color = Color.white;
  32. bool oldActive = item.Find("LightMask").gameObject.activeSelf;
  33. item.Find("LightMask").gameObject.SetActive(true);
  34. if (!oldActive)
  35. {
  36. AudioMgr.ins.PlayBtn();
  37. ShowBox(item.name);
  38. }
  39. }
  40. else
  41. {
  42. item.Find("Text").GetComponent<Text>().fontStyle = FontStyle.Normal;
  43. item.Find("Text").GetComponent<Text>().color = Color.gray;
  44. item.Find("LightMask").gameObject.SetActive(false);
  45. }
  46. }
  47. }
  48. void ShowBox(string itemName)
  49. {
  50. }
  51. void ShowFriendList(bool show)
  52. {
  53. }
  54. public void ShowModalConfirmDeleteFriend(bool show)
  55. {
  56. transform.Find("ModalConfirmDeleteFriend").gameObject.SetActive(show);
  57. }
  58. public void OnClick_Back()
  59. {
  60. AudioMgr.ins.PlayBtn();
  61. }
  62. }
  63. }