RoomToggleChoose.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Unity.VisualScripting;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class RoomToggleChoose : MonoBehaviour
  7. {
  8. public int id;
  9. private void OnEnable()
  10. {
  11. if(DataManager.admin!=1)
  12. {
  13. this.GetComponent<Button>().onClick=new Button.ButtonClickedEvent();
  14. }
  15. //index = this.GetComponentIndex();
  16. }
  17. public void choose(bool b)
  18. {
  19. if (b&& id!=0&&DataManager.admin==1)
  20. {
  21. ServerRoomManager.chooswsd = id;
  22. Debug.Log("chooswsd__" + ServerRoomManager.chooswsd);
  23. if (DianLiJianKongManager.Instance && DianLiJianKongManager.Instance.gameObject.activeSelf && id != 0)
  24. DianLiJianKongManager.Instance.chooseToggle(id);
  25. else if (ShiPingJianKongManager.Instance && ShiPingJianKongManager.Instance.gameObject.activeSelf && id != 0)
  26. ShiPingJianKongManager.Instance.chooseToggle(id);
  27. else
  28. {
  29. }
  30. }
  31. }
  32. }