Ejemplo n.º 1
0
    void displayInGameMenu(bool isOn)
    {
        switch (isOn)
        {
        case true:
            SwitchPaused(paused);
            ch.FirstPersonMode = true;
            ph.HoverShowOff(hoverPanel);
            ph.PanelShowOff();
            menuIsOn = false;
            break;

        case false:
            SwitchPaused(paused);
            if (da.open)
            {
                da.displayDiary(da.open);
            }
            ch.FirstPersonMode = false;
            ph.PanelShowUp(menuPanel);
            ph.HoverShowUp(hoverPanel);
            menuIsOn = true;
            break;
        }
    }
    // Use this for initialization
    void Start()
    {
        GlobalPanelHandler ph = GlobalPanelHandler.Instance;
        DataBaseHandler    db = DataBaseHandler.Instance;
        SCManager          sm = SCManager.Instance;

        startGameButton.onClick.AddListener(() =>
        {
            ph.HoverShowUp(HoverPanel);
            ph.PanelShowUp(JugarPartidaPanel);
        });
        historialButton.onClick.AddListener(() =>
        {
            ph.HoverShowUp(HoverPanel);
            ph.PanelShowUp(Historial);
        });

        exitButton.onClick.AddListener(() =>
        {
            Application.Quit();
        });

        HoverButton.onClick.AddListener(() =>
        {
            ph.HoverShowOff(HoverPanel);
            ph.PanelShowOff();
        });

        ngAceptButton.onClick.AddListener(() =>
        {
            db.CreateGame("Game1");
            sm.LoadScene("game1");
        });

        ngCancelButton.onClick.AddListener(() =>
        {
            ph.HoverShowOff(HoverPanel);
            ph.PanelShowOff();
        });

        db.UpdatePlayersDropdown(playersDrops);

        ngNewUser.onClick.AddListener(() =>
        {
            ph.PanelShowUp(NewUser);
        });
    }