Exemplo n.º 1
0
    public bool ChangeCanvas(string id)
    {
        UIPreset ui = GetUI(id);

        if (ui == null)
        {
            Debug.Log("Tried to change to: " + id + ", Menu not found");
            return(false);
        }

        if (activeCanvas != null)
        {
            if (activeCanvas.id == id)
            {
                ResetCanvas();
                return(false);
            }
            activeCanvas.canvas.SetActive(false);
        }

        CharacterController_2D.Instance.SwitchControls(ui.controlScheme);
        ui.canvas.SetActive(true);
        activeCanvas = ui;
        return(true);
    }
Exemplo n.º 2
0
        public UIBase(string prefabPath, UIGroup group, UIPreset preset = UIPreset.None, string bgm = "") : base(prefabPath)
        {
            m_group  = group;
            m_preset = preset;
            m_bgm    = bgm;

            if (View3D())
            {
                AddRendererController();
            }
            else
            {
                AddVisibleBehaviourController <Graphic>();
            }
        }