void AssignInvWeaponManager() { if (wm == null) { wm = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>(); } }
public void AddAmmo(int amount) { //NOTE: the "SetWeaponId" must be called prior to this if (itemId == 9999999) { return; } InvWeaponManager invMg = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>(); invMg.AddAmmo(itemId, amount); itemId = 9999999; }
void Start() { gameManager = dontDestroy.currentGameManager; guiManager = gameManager.GetComponent <GUIManager>(); wm = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>(); }