@ -8,7 +8,7 @@ public class LoginUIManager : MonoBehaviour
{
{
public int conn ;
public int conn ;
public int maxPlayers = 2 ;
public int maxPlayers = 2 ;
ConnectedClients clients ;
public ConnectedClients clients ;
[Header("References")]
[Header("References")]
[SerializeField]
[SerializeField]
private ClientLoginManager clientManager ;
private ClientLoginManager clientManager ;
@ -54,6 +54,15 @@ public class LoginUIManager : MonoBehaviour
private void Update ( )
private void Update ( )
{
{
conn = GetComponent < animalSelection > ( ) . count ;
conn = GetComponent < animalSelection > ( ) . count ;
clients = GetComponent < animalSelection > ( ) . Clients ;
foreach ( ClientData cli in clients . AllClients )
{
if ( playerAnimal = = cli . characterAnimal )
{
playerAnimal = null ;
animalSelected = false ;
}
}
}
}
private void OnEnable ( )
private void OnEnable ( )
{
{
@ -78,7 +87,6 @@ public class LoginUIManager : MonoBehaviour
OnLoginFail ( ) ;
OnLoginFail ( ) ;
}
}
#endregion Unity Functions
#endregion Unity Functions
@ -151,6 +159,7 @@ public class LoginUIManager : MonoBehaviour
{
{
if ( colorSelected = = true & & animalSelected = = true & & playerName ! = "" )
if ( colorSelected = = true & & animalSelected = = true & & playerName ! = "" )
{
{
clientManager . SendPlayerDetails ( playerName , playerColor , playerAnimal ) ;
clientManager . SendPlayerDetails ( playerName , playerColor , playerAnimal ) ;
PlayerPrefs . SetString ( "LastUsedName" , playerName ) ;
PlayerPrefs . SetString ( "LastUsedName" , playerName ) ;
}
}