낚시하고 싶어요.
4498 단어 Unity
나는 강에서 낚시하는 것 같은 것을 하고 싶다.
맵 만들기
지도 제작은 이쪽 자산을

매크로 패키지 가져오기
사용된 문서는 영어이지만 Docomentation 폴더에 있습니다.
하지만 장면도 여러 개 있으니 대충 보면 알 수 있을 거예요.

빠른 매핑 생성
어쨌든 간단하게 새로운 장면을 만들어보도록 하겠습니다.
RpgMapEditor->AutoTileMap

등급 제도적으로 대상을 설정할 수 있기 때문에 검사기로 설정합니다.

TileSet은 이미 넣은 것을 사용합니다(Samples/Scens/AutoTileSet)
MapData는 새로 제작되었으므로 Create
이렇게 하면 검사기에서 이렇게 되는 느낌.

플레이 버튼으로 맵 칠하기
플레이 버튼을 누르면 원하는 것을 골라 바르면 된다.
층도 취향에 따라 분리할 수 있고, 뚫은 물건으로 만들 수 있다.
범위를 선택하여 복사할 수 있으며 연속된 곳은 마음대로 붙일 수 있습니다.
바르고 끊으면 OK.

어쨌든 이 정도면 됐어.

역할 우선 구성
RpgMapEditor->Character 실행

완료된 객체의 검사자에서 역할 칩에 대한 Sprite를 설정합니다.
캐릭터 팁은 '구정회'.씨의 물건을 사용합니다.
이거 설정하면 완성!

캐릭터를 움직이게 하기 위해서.
아까 객체에 대해 십자 키를 사용하여 이동하는 것처럼 Player Controller를 이동합니다.첨부 cs
이것만 붙이면 캐릭터를 십자키로 움직일 수 있다.
카메라가 캐릭터를 따라가는 기초 위에서
PlayerCamera.등급 제도로prefab 설정
검사기부터 캐릭터 설정까지FoollowObjectBehavior의 target이 완성되었습니다.

화면 가장자리를 처리하지 않아 외출이 가능했지만 눈 깜짝할 사이에 완성됐다.
성공 판정도 있으니 여기서 10분도 안 걸려서 완성할 수 있어!

이것으로 끝낼 준비를 하다
다음은 물고기의 표시...
생각만 해도 질린다
어쨌든 먼저 했습니다.
배우들은 물고기 근처에서 물고기가 도망간다고 한다.

Scene 화면입니다.물고기의 이동 목적지에gizmo를 표시하여 쉽게 알 수 있도록 합니다.
목적지에 도착하면 적당히 이동하도록 하겠습니다.
땅바닥에 앉지 마라.

제작할 때 자주 사용하는 것은 월드 좌표에서tilemap의 좌표를 구하는 것이다
tilemap에서 월드 좌표를 구합니다.
// ワールド座標からタイルの位置を取得
public static Vector2 GetWorldPosToTilePos(Vector3 pos)
{
int tile_x = Mathf.RoundToInt(pos.x * 100f / autoTileMap.Tileset.TileWidth);
int tile_y = Mathf.RoundToInt(-pos.y * 100f / autoTileMap.Tileset.TileHeight);
return new Vector2(tile_x, tile_y);
}
// タイル座標からワールドの位置を取得
public static Vector3 GetTilePosToWorldPos(int x, int y)
{
float xPos = x + 0.5f;
float yPos = y + 0.5f;
return new Vector3(xPos * autoTileMap.Tileset.TileWidth * 0.01f, -yPos * autoTileMap.Tileset.TileHeight * 0.01f, 0);
}
이런 느낌으로 전환하고 있어요.
Reference
이 문제에 관하여(낚시하고 싶어요.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ayumegu/items/557c15a8791f55303eb2텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)