23 lines
663 B
C#
23 lines
663 B
C#
namespace Sasalka;
|
|
|
|
public class AttachmentSlotResolver
|
|
{
|
|
private readonly Func<string, GameObject> _attachmentGetter;
|
|
|
|
public AttachmentSlotResolver( Func<string, GameObject> attachmentGetter )
|
|
{
|
|
_attachmentGetter = attachmentGetter;
|
|
}
|
|
|
|
public GameObject GetSlotObject( Inventar.InventorySlot slot )
|
|
{
|
|
return slot switch
|
|
{
|
|
Inventar.InventorySlot.LeftHand => _attachmentGetter.Invoke( "hold_L" ),
|
|
Inventar.InventorySlot.RightHand => _attachmentGetter.Invoke( "hold_R" ),
|
|
Inventar.InventorySlot.Body => _attachmentGetter.Invoke( "forward_reference_modelspace" ),
|
|
_ => _attachmentGetter.Invoke( "forward_reference_modelspace" )
|
|
};
|
|
}
|
|
}
|