[Memo-Unity] 13. MaskLayer
์นดํ ๊ณ ๋ฆฌ: MeMo Unity
ํ๊ทธ: C#, MeMo Unity
MaskLayer
, Trail Renderer
MaskLayer
1. MaskLayer
MaskLayer์ ํตํด ์ถฉ๋ ์กฐ๊ฑด
์ฌ์ฉํ ๋ ์ด์ด๋ฅผ ์ถ๊ฐ ( 6 : Enemy, 7 : Level, 8 : Player )
if (levelCollisionLayer.value == (levelCollisionLayer.value | (1 << collision.gameObject.layer)))
{
Debug.Log(levelCollisionLayer.value); // 10000000
Debug.Log(collision.gameObject.layer); // 7
Debug.Log(1 << collision.gameObject.layer); // 10000000
Debug.Log((levelCollisionLayer.value | (1 << collision.gameObject.layer)));
DestroyProjectile(collision.ClosestPoint(transform.position) - _direction * .2f, fxOnDestory);
}
์๋ชป๋ ์๊ฐ ์์
(1 ยซย collision.gameObject.layer)
์ด ์ฝ๋๊ฐ collision.gameObject.layer ๋ฅผ 1๋งํผ ยซย ํ๋ค๊ณ ์๋ชป ์๊ฐํ๊ณ ์์๋ค.
๋นํธ์ฐ์ฐ์์ ๊ดํ์ฌ ์ ๋ชจ๋ฅด๊ณ ์์๊ณ , debug ๋ฅผ ์ฐ์ด๋ณด๋ ์๊ฒ๋์๋ค.
1์ collision.gameObject.layer(7) ๋งํผ ยซย ํ๋ ๊ฑฐ ์๋ค.
= 10000000 = levelCollisionLayer.value
levelCollisionLayer.value = 128 = 10000000
collision.gameObject.layer = 7
Trail Renderer
์์ง์ด๋ ๊ฒ์ ์ค๋ธ์ ํธ ๋ค์ ํด๋ฆฌ๊ณค ํธ๋ ์ผ์ ๋ ๋๋ง ํ๋ค.
width, color, Materials
์ ๋ฆฌ
[Unity] MaskLayer
TOP
๋๊ธ๋จ๊ธฐ๊ธฐ