コード例 #1
0
    //This method hides the main panel and reveals and makes ready the panel for
    //each user by assigning values to all of the labels and buttons
    public void UserButtonClicked(int id)
    {
        MainPanel.SetActive(false);
        UserPanel.SetActive(true);
        Debug.Log("Button clicked = " + id);
        if (id == 0)
        {
            UserTitleText.text = "All Players";
        }
        else
        {
            UserTitleText.text = id.ToString();
        }

        VideoTransmitter video_transmitter = new VideoTransmitter();

        Button temp_launch_button = LaunchButton.GetComponent <Button>();

        temp_launch_button.onClick.AddListener(() => LaunchButtonClicked(id));
        Button temp_play_button = PlayButton.GetComponent <Button>();

        temp_play_button.onClick.AddListener(() => video_transmitter.Play(id));
        Button temp_pause_button = PauseButton.GetComponent <Button>();

        temp_pause_button.onClick.AddListener(() => video_transmitter.Pause(id));
    }
コード例 #2
0
ファイル: CellGrid.cs プロジェクト: daramkun/GameOfLife
    public void Play()
    {
        Playing = true;
        PlayButton.GetComponent <Button> ().enabled  = false;
        PauseButton.GetComponent <Button> ().enabled = true;

        StartCoroutine(CurrentCoroutine = UpdateRoutine());
    }
コード例 #3
0
ファイル: CellGrid.cs プロジェクト: daramkun/GameOfLife
 public void Stop()
 {
     if (CurrentCoroutine != null)
     {
         StopCoroutine(CurrentCoroutine);
     }
     Playing = false;
     PlayButton.GetComponent <Button> ().enabled  = true;
     PauseButton.GetComponent <Button> ().enabled = false;
 }
コード例 #4
0
 public void MainMenu()
 {
     SpeedUp = true;
     GameSpeed();
     PausePanel.SetActive(false);
     Canvas.SetActive(false);
     PauseButton.GetComponent <Image>().sprite = Pause1;
     Paused = false;
     GameOverPanel.SetActive(false);
     UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu");
 }
コード例 #5
0
 public void PauseGame()
 {
     if (!Paused)
     {
         Time.timeScale = 0;
         PauseButton.GetComponent <Image>().sprite = Pause2;
         PausePanel.SetActive(true);
         Paused = true;
     }
     else if (Paused)
     {
         SpeedUp = true;
         GameSpeed();
         PauseButton.GetComponent <Image>().sprite = Pause1;
         PausePanel.SetActive(false);
         Paused = false;
     }
 }