NewStartMenu

This commit is contained in:
brausjonas
2023-03-31 23:37:03 +02:00
parent 231e8b28ca
commit 3112e020e7
17 changed files with 647 additions and 6608 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 561 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 MiB

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 44d4ee26d5fd6614db3860bbcee0fe3c
guid: 9e1003a1bcd966349b01a7047f7184ef
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -67,7 +67,7 @@ TextureImporter:
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxTextureSize: 4096
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
File diff suppressed because it is too large Load Diff
@@ -8,6 +8,7 @@ using TMPro;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class StartHandler : MonoBehaviour
{
@@ -22,12 +23,26 @@ public class StartHandler : MonoBehaviour
[SerializeField] private TMP_Text playerName;
[SerializeField] private GameObject copiedMessage;
[SerializeField] private TMP_Text backgroundNameText;
[SerializeField] private GameObject layoutSelectCharacter;
[SerializeField] private Sprite[] characterFaces;
[SerializeField] private Image imageShowSelectedCharacter;
private string roomcode;
private void Start()
{
if (PlayerPrefs.HasKey("characterID"))
{
int id = PlayerPrefs.GetInt("characterID");
imageShowSelectedCharacter.sprite = characterFaces[id];
}
else
{
PlayerPrefs.SetInt("characterID", 0);
imageShowSelectedCharacter.sprite = characterFaces[0];
}
copiedMessage.SetActive(false);
if (PlayerPrefs.HasKey("name"))
@@ -172,5 +187,20 @@ public class StartHandler : MonoBehaviour
stream.Write(new byte[] { 126, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
}
public void ButtonShowCharacterSelectMenu()
{
layout1.SetActive(false);
layoutSelectCharacter.SetActive(true);
}
public void ButtonSelectCharacter(int index)
{
PlayerPrefs.SetInt("characterID", index);
PlayerPrefs.Save();
imageShowSelectedCharacter.sprite = characterFaces[index];
layout1.SetActive(true);
layoutSelectCharacter.SetActive(false);
}
}