BattleReady.cs 741 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public class BattleReady : MonoBehaviour
  5. {
  6. public Text hostTxt;
  7. public Text guestTxt;
  8. public Text vsTxt;
  9. public Animator anim;
  10. private CallBackUtil.SimpleCallBack callBack;
  11. // Use this for initialization
  12. void Awake ()
  13. {
  14. }
  15. // Update is called once per frame
  16. private void Open ()
  17. {
  18. anim.Play ("BattleReady", 0, 0);
  19. }
  20. public void Ready()
  21. {
  22. if (callBack != null)
  23. {
  24. callBack();
  25. callBack = null;
  26. }
  27. }
  28. public void Close()
  29. {
  30. Destroy (this.gameObject);
  31. }
  32. public void Show(string host, string guest, CallBackUtil.SimpleCallBack callBack)
  33. {
  34. hostTxt.text = host;
  35. guestTxt.text = guest;
  36. this.callBack = callBack;
  37. Open();
  38. }
  39. }