ChatBar.cs 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. public class ChatBar : MonoBehaviour
  6. {
  7. public Animator animator;
  8. public NavTab navTab;
  9. public ChatBarGlobalView globalView;
  10. public ChatBarChatView chatView;
  11. private bool m_isShown;
  12. public bool isShown
  13. {
  14. get{ return m_isShown;}
  15. }
  16. void Awake()
  17. {
  18. if(!isShown)
  19. this.gameObject.SetActive (false);
  20. navTab.SetTitles (new string[]{Language.GetStr("ChatPanel", "global"), Language.GetStr("ChatPanel", "chat")});
  21. }
  22. void OnDestroy()
  23. {
  24. }
  25. public void Show()
  26. {
  27. m_isShown = true;
  28. if (!this.gameObject.activeSelf)
  29. this.gameObject.SetActive (true);
  30. animator.Play ("ChatBarShow");
  31. }
  32. public void ShowComplete()
  33. {
  34. SyncManager.Sync (SyncManager.SyncType.Chat, 10f);
  35. }
  36. public void Hide()
  37. {
  38. m_isShown = false;
  39. animator.Play ("ChatBarHide");
  40. ChatPanel.Hide ();
  41. }
  42. }