public void Update() { if (!hasAuthority) { Ready.GetComponent <Button>().interactable = (false); Cancel.GetComponent <Button>().interactable = (false); } else { Ready.GetComponent <Button>().interactable = (true); Cancel.GetComponent <Button>().interactable = (true); } }
// Use this for initialization void Start() { ReplayWenFailed.GetComponent <Button>().onClick.AddListener(ButReplay); ReplayWenWin.GetComponent <Button>().onClick.AddListener(ButReplay); Next.GetComponent <Button>().onClick.AddListener(ButNext); Cancel.GetComponent <Button>().onClick.AddListener(ButCancel); keo1.SetActive(false); keo2.SetActive(false); ReplayWenFailed.SetActive(false); ReplayWenWin.SetActive(false); Next.SetActive(false); Target.SetActive(false); //BG_GameOver.GetComponent<Image>().color = Color.gray; BG_GameOver.GetComponent <Image>().fillAmount = 0; BG_GameOver.SetActive(false); GetComponent <Image>().color = new Color(0, 0, 0, 0); }