Skip to content

UMA integration errors #9

Description

@dmenefee

With the latest version of UMA 2 (2.1.0), I saw compilation errors in UMAEquippableInventoryItem.cs, in both the overlayLibrary and slotLibrary properties. To fix, use the following code snippet to set those values from the UMA PlayerManager:

    private OverlayLibraryBase _overlayLibrary;
    protected OverlayLibraryBase overlayLibrary
    {
        get
        {
            if (_overlayLibrary == null)
            {
                UMAContextBase contextBase = PlayerManager.instance.currentPlayer.GetComponent<UMADynamicAvatar>().context;
                if (contextBase is UMAContext context)
                {
                    _overlayLibrary = context.overlayLibrary;
                }
            }

            return _overlayLibrary;
        }
    }

    private SlotLibraryBase _slotLibrary;
    protected SlotLibraryBase slotLibrary
    {
        get
        {
            if (_slotLibrary == null)
            {
                UMAContextBase contextBase = PlayerManager.instance.currentPlayer.GetComponent<UMADynamicAvatar>().context;
                if (contextBase is UMAContext context)
                {
                    _slotLibrary = context.slotLibrary;
                }
            }

            return _slotLibrary;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions