Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         NvpEventController.InvokeEvent(NvpGameEvents.OnPauseObjectCheck, this, null);
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (ball.transform.position.x >= 20f && canAddScore)
        {
            canAddScore = false;
            Spieler1Punkte++;
        }
        if (ball.transform.position.x <= -20f && canAddScore)
        {
            canAddScore = false;
            Spieler2Punkte++;
        }

        if (Spieler1Punkte >= 1)
        {
            //SceneManager.LoadScene(2);
            NvpEventController.InvokeEvent(NvpGameEvents.OnPlayerOneWins, this, null);
        }
        if (Spieler2Punkte >= 1)
        {
            //SceneManager.LoadScene(3);
            NvpEventController.InvokeEvent(NvpGameEvents.OnPlayerTwoWins, this, null);
        }



        Scoreboard.text = Spieler1Punkte.ToString() + " : " + Spieler2Punkte.ToString();
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        if (ball.transform.position.x >= 17f)
        {
            Bat_1_Score++;
        }

        if (ball.transform.position.x <= -17f)
        {
            Bat_2_Score++;
        }

        if (Bat_1_Score >= 2)
        {
            //SceneManager.LoadScene (2);
            NvpEventController.InvokeEvent(NvpGameEvents.OnPlayer1Wins, this, null);
        }

        if (Bat_2_Score >= 2)
        {
            //SceneManager.LoadScene(3);
            NvpEventController.InvokeEvent(NvpGameEvents.OnPlayer2Wins, this, null);
        }

        Scoreboard.text = Bat_1_Score.ToString() + " - " + Bat_2_Score.ToString();

        print(Bat_1_Score + " , " + Bat_2_Score);
    }
Пример #4
0
 public void Pause()
 {
     PauseMenuUI.SetActive(true);
     Time.timeScale = 0f;
     GameIsPaused   = true;
     NvpEventController.InvokeEvent("GamePaused", this, null);
 }
Пример #5
0
 public void Resume()
 {
     PauseMenuUI.SetActive(false);
     Time.timeScale = 1f;
     GameIsPaused   = false;
     NvpEventController.InvokeEvent("GameResumed", this, null);
 }
Пример #6
0
    // Start is called before the first frame update
    async void Start()
    {
        await Task.Delay(TimeSpan.FromSeconds(1));

        NvpEventController.InvokeEvent(NvpGameEvents.OnMainStarted, this, 42);
    }
Пример #7
0
 public void Exit_Option()
 {
     NvpEventController.InvokeEvent(NvpGameEvents.OnExitOption, this, null);
 }
Пример #8
0
 public void Option_Game()
 {
     //SceneManager.LoadScene(4);
     NvpEventController.InvokeEvent(NvpGameEvents.OnOptionGame, this, null);
 }
Пример #9
0
 public void Exit_Game()
 {
     //SceneManager.LoadScene(0);
     NvpEventController.InvokeEvent(NvpGameEvents.OnExitGame, this, null);
 }
Пример #10
0
 public void Reset_Game()
 {
     //SceneManager.LoadScene(1);
     NvpEventController.InvokeEvent(NvpGameEvents.OnResetGame, this, null);
 }
Пример #11
0
 public void Play_Game()
 {
     //SceneManager.LoadScene (1);
     NvpEventController.InvokeEvent(NvpGameEvents.OnGameStarted, this, null);
 }
Пример #12
0
 public void Nochmal_Spielen()
 {
     NvpEventController.InvokeEvent(NvpGameEvents.OnPlayAgain, this, null);
 }