コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: MenuCanvasManager.cs プロジェクト: YpbIrb/AlphaS
        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);
            }
        }