Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class NotHitTransparent : MonoBehaviour
- {
- [Range(0, 1)] public float threshold = 0.5f;
- // Start is called before the first frame update
- void Start()
- {
- Image image = GetComponent<Image>();
- if(image != null) {
- image.alphaHitTestMinimumThreshold = threshold;
- } else {
- Debug.Log("Image is null!!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement