Advertisement
evelynshilosky

EquipableItem - Part 13

Jun 4th, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. [RequireComponent(typeof(Animator))]
  6. public class EquipableItem : MonoBehaviour
  7. {
  8.  
  9.     public Animator animator;
  10.  
  11.     // Start is called before the first frame update
  12.     void Start()
  13.     {
  14.         animator = GetComponent<Animator>();
  15.     }
  16.  
  17.     // Update is called once per frame
  18.     void Update()
  19.     {
  20.      
  21.         if (Input.GetMouseButtonDown(0) && // Left Mouse Button
  22.             InventorySystem.Instance.isOpen == false &&
  23.             CraftingSystem.Instance.isOpen == false &&
  24.             SelectionManager.Instance.handIsVisible == false
  25.             )
  26.         {
  27.             animator.SetTrigger("hit");
  28.         }
  29.  
  30.     }
  31. }
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement