Tile
클래스는 타일맵에서 스프라이트를 렌더링하는 데 사용되는 단순 클래스입니다. 타일은 TileBase
로부터 값을 상속받습니다. 다음은 타일을 변경하기 위해 오버라이드할 수 있는 메서드에 대한 설명입니다.
public Sprite sprite;
public Color color = Color.white;
public Matrix4x4 transform = Matrix4x4.identity;
public GameObject gameobject = null;
public TileFlags flags = TileFlags.LockColor;
public ColliderType colliderType = ColliderType.Sprite;
타일의 기본 프로퍼티입니다. 스프라이트를 타일맵 팔레트에 끌어다 놓는 방법으로 타일을 생성할 때 타일의 Sprite 프로퍼티가 끌어다 놓은 스프라이트의 값대로 설정됩니다. 타일 인스턴스의 프로퍼티를 조절하여 원하는 타일을 만들 수 있습니다.
public void RefreshTile(Vector3Int location, ITilemap tilemap)
TileBase
에서 오버라이드되지 않습니다. 기본적으로 해당 위치에서만 타일을 새로 고칩니다.
public override void GetTileData(Vector3Int location, ITilemap tilemap, ref TileData tileData)
{
tileData.sprite = this.sprite;
tileData.color = this.color;
tileData.transform = this.transform;
tileData.gameObject = this.gameObject;
tileData.flags = this.flags;
tileData.colliderType = this.colliderType;
}
타일 인스턴스의 프로퍼티를 tileData
로 복사하여 타일맵에서 타일을 렌더링하기 위해 필요한 정보를 채워 넣습니다.
public bool GetTileAnimationData(Vector3Int location, ITilemap tilemap, ref TileAnimationData tileAnimationData)
TileBase
에서 오버라이드되지 않습니다. 기본적으로 Tile
클래스는 타일 애니메이션을 실행하지 않으며 False를 반환합니다.
public bool StartUp(Vector3Int location, ITilemap tilemap, GameObject go)
TileBase
에서 오버라이드되지 않습니다.기본적으로 Tile
클래스에는 특수 시작 기능이 없습니다.tileData.gameObject
가 설정되어 있는 경우에도 시작 시에 타일맵에서 이를 인스턴스화하고 타일의 위치에 배치합니다.
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.