Upgrade + Info Button on selection
This commit is contained in:
@@ -8,11 +8,14 @@ public class LoginManager : MonoBehaviour
|
||||
{
|
||||
public TMP_InputField login_username;
|
||||
public TMP_InputField login_password;
|
||||
public Toggle rememberMe;
|
||||
public Button loginBtn;
|
||||
public TMP_InputField reg_username;
|
||||
public TMP_InputField reg_password;
|
||||
public Button regBtn;
|
||||
|
||||
public OtherUIbuttons otherUI;
|
||||
|
||||
void Start()
|
||||
{
|
||||
loginBtn.onClick.AddListener(OnLoginClicked);
|
||||
@@ -35,11 +38,17 @@ public class LoginManager : MonoBehaviour
|
||||
|
||||
public void OnLoginClicked(){
|
||||
if(login_username.text.Length < 2){
|
||||
MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a valid Username (should be more than 2 characters)");
|
||||
if(otherUI!=null){
|
||||
otherUI.ErrorAuth();
|
||||
}
|
||||
// MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a valid Username (should be more than 2 characters)");
|
||||
return;
|
||||
}
|
||||
if(login_password.text.Length < 5){
|
||||
MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a Strong password (should be more than 5 characters)");
|
||||
if(otherUI!=null){
|
||||
otherUI.ErrorAuth();
|
||||
}
|
||||
// MessageDialogInstance.messageDialog.ShowDialog("Error", "Please use a Strong password (should be more than 5 characters)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,9 +80,10 @@ public class LoginManager : MonoBehaviour
|
||||
Debug.Log(www.text);
|
||||
if (www.text[0] == '0')
|
||||
{
|
||||
if(rememberMe.isOn){
|
||||
PlayerPrefs.SetString("username", login_username.text);
|
||||
PlayerPrefs.SetString("password", login_password.text);
|
||||
PlayerPrefs.Save();
|
||||
PlayerPrefs.Save();}
|
||||
DBmanager.username = login_username.text;
|
||||
DBmanager.SetGems(int.Parse(www.text.Split('\t')[2]),true);
|
||||
DBmanager.SetCoins(int.Parse(www.text.Split('\t')[1]),true);
|
||||
|
||||
@@ -16,7 +16,7 @@ LightingSettings:
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 0
|
||||
m_BakeBackend: 2
|
||||
m_BakeBackend: 1
|
||||
m_LightmapMaxSize: 128
|
||||
m_BakeResolution: 20
|
||||
m_Padding: 2
|
||||
|
||||
@@ -6,10 +6,17 @@ using TMPro;
|
||||
public class OtherUIbuttons : MonoBehaviour
|
||||
{
|
||||
public GameObject Re;
|
||||
public GameObject AuthError;
|
||||
|
||||
|
||||
public void forgotPass()
|
||||
{
|
||||
Re.SetActive(true);
|
||||
AuthError.SetActive(false);
|
||||
}
|
||||
|
||||
public void ErrorAuth(){
|
||||
AuthError.SetActive(true);
|
||||
Re.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,27 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
{
|
||||
public Text nameTxt;
|
||||
public Button upgradeBtn;
|
||||
public Button infoBtn;
|
||||
|
||||
public UpgradeMenuItem[] menus;
|
||||
void Start()
|
||||
{
|
||||
upgradeBtn.onClick.AddListener(OnUpgradeClicked);
|
||||
infoBtn.onClick.AddListener(OnInfoClicked);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void OnUpgradeClicked(){
|
||||
//int relatedMenuIndex = -1;
|
||||
Debug.Log("Opening Upgrade Menu for : " + Selector.selectedBuilding.buildingData.name);
|
||||
for(int i = 0; i < menus.Length; i++){
|
||||
menus[i].menuObject.SetActive(menus[i].relatedBuildings.Contains(Selector.selectedBuilding.buildingData));
|
||||
menus[i].upgradeMenu.SetActive(menus[i].relatedBuildings.Contains(Selector.selectedBuilding.buildingData));
|
||||
}
|
||||
}
|
||||
|
||||
void OnInfoClicked(){
|
||||
Debug.Log("Opening Info Menu for : " + Selector.selectedBuilding.buildingData.name);
|
||||
for(int i = 0; i < menus.Length; i++){
|
||||
menus[i].infoMenu.SetActive(menus[i].relatedBuildings.Contains(Selector.selectedBuilding.buildingData));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +36,7 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
|
||||
[System.Serializable]
|
||||
public class UpgradeMenuItem{
|
||||
public GameObject menuObject;
|
||||
public GameObject upgradeMenu;
|
||||
public GameObject infoMenu;
|
||||
public List<BuildingData> relatedBuildings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user