Beispiel #1
0
 public static PlayerMenu Instance()
 {
     if (instance == null)
     {
         instance = new PlayerMenu("");
     }
     return(instance);
 }
Beispiel #2
0
 public override void callOnKeyPressed(object sender, KeyEventArgs e, SceneManager sceneManager)
 {
     base.callOnKeyPressed(sender, e, sceneManager);
     if (e.Code == Keyboard.Key.Escape)
     {
         sceneManager.changeScene(PlayerMenu.Instance());
     }
 }
Beispiel #3
0
 public static PlayerMenu Instance(string _playerName)
 {
     if (instance == null)
     {
         instance = new PlayerMenu(_playerName);
     }
     PlayerManager.Instance.PlayerName = _playerName;
     return(instance);
 }
Beispiel #4
0
 private void OnBtnLoadMouseReleased(object sender, BtnReleasedEventArgs e)
 {
     try
     {
         PlayerMenu.Instance().cleanUp();  //napisac koniecznie wczytywanie teksturki jak sie wczytuje stan gry z pliku
         using (Stream stream = File.Open("ship.txt", FileMode.Open))
         {
             BinaryFormatter bf = new BinaryFormatter();
             PlayerManager.Instance = (PlayerManager)bf.Deserialize(stream);
             int index = PlayerManager.Instance.currentShip;
             PlayerManager.Instance.ShipInfo.ShipTexture = new Texture(ResourcesManager.resourcesPath + PlayerManager.Instance.ShipPrefabs[index].TexturePath);
             PlayerHud.Instance().PlayerInfo = PlayerManager.Instance;
         }
         sceneManager.changeScene(PlayerMenu.Instance());
     }
     catch (System.IO.FileNotFoundException)
     {
         MessageBox.Show("Brak pliku zapisu");
     }
 }
Beispiel #5
0
 private void OnBtnResumeMouseReleased(object sender, BtnReleasedEventArgs e)
 {
     sceneManager.changeScene(PlayerMenu.Instance());
 }
Beispiel #6
0
 private void OnBtnSaveMouseReleased(object sender, BtnReleasedEventArgs e)
 {
     SaveDataToFile();
     sceneManager.changeScene(PlayerMenu.Instance());
 }
Beispiel #7
0
 private void OnBtnLoadMouseReleased(object sender, BtnReleasedEventArgs e)
 {
     LoadDataFromFile();
     sceneManager.changeScene(PlayerMenu.Instance());
 }
Beispiel #8
0
 public override void drawComponents(SceneManager sceneManager)
 {
     PlayerMenu.Instance().drawComponents(sceneManager);
     base.drawComponents(sceneManager);
 }
Beispiel #9
0
 private void onTxbUserNameTextConfirmed(object sender, TextboxEventArgs e)
 {
     PlayerMenu.Instance().cleanUp();
     sceneManager.changeScene(PlayerMenu.Instance(e.Text));
 }