Download Assets/Scripts/Interact/InteractionUI.cs from AliAch/my-unity-assets: direct link, hf CLI and curl.
- Browser
- Download file 552 Bytes
-
https://huggingface.co/datasets/AliAch/my-unity-assets/resolve/main/Assets/Scripts/Interact/InteractionUI.cs
- Command line
-
hf download hf://datasets/AliAch/my-unity-assets/Assets/Scripts/Interact/InteractionUI.cs
-
curl -L -o InteractionUI.cs https://huggingface.co/datasets/AliAch/my-unity-assets/resolve/main/Assets/Scripts/Interact/InteractionUI.cs
552 Bytes
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class InteractionUI : MonoBehaviour | |
| { | |
| public Image image; | |
| public Transform handle; | |
| public void setUI(Sprite sprite, Transform handleTransform) | |
| { | |
| image.sprite = sprite; | |
| handle = handleTransform; | |
| } | |
| private void FixedUpdate() | |
| { | |
| if(handle != null) | |
| { | |
| image.rectTransform.position = InteractionManager.instance.playerCam.WorldToScreenPoint(handle.position); | |
| } | |
| } | |
| } | |