MenuUI.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using LitJson;
  6. public class MenuUI : MonoBehaviour {
  7. public enum UIState
  8. {
  9. Hidden,
  10. Hide,
  11. Show,
  12. Shown
  13. }
  14. public BattleController battleController;
  15. public Animator topBarAnim;
  16. public Animator leftBtnsAnim;
  17. public Animator rightBarAnim;
  18. public StartBtnContainer startBtnContainer;
  19. public MissionBar missionBar;
  20. public ChatBar chatBar;
  21. public InviteBar inviteBar;
  22. public ClanChatBar clanChatBar;
  23. private bool isReady;
  24. public void Start()
  25. {
  26. if(Session.GetInstance().GetBattleSession() == null)
  27. Session.GetInstance().NewBattleSession ();
  28. SoundManager.GetInstatnce().bgSound.Play(SoundManager.GetInstatnce().bgSound.menu);
  29. Screen.sleepTimeout = SleepTimeout.NeverSleep;
  30. }
  31. public void ShowNavBar()
  32. {
  33. UIUtil.Play (topBarAnim, UIUtil.AnimationName.Show);
  34. UIUtil.Play (leftBtnsAnim, UIUtil.AnimationName.Show);
  35. UIUtil.Play (rightBarAnim, UIUtil.AnimationName.Show);
  36. }
  37. public void OnNavBarShown()
  38. {
  39. }
  40. public void Ready()
  41. {
  42. isReady = true;
  43. startBtnContainer.Show();
  44. clanChatBar.Refresh ();
  45. // missionBar.PrepareData ();
  46. //GetComponent<WoodenDummyManager>().enabled = true;
  47. }
  48. public void ShowMail()
  49. {
  50. MailPanel.Show ();
  51. }
  52. public void ShowLeaderBoard()
  53. {
  54. LeaderBoard.Show ();
  55. }
  56. public void ShowClanPanel()
  57. {
  58. ClanPanel.Show ();
  59. }
  60. public void ShowShopPanel()
  61. {
  62. BuyCoinPanel.Show ();
  63. }
  64. public void ShowEquipPanel()
  65. {
  66. EquipPanel.Show ();
  67. }
  68. public void StartBattle()
  69. {
  70. DoStartBattle();
  71. }
  72. private void DoStartBattle()
  73. {
  74. BattleSession battleSession = battleController.GetBattleSession ();
  75. battleSession.GetMessageManager ().SearchBattle (battleSession.mode);
  76. GetComponent<WoodenDummyManager> ().enabled = false;
  77. }
  78. }