Skip to content

Instantly share code, notes, and snippets.

@gkagm2
Last active April 23, 2019 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkagm2/fca96a789ac55673cbe7d529d75a4562 to your computer and use it in GitHub Desktop.
Save gkagm2/fca96a789ac55673cbe7d529d75a4562 to your computer and use it in GitHub Desktop.
NGUI Button을 이용한 Label control
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 방법 1
public class ButtonManager : MonoBehaviour {
public bool flag = true;
public GameObject label; //GameObject를 이용한다
public void StartBtn()
{
if (flag == true)
{
flag = false;
label2.SetActive(false);
}
else
{
flag = true;
label2.SetActive(true);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 방법 2
public class ButtonManager : MonoBehaviour {
public bool flag = ;
public UILabel label; //UILabel을 이용한다.
public void StartBtn()
{
if (flag == true)
{
flag = false;
label.enabled = false;
}
else
{
flag = true;
label.enabled = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment