Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- public class PlayerWeaponController : MonoBehaviour {
- public GameObject weapon; // Public reference to the weapon
- public Image UIcrosshair; // Reference to the UI component
- public Sprite weaponCrosshair; // Reference to the specific weapon crosshair
- public void EquipWeapon() {
- UIcrosshair.sprite = weaponCrosshair;
- weapon.SetActive(true); // Activate the weapon gameobject
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement