HolsterSlotClient.Initialize
Declaration#
public void Initialize(HolsterAction action, EquipSlotClient client)Parameters#
| Name | Description |
|---|---|
| action | Associated Holster Action plugin |
| client | Associated 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; } } } }
}