Skip to main content

AmmoUsage.SwitchAmmoType

Declaration#

public void SwitchAmmoType(string ammoItemId, bool returnOldToInventory, bool loadNow)

Parameters#

NameDescription
ammoItemIdNew type of ammo to use
returnOldToInventoryReturn any old ammo to the inventory
loadNowLoad the new ammo now

Description#

Set the type of ammo to use when firing.

Usage#

Example
using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{    public void ExampleMethod(GDTKItem item, string newAmmoId)    {        AmmoUsage plugin = item.GetPlugin<AmmoUsage>();        plugin.SwitchAmmoType(newAmmoId, true, true);    }}