Advertisement
SvOzMaS

PlayerWeaponController

Oct 28th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class PlayerWeaponController : MonoBehaviour {
  5.     public GameObject weapon;           // Public reference to the weapon
  6.     public Image UIcrosshair;           // Reference to the UI component
  7.     public Sprite weaponCrosshair;      // Reference to the specific weapon crosshair
  8.  
  9.     public void EquipWeapon() {
  10.         UIcrosshair.sprite = weaponCrosshair;
  11.         weapon.SetActive(true); // Activate the weapon gameobject
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement