Programmer:)
[Unity] Button Color (Inspector에서 설정하기) 본문
반응형
script로 color 값을 변경하는 것이 아닌
inspactor를 통해 color 값을 변경하는 방법에 대해 알아보자.
Transition 중 Color Tint 에 대한 설명.
Normal Color : 일반
Highlighted Color : 강조
Pressed Color : 눌렀을 때
Selected Color : 선택했을 때
Disabled Color : 비활성화 됐을 때
Color Multiplier : event color 들에 해당값을 곱함 //활용 예시를 찾아보려 했으나 찾지못함 ㅠ
Fade Duration : 다른 컬러로 변경되는 시간(초)
Navigation : 방향키에 따른 UI 활성화 설정.
원하는 Event에 컬러를 설정해두면 별다른 스크립트 제어 없이 설정 한 컬러를 버튼에 반영 할 수 있다.
Disable Color의 경우 아래와 같이 스크립트에서 상태를 변경하면 해당컬러로 변경된다.
Button button;
button.interactable = false; //버튼 비활성화
button.interactable = true; //버튼 활성화
반응형
'DEV > Unity' 카테고리의 다른 글
[Unity] BuildSetting > Architecture > Apple silicon (0) | 2024.07.26 |
---|---|
[Unity] Android 인앱 업데이트 (0) | 2024.04.30 |
[Unity] user32.dll을 이용한 윈도우 컨트롤 (feat.최대화, 최소화) (0) | 2022.10.21 |
[Unity] Google Sheets 연동 ( google sheets to unity ) (0) | 2022.10.11 |
[C#] string '+' or Concat or StringBuilder (0) | 2022.08.24 |
Comments