Grid m_Grid;
Vector3 world = Camera.main.ScreenToWorldPoint(Input.mousePosition); //현재 마우스의 위치를 Vector3로 가져옴
Vector3Int gridPos = m_Grid.WorldToCell(world); //Vector3 position을 Vector3Int로 바꿔줌
'Game development > Unity' 카테고리의 다른 글
유니티에서 2D 캐릭터 에니메이션 만들 때 좌우 대칭 손쉽게 하는 법 (0) | 2018.02.20 |
---|---|
한 오브젝트를 중심으로 orbit rotate 하기 (0) | 2018.02.02 |
유니티 3D Grid Tile + Object Placement + Wall Constructer (0) | 2018.01.24 |
애드몹과 구글 플레이 게임 서비스간의 충돌 해결법 (1) | 2017.12.08 |
안드로이드 세이브 파일 경로 지정시 주의할 점(Application.persistentDataPath가 마음대로 바뀌는 문제) (0) | 2017.12.08 |