public void OpenCanvas(MenuCanvasType _type)
        {
            if (lastActiveCanvas != null)
            {
                lastActiveCanvas.gameObject.SetActive(false);
            }

            CanvasController desiredCanvas = canvasControllerList.Find(x => x.menuCanvasType == _type);

            if (desiredCanvas != null)
            {
                desiredCanvas.gameObject.SetActive(true);
                lastActiveCanvas = desiredCanvas;
            }
            else
            {
                Debug.LogWarning("The desired canvas was not found!");
            }

            if (!canvas.enabled)
            {
                canvas.enabled = true;
            }

            Debug.Log("Opening Canvas . type = " + _type);
        }
Exemple #2
0
        public CanvasController GetCanvasControllerByType(MenuCanvasType _type)
        {
            CanvasController desiredCanvas = canvasControllerList.Find(x => x.menuCanvasType == _type);

            if (desiredCanvas != null)
            {
                return(desiredCanvas);
            }
            else
            {
                Debug.LogWarning("The desired canvas was not found!");
                return(null);
            }
        }