CheckBoxConditionsHandler.cs 764 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Xml.Schema;
  4. using System;
  5. public class CheckBoxConditionsHandler : ToggleButton
  6. {
  7. public GameObject LabelLogin;
  8. public GameObject LabelLogout;
  9. void Start()
  10. {
  11. LabelLogin.gameObject.SetActive(false);
  12. LabelLogout.gameObject.SetActive(true);
  13. }
  14. void OnClick()
  15. {
  16. Toggle();
  17. }
  18. public bool Check;
  19. void Toggle()
  20. {
  21. Check = !Check;
  22. if (Check)
  23. {
  24. LabelLogin.gameObject.SetActive(true);
  25. LabelLogout.gameObject.SetActive(false);
  26. }
  27. else
  28. {
  29. LabelLogin.gameObject.SetActive(false);
  30. LabelLogout.gameObject.SetActive(true);
  31. }
  32. }
  33. }