Exemplo n.º 1
0
        private void UpdateDataVisualUser()
        {
            m_Nickname.text       = userDetails.nickname;
            m_CountMoneyUser.text = userDetails.money.ToString();

            DataSave.SaveDataUser();
        }
Exemplo n.º 2
0
        private IEnumerator CreateNewBuilding_Coroutine(string typeBuilding, Transform building)
        {
            yield return(new WaitForSeconds(.1f));

            if (building == null)
            {
                yield break;
            }

            switch (typeBuilding.ToLower())
            {
            case "houses":
                building.GetComponent <Houses>().BuildNow = false;
                building.GetComponent <Houses>().ActiveTimeBuilding();
                RemoveMoneyUser(building.GetComponent <Houses>().valueBuildidng);
                FxNewBuilding();
                break;

            case "factory":
                building.GetComponent <Factory>().BuildNow = false;
                building.GetComponent <Factory>().ActiveTimeBuilding();
                RemoveMoneyUser(building.GetComponent <Factory>().valueBuildidng);
                FxNewBuilding();
                break;

            case "mall":
                building.GetComponent <Mall>().BuildNow = false;
                building.GetComponent <Mall>().ActiveTimeBuilding();
                RemoveMoneyUser(building.GetComponent <Mall>().valueBuildidng);
                FxNewBuilding();
                break;

            case "park":
                building.GetComponent <Park>().BuildNow = false;
                building.GetComponent <Park>().ActiveTimeBuilding();
                RemoveMoneyUser(building.GetComponent <Park>().valueBuildidng);
                FxNewBuilding();
                break;

            case "farm":
                building.GetComponent <Farm>().BuildNow = false;
                building.GetComponent <Farm>().ActiveTimeBuilding();
                RemoveMoneyUser(building.GetComponent <Farm>().valueBuildidng);
                FxNewBuilding();
                break;

            default:
                Debug.LogError("building not found");
                break;
            }

            DataSave.SaveAll();
        }
Exemplo n.º 3
0
 public void OnButtonExitClicked()
 {
     m_FxClick.Play();
     DataSave.SaveAll();
     Application.Quit();
 }
Exemplo n.º 4
0
        private void Start()
        {
            userDetails = new User();
            requestData = new Request();

            JsonUtility.FromJsonOverwrite(requestData.LoadDataUser(), userDetails);


            if (PlayerPrefs.GetInt("newNickname") != 1)
            {
                StartCoroutine(ValidationCreateBuilding_Coroutine());
                m_PanelNewNickname.SetActive(true);
            }
            else
            {
                StartCoroutine(ValidationCreateBuilding_Coroutine(checkedValidation: () => DataSave.LoadAll(userDetails)));
                m_PanelNewNickname.SetActive(false);
            }
        }