Inventory package import

I had a couple of problems with this package.
The first was that the Inventory Canvas shows the Inventory on the left and the Equipment on the right.
The Second is that the HideShow script is missing.

I’m not sure what happened to swap the locations of the Inventory and Equipment. You should be able to re-anchor and move these to your liking.

Here’s the ShowHideUI script. It should be placed on the UI Canvas, then drag the Hiding Panel into the uiContainer slot.

using UnityEngine;

namespace GameDevTV.UI
{
    public class ShowHideUI : MonoBehaviour
    {
        [SerializeField] KeyCode toggleKey = KeyCode.Escape;
        [SerializeField] GameObject uiContainer = null;

        // Start is called before the first frame update
        void Start()
        {
            uiContainer.SetActive(false);
        }

        // Update is called once per frame
        void Update()
        {
            if (Input.GetKeyDown(toggleKey))
            {
                Toggle();
            }
        }

        public void Toggle()
        {
            uiContainer.SetActive(!uiContainer.activeSelf);
        }
    }
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms