public override void Update()
    {
        MainMenu.color    = Unselected;
        SwitchTeam.color  = Unselected;
        OptionsMenu.color = Unselected;
        BackToGame.color  = Unselected;
        ExitGame.color    = Unselected;

        if (MainMenu.Hovered())
        {
            MainMenu.color = Selected;
        }
        else if (SwitchTeam.Hovered() && _CanSwitchTeam)
        {
            SwitchTeam.color = Selected;
        }
        else if (OptionsMenu.Hovered())
        {
            OptionsMenu.color = Selected;
        }
        else if (BackToGame.Hovered())
        {
            BackToGame.color = Selected;
        }
        else if (ExitGame.Hovered())
        {
            ExitGame.color = Selected;
        }

        if (MainMenu.Clicked())
        {
            if (ThomasWrapper.IsPlaying())
            {
                Input.SetMouseMode(Input.MouseMode.POSITION_ABSOLUTE);
                CameraMaster.instance.SetState(CAM_STATE.LOADING_SCREEN);
                ThomasWrapper.IssueRestart();
            }
        }
        else if (SwitchTeam.Clicked() && _CanSwitchTeam)
        {
            CameraMaster.instance.Canvas.isRendering    = true;
            gameObject.GetComponent <ChadCam>().enabled = false;
            CameraMaster.instance.SetState(CAM_STATE.SELECT_TEAM);
        }
        else if (OptionsMenu.Clicked())
        {
            GUIOptionsMenu.instance.ActivatedfromExitmenu = true;
            CameraMaster.instance.SetState(CAM_STATE.OPTIONS_MENU);
        }
        else if (BackToGame.Clicked())
        {
            CameraMaster.instance.SetState(CAM_STATE.GAME);
            Input.SetMouseMode(Input.MouseMode.POSITION_RELATIVE);
        }
        else if (ExitGame.Clicked())
        {
            ThomasWrapper.IssueShutdown();
        }
    }
Esempio n. 2
0
        private void PlayPauseButton_Click(object sender, ExecutedRoutedEventArgs e)
        {
            if (ThomasWrapper.IsPlaying())
            {
                ThomasWrapper.Stop();
            }
            else
            {
                ThomasWrapper.Play();
            }

            playPauseButton.DataContext = ThomasWrapper.IsPlaying();
        }
Esempio n. 3
0
    public override void Update()
    {
        foreach (var text in Textdatalist)
        {
            text.color = Color.FloralWhite;
        }
        if (Textdatalist[0].Hovered())
        {
            Textdatalist[0].color = Color.IndianRed;
            Textdatalist[2].color = Color.IndianRed;
        }
        if (Textdatalist[1].Hovered())
        {
            Textdatalist[1].color = Color.IndianRed;
        }

        if (Textdatalist[0].Clicked())//Play again
        {
        }
        if (Textdatalist[1].Clicked())//Main menu
        {
            if (ThomasWrapper.IsPlaying())
            {
                Input.SetMouseMode(Input.MouseMode.POSITION_ABSOLUTE);
                CameraMaster.instance.SetState(CAM_STATE.LOADING_SCREEN);
                ThomasWrapper.IssueRestart();
            }
            //foreach (Text Textdata in Textdatalist)
            //    Textdata.scale = Vector2.Zero;
        }

        Textdatalist[2].position = Textdatalist[0].position + new Vector2(Textdatalist[0].size.x / 2 + Textdatalist[2].size.x / 2, 0);
        if (TimerRoutine == null)
        {
            TimerRoutine = CountDown();
            StartCoroutine(CountDown());
        }
    }