None = 0
타일에 플래그를 설정하지 않습니다. 대부분의 타일에 적용되는 기본값입니다.
LockColor = 1 << 0
타일 스크립트를 통해 타일의 색상을 결정한다면 이 플래그를 설정합니다. 플래그를 설정하면 타일이 타일맵에 배치될 때 색상이 결정됩니다. 색칠이나 스크립트를 통해 타일 색상을 변경할 수 없습니다. 플래그를 설정하지 않으면 색칠이나 스크립트를 통해 타일 색상을 변경할 수 있습니다.
LockTransform = 1 << 1
타일 스크립트를 통해 타일의 트랜스폼을 결정한다면 이 플래그를 설정합니다. 플래그를 설정하면 타일이 타일맵에 배치될 때 트랜스폼이 결정됩니다. 색칠이나 스크립트를 통해 타일의 트랜스폼을 변경할 수 없습니다. 플래그를 설정하지 않으면 색칠이나 스크립트를 통해 타일의 트랜스폼을 변경할 수 있습니다.
LockAll = LockColor | LockTransform
TileBase에 사용되는 모든 잠금 플래그의 조합입니다.
InstantiateSpawnGameObjectRuntimeOnly = 1 << 2
프로젝트가 실행 중이고 에디터 모드가 아닐 때 타일 스크립트를 통해 게임 오브젝트를 스폰해야 한다면 이 플래그를 설정합니다.
None = 0
이 타일은 콜라이더 모양을 생성하지 않습니다.
Sprite = 1
이 타일이 생성하는 콜라이더 모양은 타일이 반환하는 스프라이트에 설정된 물리 모양을 따릅니다. 스프라이트에 설정된 물리 모양이 없다면 스프라이트의 윤곽선을 기준으로 모양이 생성됩니다.
참고: 타일의 콜라이더 모양을 런타임 시점에 생성해야 한다면 스프라이트의 물리 모양을 설정하거나 윤곽선을 기준으로 모양을 생성할 수 있도록 스프라이트의 텍스처를 읽을 수 있게 설정하십시오.
Grid = 2
이 타일이 생성하는 콜라이더 모양은 그리드의 레이아웃에 정의된 셀의 모양을 따릅니다.
ITilemap
은 타일맵이 타일에서 데이터를 검색해서 가져오려고 할 때 Tile
이 타일맵에서 데이터를 검색해서 가져오는 기본 클래스(base class)입니다.
Vector3Int origin { get; }
셀 공간에서 타일맵의 원점을 반환합니다.
Vector3Int size { get; }
셀 공간에서 타일맵의 크기를 반환합니다.
Bounds localBounds { get; }
로컬 공간에서 타일맵의 경계를 반환합니다.
BoundsInt cellBounds { get; }
셀 공간에서 타일맵의 경계를 반환합니다.
Sprite GetSprite(Vector3Int location);
주어진 위치에서 타일맵의 타일에 사용된 스프라이트를 반환합니다.
Color GetColor(Vector3Int location);
주어진 위치에서 타일맵의 타일에 사용된 색상을 반환합니다.
Matrix4x4 GetTransformMatrix(Vector3Int location);
주어진 위치에서 타일맵의 타일에 사용된 트랜스폼 행렬(transform matrix)을 반환합니다.
TileFlags GetTileFlags(Vector3Int location);
주어진 위치에서 타일맵의 타일에 사용된 플래그를 반환합니다.
TileBase GetTile(Vector3Int location);
주어진 위치에서 타일맵의 타일을 반환합니다. 타일이 없으면 null을 반환합니다.
T GetTile<T>(Vector3Int location) where T : TileBase;
주어진 위치에서 타일맵의 T 타입 타일을 반환합니다. 타입이 일치하는 타일이 없으면 null을 반환합니다.
void RefreshTile(Vector3Int location);
주어진 위치에서 타일맵의 타일을 새로 고치도록 요청합니다.
T GetComponent<T>();
타일맵의 게임 오브젝트에 연결된 T 컴포넌트를 반환합니다.
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.