Download Assets/Scripts/Interact/Key.cs from AliAch/my-unity-assets: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/datasets/AliAch/my-unity-assets/resolve/main/Assets/Scripts/Interact/Key.cs
- Command line
-
hf download hf://datasets/AliAch/my-unity-assets/Assets/Scripts/Interact/Key.cs
-
curl -L -o Key.cs https://huggingface.co/datasets/AliAch/my-unity-assets/resolve/main/Assets/Scripts/Interact/Key.cs
540 Bytes
| using System.Collections; | |
| using System.Collections.Generic; | |
| using Unity.VisualScripting; | |
| using UnityEngine; | |
| public class Key : MonoBehaviour, IInteractable | |
| { | |
| public KeyCode keyCode = KeyCode.E; | |
| public Sprite keySprite; | |
| public void interact() | |
| { | |
| Debug.Log("Interact!"); | |
| } | |
| public Sprite GetSprite() | |
| { | |
| return keySprite; | |
| } | |
| public bool CanInteract() | |
| { | |
| return (Input.GetKeyDown(keyCode)); | |
| } | |
| public Transform GetHandle() | |
| { | |
| return gameObject.transform; | |
| } | |
| } | |