TilemapEditorTool
은 Tile Palette 창의 에디터 툴을 정의하는 상속 가능한 클래스입니다. Tile Palette 창의 새로운 에디터 툴을 만들려면 TilemapEditorTool
을 상속하는 새로운 클래스를 만드십시오. 새 TilemapEditorTool
클래스에 대해 모든 필수 메서드를 오버라이드하십시오.
TilemapEditorTool
의 다음 메서드를 오버라이드할 수 있습니다.
protected abstract string tooltipStringFormat { get; }
TilemapEditorTool
의 툴팁을 표시하려면 정의하십시오. TilemapEditorTool
의 단축키가 이 메서드에 전달되어 최종 툴팁을 위해 포맷됩니다.
protected abstract string shortcutId { get; }
툴의 키보드 단축키를 식별하기 위한 단축키 ID를 할당할 때 정의하십시오.
public virtual GUIContent toolbarIcon { get; }
TilemapEditorTool
의 아이콘을 표시하려면 정의하십시오. 이 메서드를 정의하지 않으면 툴바가 툴 모드 아이콘을 표시합니다.
public virtual bool HandleTool(bool isHotControl, GridLayout gridLayout, GameObject brushTarget, Vector3Int gridMousePosition)
TilemapEditorTool
처리를 위한 커스텀 동작을 정할 때 오버라이드하십시오. 다음 파라미터가 메서드로 전달되어 추가 정보를 제공합니다.
이름 | 기능 |
---|---|
isHotControl | 툴이 UnityGUI 에 따른 핫 컨트롤인지 여부를 나타냅니다(자세한 내용은 GUIUtility.hotControl을 참조하십시오). |
gridLayout | 툴이 처리하는 GridLayout입니다. |
brushTarget | 툴이 처리하는 게임 오브젝트입니다. |
gridMousePosition | 현재 마우스 커서가 위치한 그리드 셀 위치입니다. |
public override bool IsAvailable()
현재 시간에 TilemapEditorTool
을 활성화할 수 있는지 여부를 나타냅니다. TilemapEditorTool
활성화를 위한 선행 조건을 사용할 수 있는지 확인하는 데 사용하십시오.
커스텀 TilemapEditorTool
은 타일 팔레트 환경 설정을 사용하여 타일 팔레트의 기본 툴로 추가하거나, GridBrush
에 해당 커스텀 TilemapEditorTool
의 타입인 BrushTool
속성이 있는 경우 해당 그리드 브러시의 툴로 추가할 수 있습니다.
[2021.2]에 TilemapEditorTool 페이지가 추가되었습니다(https://docs.unity3d.com/2021.2/Documentation/Manual/30_search.html?q=newin20212) .
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.