Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class WeaponManager : MonoBehaviour
- {
- //Singleton instance so the weapons can be given to / taken away from the player easily from any script in the project
- public static WeaponManager Instance = null;
- void Awake() { Instance = this; }
- //Tracks and Toggles players access to the Shotgun weapon
- public GameObject Shotgun;
- public bool ShotgunAcquired = true;
- public void ToggleShotgun(bool Enabled)
- {
- //Enable the Shotgunweapon
- Debug.Log("Player has " + (Enabled ? "acquired" : "lost") + " the Shotgun.");
- ShotgunAcquired = Enabled;
- Shotgun.SetActive(Enabled);
- }
- //Tracks and Toggles if the player has access to the PulseRifle weapon
- public GameObject PulseRifle;
- public bool PulseRifleAcquired = false;
- public void TogglePulseRifle(bool Enabled)
- {
- Debug.Log("Player has " + (Enabled ? "acquired" : "lost") + " the PulseRifle.");
- PulseRifleAcquired = Enabled;
- PulseRifle.SetActive(Enabled);
- }
- //Tracks and Toggles if the player has access to the RocketLauncher weapon
- public GameObject RocketLauncher;
- public bool RocketLauncherAcquired = false;
- public void ToggleRocketLauncher(bool Enabled)
- {
- Debug.Log("Player has " + (Enabled ? "acquired" : "lost") + " the RocketLauncher.");
- RocketLauncherAcquired = Enabled;
- RocketLauncher.SetActive(Enabled);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement