TSS(테마 스타일시트) 파일은 일반 USS 파일입니다.UI 툴킷은 TSS를 별개의 에셋 타입으로 취급하여 관리 목적으로 사용합니다.
일반적인 USS 구문과 포맷은 TSS 파일에 적용되지만, 일반적으로 테마 파일에는 @import
규칙을 통해 다른 USS 파일에 대한 레퍼런스가 포함되어 있습니다.
참고:USS 파일은 또한 @import
규칙을 지원합니다.
테마별로 서로 다른 TSS 파일을 생성하고 런타임 시 테마 간에 전환할 수 있습니다.TSS를 사용하여 다양한 플랫폼 또는 기기에 맞게 디자인(look and feel)을 커스터마이즈할 수 있습니다.게임이나 애플리케이션이 여러 언어를 지원하는 경우 언어별로 다른 폰트를 사용하도록 TSS를 만들 수도 있습니다.
프로젝트의 게임 오브젝트에 첫 번째 UIDocument를 추가하면 Assets/UI Toolkit/UnityThemes/UnityDefaultTheme.tss
에서 기본 런타임 테마 에셋을 생성합니다.상속하고 스타일을 덮어쓰거나 새 스타일을 추가하여 커스텀 테마를 만들 수 있습니다.
새 TSS를 만들려면:
USS를 사용하는 것과 동일한 방법으로 C# 또는 UXML에서 TSS를 참조할 수 있습니다.
패널 설정 에셋의 기본 테마로 TSS를 설정할 수도 있습니다.패널 설정이 두 개 이상인 경우 각 패널 설정은 서로 다른 TSS 파일을 사용할 수 있습니다.
@import
규칙 또는 TSS 에셋의 인스펙터 창을 사용하여 테마를 상속할 수 있습니다.
@import
규칙의 구문은 다음과 같습니다.
@import url("<path-to-file>/fileName.tss");
인스펙터 창에서 테마를 상속하려면 다음을 수행하십시오.
@import
규칙 또는 TSS 에셋의 인스펙터 창을 사용하여 스타일시트를 임포트할 수 있습니다.
@import
규칙의 구문은 다음과 같습니다.
@import url("<path-to-file>/fileName.uss");
인스펙터 창에서 스타일시트를 임포트하려면 다음을 수행하십시오.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.