Skip to content

Commit

Permalink
Fix if controllo nomi nel database
Browse files Browse the repository at this point in the history
  • Loading branch information
zSavT committed Jun 1, 2022
1 parent 31dfcf5 commit aa2337d
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 82 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions progettoUnity/Healthy Catering/Assets/Mappe/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -169272,6 +169272,7 @@ GameObject:
- component: {fileID: 1171174881}
- component: {fileID: 1171174880}
- component: {fileID: 1171174879}
- component: {fileID: 1171174882}
m_Layer: 5
m_Name: ButtonSi
m_TagString: Interagibile
Expand Down Expand Up @@ -169406,6 +169407,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1171174877}
m_CullTransparentMesh: 1
--- !u!114 &1171174882
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1171174877}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ab26e796361914d818a7f42a5c9c85, type: 3}
m_Name:
m_EditorClassIdentifier:
cursoreNormale: {fileID: 2800000, guid: 40f65d19297dd0148a0ff7d86543271c, type: 3}
cursoreSuElemento: {fileID: 2800000, guid: 5852cf799bb9aa448bd2d643ceb7e776, type: 3}
--- !u!1001 &1172055936
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -284093,6 +284108,7 @@ GameObject:
- component: {fileID: 2011445845}
- component: {fileID: 2011445844}
- component: {fileID: 2011445843}
- component: {fileID: 2011445846}
m_Layer: 5
m_Name: ButtonNo
m_TagString: Interagibile
Expand Down Expand Up @@ -284215,6 +284231,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2011445841}
m_CullTransparentMesh: 1
--- !u!114 &2011445846
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2011445841}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ab26e796361914d818a7f42a5c9c85, type: 3}
m_Name:
m_EditorClassIdentifier:
cursoreNormale: {fileID: 2800000, guid: 40f65d19297dd0148a0ff7d86543271c, type: 3}
cursoreSuElemento: {fileID: 2800000, guid: 5852cf799bb9aa448bd2d643ceb7e776, type: 3}
--- !u!4 &2011453231 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 405220, guid: 9384e4f7925dd0d47a003b910f826bf8, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ public class ControlloMouse : MonoBehaviour
void Start()
{
posizioneZcamera = posizioneCameraIniziale.transform.position.z;
if (PlayerPrefs.GetInt("primoAvvio") == 0)
if (PlayerSettings.caricaPrimoAvvioSettaggiSensibilita() == 0)
{
PlayerSettings.salvaPrimoAvvioSettaggiSensibilita();
PlayerPrefs.SetInt("primoAvvio", 1);
PlayerPrefs.SetFloat("sensibilita", 250f);
PlayerSettings.salvaImpostazioniSensibilita(250f);
}
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,41 @@ public class PlayerSettings : MonoBehaviour
public static bool profiloUtenteCreato = true;
public static int livelloSelezionato = 0;

public static void salvaPrimoAvvioGame()
{
PlayerPrefs.SetInt("avvioCitta", 1);
}



public static void resetTuttiValori()
{
PlayerPrefs.DeleteAll();
}

public static int caricaPrimoAvvio()
{
return PlayerPrefs.GetInt("primoAvvio");
}

public static void salvaPrimaAvvio()
{
PlayerPrefs.SetInt("primoAvvio", 1);
}

public static int caricaPrimoAvvioSettaggiSensibilita()
{
return PlayerPrefs.GetInt(caricaNomePlayerGiocante() + "_primoAvvioSensibilita");
}

public static void salvaPrimoAvvioSettaggiSensibilita()
{
PlayerPrefs.SetInt(caricaNomePlayerGiocante() + "_primoAvvioSensibilita", 1);
}
//PROFILO UTENTE



//GENERE MODELLO
public static void salvaGenereModello3D(string nomeGiocatore, int scelta)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class SceltaImpostazioniPlayer : MonoBehaviour
// Start is called before the first frame update
void Start()
{
PlayerPrefs.SetInt("primoAvvio", 0);
PuntatoreMouse.abilitaCursore();
nomeGiocatoreScritto = "";
cameraGioco.GetComponent<Colorblind>().Type = PlayerSettings.caricaImpostazioniDaltonismo();
Expand Down Expand Up @@ -69,20 +70,26 @@ private void controlloNomeEsistente()
{
if (nomeGiocatoreScritto != "")
{
foreach (string temp in nomiPlayerPresenti)
bottoneSalva.interactable = true;
if (PlayerSettings.caricaPrimoAvvio() == 1)
{
if(temp.ToUpper() == nomeGiocatoreScritto.ToUpper())
foreach (string temp in nomiPlayerPresenti)
{
nomeGiaPreso.SetActive(true);
bottoneSalva.interactable = false;
break;
} else
{
nomeGiaPreso.SetActive(false);
bottoneSalva.interactable = true;
if (temp.ToUpper() == nomeGiocatoreScritto.ToUpper())
{
nomeGiaPreso.SetActive(true);
bottoneSalva.interactable = false;
break;
}
else
{
nomeGiaPreso.SetActive(false);
bottoneSalva.interactable = true;
}
}
}
}else
}
else
{
bottoneSalva.interactable = false;
}
Expand Down Expand Up @@ -144,6 +151,7 @@ public void menuPrincipale()

public void salvaImpostazioni()
{
PlayerSettings.salvaPrimaAvvio();
PlayerSettings.salvaNomePlayerGiocante(nomeGiocatoreScritto);
PlayerSettings.salvaGenereGiocatore(nomeGiocatoreScritto, sceltaGenere);
PlayerSettings.salvaColorePelle(nomeGiocatoreScritto, sceltaColorePelle);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[

]

0 comments on commit aa2337d

Please sign in to comment.