Skip to main content

HolsterSlotClient.Initialize

Declaration#

public void Initialize(HolsterAction action, EquipSlotClient client)

Parameters#

NameDescription
actionAssociated Holster Action plugin
clientAssociated EquipSlotClient

Description#

Initialize the object

Usage#

Example
using NullSave.GDTK.Inventory;using UnityEngine;
public class CodeSample : MonoBehaviour{
    public void ExampleMethod(GDTKItem target, EquipSlotClient other)    {        // Get the holster action        HolsterAction holsterAction = target.GetPlugin<HolsterAction>();        if (holsterAction == null) return;
        HolsterSlotClient holsterSlot;
        // Find appropriate holster client        foreach (string id in holsterAction.slotIds)        {            if (!other.equipSlot.forbidHolsters.Contains(id))            {                HolsterSlotClient holster = other.inventory.GetHolsterSlotClient(id);                if (holster != null && holster.boundEquipSlot == null)                {                    holsterSlot = holster;                    if (holsterAction.spawnHolsterItem)                    {                        // Initialize the client                        holster.Initialize(holsterAction, other);                    }                    break;                }            }        }    }
}