123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- using System.Collections.Generic;
- using LitJson;
- public class MenuUI : MonoBehaviour {
- public enum UIState
- {
- Hidden,
- Hide,
- Show,
- Shown
- }
- public BattleController battleController;
- public Animator topBarAnim;
- public Animator leftBtnsAnim;
- public StartBtnContainer startBtnContainer;
- public MissionBar missionBar;
- public ChatBar chatBar;
- public InviteBar inviteBar;
- public ClanChatBar clanChatBar;
- private bool isReady;
- public void Start()
- {
- if(Session.GetInstance().GetBattleSession() == null)
- Session.GetInstance().NewBattleSession ();
-
- SoundManager.GetInstatnce().bgSound.Play(SoundManager.GetInstatnce().bgSound.menu);
- Screen.sleepTimeout = SleepTimeout.NeverSleep;
- }
- public void ShowNavBar()
- {
- UIUtil.Play (topBarAnim, UIUtil.AnimationName.Show);
- UIUtil.Play (leftBtnsAnim, UIUtil.AnimationName.Show);
- }
- public void OnNavBarShown()
- {
- }
- public void Ready()
- {
- isReady = true;
- startBtnContainer.Show();
- clanChatBar.Refresh ();
- // missionBar.PrepareData ();
- //GetComponent<WoodenDummyManager>().enabled = true;
- }
- public void ShowMail()
- {
- MailPanel.Show ();
- }
- public void ShowLeaderBoard()
- {
- LeaderBoard.Show ();
- }
- public void ShowClanPanel()
- {
- ClanPanel.Show ();
- }
- public void ShowShopPanel()
- {
- BuyCoinPanel.Show ();
- }
- public void StartBattle()
- {
- DoStartBattle();
- }
- private void DoStartBattle()
- {
- BattleSession battleSession = battleController.GetBattleSession ();
- battleSession.GetMessageManager ().SearchBattle (battleSession.mode);
- GetComponent<WoodenDummyManager> ().enabled = false;
- }
- }
|