InvitePanelScript.cs 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class InvitePanelScript : MonoBehaviour
  7. {
  8. public Button closeButton;
  9. public Button searchButton;
  10. public InputField searchField;
  11. public GameObject inviteSearchResultPrefab;
  12. // Start is called before the first frame update
  13. void Start()
  14. {
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. if (searchField.text.Length < 3) {
  20. searchButton.interactable = false;
  21. } else {
  22. searchButton.interactable = true;
  23. }
  24. }
  25. internal void ShowPanel() {
  26. CanvasGroup cg = this.GetComponent<CanvasGroup>();
  27. cg.alpha = 1f;
  28. cg.interactable = true;
  29. cg.blocksRaycasts = true;
  30. }
  31. internal void HidePanel() {
  32. CanvasGroup cg = this.GetComponent<CanvasGroup>();
  33. cg.alpha = 0f;
  34. cg.interactable = false;
  35. cg.blocksRaycasts = false;
  36. }
  37. }