[Unity] ์คํฌ๋ฆฝํธ์์ ์ค๋ธ์ ํธ anchor, pivot ๋ณ๊ฒฝํ๋ ๋ฐฉ๋ฒ
2021. 8. 11. 05:25
์คํฌ๋ฆฝํธ์์ ์ง์ ๊ฒ์ ์ค๋ธ์ ํธ์ anchor์ pivot์ ๋ณ๊ฒฝํ๊ธฐ ์ํด์๋ anchorMin, anchorMax, pivot์ ๋ณ๊ฒฝํด์ค์ผ ํ๋ค. ์๋ฅผ ๋ค์ด ์ค๋ธ์ ํธ์ anchor์ pivot์ middle-right๋ก ๋ณ๊ฒฝํ ๊ฒฝ์ฐ, ํด๋น ๋ฒกํฐ ๊ฐ์ธ (1f, 0.5f)๋ฅผ anchorMin, anchorMax, pivot์ ์ง์ ํด์ค์ผ ํ๋ค. //๊ฒ์ ์ค๋ธ์ ํธ obj์ anchor์ pivot์ middle-right(1f, 0.5f)๋ก ๋ฐ๊พผ๋ค. Vector2 direction = new Vector2(1f, 0.5f); obj.GetComponent().anchorMin = direction; obj.GetComponent().anchorMax = direction; obj.GetComponent().p..