alphaHitTestMinimumThreshold 를 사용해서 raycast가 가능한 alpha값을 조절하는 것
using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.
public class ExampleClass : MonoBehaviour
{
public Image theButton;
// Use this for initialization
void Start()
{
theButton.alphaHitTestMinimumThreshold = 0.5f;
}
}
1로 설정하게 될 경우, 완전 불투명한 pixel만 선택 가능하게 된다.
완전 꿀팁인듯!
참고
https://sensol2.tistory.com/35
'Unity > 잡학 사전' 카테고리의 다른 글
[Unity] animator (0) | 2022.10.21 |
---|---|
[Unity] Particle System (0) | 2022.10.20 |
[Unity] Sprite Renderer (0) | 2022.09.27 |
[Unity] 파티클 시스템 이미지 뒤로 보내는 방법(Particle system behind the image) (0) | 2022.09.26 |
[Unity/Animation] 유니티 애니메이션 단위 (0) | 2022.09.16 |