Button Image 변경
Unity/찾아본것 2020. 8. 12. 10:111 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SceneTestStageBtn : MonoBehaviour { public Button btn;//버튼 public Sprite img;//바꿀 이미지 void Start() { this.btn.GetComponent<Image>().sprite = this.img; } } | cs |
https://answers.unity.com/questions/1127944/changing-the-image-of-a-button-with-a-script.html
'Unity > 찾아본것' 카테고리의 다른 글
Unity Button Array onClick (0) | 2020.08.11 |
---|---|
Unity GameObject 부모 자식 관계 설정 (0) | 2020.08.11 |
Unity Custom Inspector 커스텀 인스펙터 (0) | 2019.07.22 |
<화면 나누기> ViewportRect사용 (0) | 2019.06.14 |
setdestination can only be called on an active agent that has been placed on a navmesh (0) | 2019.05.03 |