Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class InventoryManager : MonoBehaviour {
- [Header("These stats change")]
- public int invCapacity;
- [Header("These stats are STATic xD")]
- public int maxCapacity = 32;
- [Header("These are item scripts")]
- public bool gotMagazine = false;
- public int magazineCount = 0;
- public int magazineCapacity = 1;
- public bool gotBat = false;
- public int batCapacity = 5;
- public bool gotGun = false;
- public int gunCapacity = 3;
- [Header("These just make it work")]
- public bool gunCounted = false;
- public bool magazineCounted = false;
- public bool batCounted = false;
- // Use this for initialization
- void Start () {
- invCapacity = maxCapacity;
- GameObject theGun = GameObject.Find("TheGun");
- GameObject thePlayer = GameObject.Find("Player");
- GameObject theMagazine = GameObject.Find ("Magazine");
- }
- // Update is called once per frame
- void Update () {
- if (gotGun == true && gunCounted == false) {
- invCapacity -= gunCapacity;
- gunCounted = true;
- }
- if (magazineCount > 0 && gotMagazine == true && magazineCounted == false) {
- invCapacity -= magazineCount * magazineCapacity;
- magazineCount = 0;
- magazineCounted = true;
- gotMagazine = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement