void Start() { for (int i = 0; i < Texts.Length - 1; i++) { Texts [i].text = Fa.faConvert("خرید سکه "); } }
void Awake() { if (!Instance) { Instance = this; } else { Destroy(gameObject); } meterFa = Fa.faConvert("متر"); StoreEvents.OnSoomlaStoreInitialized += OnSoomlaStoreInitialized; //register for event only if there is ui element to show text in it. if (moneyText) { StoreEvents.OnCurrencyBalanceChanged += OnCurrencyBalanceChanged; } if (traveledDistanceText) { scoreManager.TraveledDistanceChanged += OnTraveledDistanceChanged; } scoreManager.HighestTraveledDistanceChanged += OnHighestTraveledDistanceChanged; gameManager.GameSceneLoaded += OnGameSceneLoaded; gameManager.GameSceneUnloaded += OnGameSceneUnloaded; gameManager.MainSceneLoaded += OnMainSceneLoaded; gameManager.GamePaused += OnGamePaused; gameManager.GameResumed += OnGameResumed; inputManager.EscapeKeyDetected += OnEscapeKeyDetected; soundManager.SoundsStateChanged += OnSoundStateChanged; player.PlayerDied += OnPlayerDied; }
public void LoadUpgrade() { id = PlayerPrefs.GetInt("SelectedCar"); Engine = PlayerPrefs.GetInt("Coins" + id.ToString()); Fuel = PlayerPrefs.GetInt("Fuel" + id.ToString()); Suspension = PlayerPrefs.GetInt("Suspension" + id.ToString()); Speed = PlayerPrefs.GetInt("Speed" + id.ToString()); if (PlayerPrefs.GetString("language") == "English") { _item[0].levelInfo.text = "Level: " + PlayerPrefs.GetInt("Engine" + id.ToString()).ToString() + " / " + _item[0].price.Length.ToString(); _item[1].levelInfo.text = "Level: " + PlayerPrefs.GetInt("Suspension" + id.ToString()).ToString() + " / " + _item[1].price.Length.ToString(); _item[2].levelInfo.text = "Level: " + PlayerPrefs.GetInt("Speed" + id.ToString()).ToString() + " / " + _item[2].price.Length.ToString(); _item[3].levelInfo.text = "Level: " + PlayerPrefs.GetInt("Fuel" + id.ToString()).ToString() + " / " + _item[3].price.Length.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { _item[0].levelInfo.text = Fa.ToPersianNumber(PlayerPrefs.GetInt("Engine" + id.ToString()).ToString()) + " / " + Fa.ToPersianNumber(_item[0].price.Length.ToString()) + Fa.faConvert("سطح : "); _item[1].levelInfo.text = Fa.ToPersianNumber(PlayerPrefs.GetInt("Suspension" + id.ToString()).ToString()) + " / " + Fa.ToPersianNumber(_item[1].price.Length.ToString()) + Fa.faConvert("سطح : "); _item[2].levelInfo.text = Fa.ToPersianNumber(PlayerPrefs.GetInt("Speed" + id.ToString()).ToString()) + " / " + Fa.ToPersianNumber(_item[2].price.Length.ToString()) + Fa.faConvert("سطح : "); _item[3].levelInfo.text = Fa.ToPersianNumber(PlayerPrefs.GetInt("Fuel" + id.ToString()).ToString()) + " / " + Fa.ToPersianNumber(_item[3].price.Length.ToString()) + Fa.faConvert("سطح : "); } }
public void ShowMassage() { if (_required && input.text == "") { result.text = Fa.faConvert("پر کردن این فیلد اجباریست!"); } else if (!_validLength && inputType != Collection.InputType.reEnterPassword) { if (_minLength != _maxLength) { result.text = Fa.faConvert(" طول رشته باید حداقل " + _minLength.ToString() + " و حداکثر " + _maxLength.ToString() + " باشد. "); } else { result.text = Fa.faConvert(" طول رشته ورودی باید تنها شامل " + _maxLength + " کاراکتر باشد "); } } else if (!_validInput) { if (inputType == Collection.InputType.name) { result.text = Fa.faConvert("نام نمیتواند شامل عدد باشد"); } if (inputType == Collection.InputType.username) { if (char.IsDigit(input.text[0])) { result.text = Fa.faConvert("نام کاربری نمیتواند با عدد شروع شود"); } else { result.text = Fa.faConvert("نام کاربری تنها میتواند شامل حروف و اعداد باشد"); } } if (inputType == Collection.InputType.password) { result.text = Fa.faConvert("رمز عبور باید حداقل یک حرف و یک عدد را شامل شود"); } if (inputType == Collection.InputType.reEnterPassword) { result.text = Fa.faConvert("رمز عبور وارد شده مطابقت ندارد"); } if (inputType == Collection.InputType.email) { result.text = Fa.faConvert("ایمیل وارد شده صحیح نمیباشد"); } if (inputType == Collection.InputType.phoneNumber) { result.text = Fa.faConvert("شماره همراه وارد شده معتبر نمیباشد"); } if (inputType == Collection.InputType.age) { result.text = Fa.faConvert("عدد وارد شده صحیح نمیباشد"); } } else { result.text = "\u221A"; } }
void Translate() { var obj = Selection.activeGameObject; if (!obj) { return; } Text myText = obj.GetComponent <Text> (); if (!myText) { TextMesh myTextM = obj.GetComponent <TextMesh> (); if (!myTextM) { return; } myTextM.text = Fa.faConvert(myTextM.text); obj.transform.Translate(Vector3.up * 1); obj.transform.Translate(Vector3.up * -1); return; } myText.text = Fa.faConvert(myText.text); obj.transform.Translate(Vector3.up * 1); obj.transform.Translate(Vector3.up * -1); }
public void SetButton(string text, Sprite image = null) { gameObject.SetActive(true); toggle.isOn = false; coverImage.gameObject.SetActive(false); if (Fa.isFarsi(text[0])) { buttonText.text = text.faConvert(); } else { buttonText.text = text; } if (image != null) { if (buttonImage != null) { buttonImage.sprite = image; } else { Debug.LogError("Image component not found!!!"); } } }
void Update() { if (PhotonNetwork.NetworkClientState == ClientState.ConnectingToMasterServer || PhotonNetwork.NetworkClientState == ClientState.ConnectingToNameServer) { connectionText.text = Fa.faConvert(" در حال اتصال..."); connectionText.color = Color.black; connectionText.fontStyle = FontStyle.Bold; } }
public void EngineUpgrade() { if (PlayerPrefs.GetInt("Engine" + id.ToString()) >= _item[0].price.Length) { return; } SetChooseItem(0); if (PlayerPrefs.GetInt("Engine" + id.ToString()) < _item[0].price.Length) { if (PlayerPrefs.GetInt("Coins") >= _item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())]) { HomeManager._homeManager.ChangeCoin(_item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())]); PlayerPrefs.SetInt("Engine" + id.ToString(), PlayerPrefs.GetInt("Engine" + id.ToString()) + 1); if (PlayerPrefs.GetString("language") == "English") { _item[0].levelInfo.text = "Level: " + PlayerPrefs.GetInt("Engine" + id.ToString()).ToString() + " / " + _item[0].price.Length.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { _item[0].levelInfo.text = Fa.ToPersianNumber(PlayerPrefs.GetInt("Engine" + id.ToString()).ToString()) + " / " + Fa.ToPersianNumber(_item[0].price.Length.ToString()) + Fa.faConvert("سطح : "); } if (PlayerPrefs.GetInt("Engine" + id.ToString()) < _item[0].price.Length) { if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Upgrade cost : " + _item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())].ToString() + " coins"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert(" سکه ") + Fa.ToPersianNumber(_item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())].ToString()) + Fa.faConvert("هزينه بهبود کردن : "); } } else { if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Completed"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert("تکمیل شد"); } } return; } else { HomeManager._homeManager.OpenPurchase(); } } }
// Update is called once per frame void Update() { if (PlayerPrefs.GetString("language") == "English") { this.GetComponent <Text>().text = english[(int)setWord]; } else if (PlayerPrefs.GetString("language") == "Persion") { this.GetComponent <Text>().text = Fa.faConvert(persion[(int)setWord]); } }
public void convertInput2() { // if(convertAllowed2) // { input2.text = Fa.faConvert(input2.text.ToString()); // } // else // { // convertAllowed2=true; // } }
private bool IsPersianQuestion(string text) { for (int i = 0; i < text.Length; i++) { if (Fa.isFarsi(text[i])) { return(true); } } return(false); }
public void UpdateCoin() { int _coin = PlayerPrefs.GetInt("Coins"); if (PlayerPrefs.GetString("language") == "English") { coinText.text = _coin.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { coinText.text = Fa.ToPersianNumber(_coin.ToString()); } }
public void SelectedButtonChange(int index) { if (index != selectedAnswerIndex) { selectedAnswerIndex = index; string temp = QuestionList[CurrentQuestionIndex].options[index - 1]; if (temp != string.Empty && !Fa.isFarsi(temp[0])) { Setting.Speak(temp); } } }
public static string Fix(string str, bool useNBidi = false) { string fixedText = ""; if (useNBidi) { fixedText = NBidi.NBidi.LogicalToVisual(str); } else { fixedText = Fa.faConvert(str); } return(fixedText); }
public void ChangeCoin(int _value) { int _coin = PlayerPrefs.GetInt("Coins"); _coin -= _value; PlayerPrefs.SetInt("Coins", _coin); if (PlayerPrefs.GetString("language") == "English") { coinText.text = _coin.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { coinText.text = Fa.ToPersianNumber(_coin.ToString()); } }
private void Awake() { if (PlayerPrefs.HasKey("language")) { if (PlayerPrefs.GetString("language") == "Persion") { gameObject.GetComponent <Text>().alignment = TextAnchor.MiddleRight; gameObject.GetComponent <Text>().text = Fa.faConvert("شركت افگيمستان جهت ارتقای فرهنگ مدرن گيم سازي و ساخت انيميشن در سال ٨٩٣١ وارد") + "\n" + Fa.faConvert("ميدان گرديد، تيم متخصص و متعهد اين شركت با شعار سه واژه : ") + "\n" + Fa.faConvert(" توانمند سازی ، تغییر و کارآفرینی تلاش بر اين دارد تا گامي موثر و ارزنده جهت تغير و ") + "\n" + Fa.faConvert("جهاني شدن بردارد.") + "\n" + Fa.faConvert("اين شركت با گام هاي کوچک اش به دنبال تغيرات بزرگ است و آن رساندن صنعت گيم سازي") + "\n" + Fa.faConvert(" و انيميشن افغانستان در سطح جهاني است. ما شما را به يك پياله قهوه، يك دل گرم و تماشاي") + "\n" + Fa.faConvert(" انيميشن هايي شادي آفرين و گيم هايي هيجاني دعوت ميكنيم."); } else if (PlayerPrefs.GetString("language") == "English") { gameObject.GetComponent <Text>().alignment = TextAnchor.MiddleLeft; gameObject.GetComponent <Text>().text = "The Afgamestan company established in 2019 to promote the modern culture of game and animation making.\nThe company with a specialized and dedicated team and slogan of “We have brought you three words; Empowerment, Change and Entrepreneurship”, strives to take an effective step towards globalization.\nThe company is making big strides with its small steps to bring the Afghanistan game and animation industry to a global level.We invite you to a cup of coffee, a warm heart, and to watch cheerful animations and exciting games."; } } }
public void AddCoin(int coinsCount) { int _coins = PlayerPrefs.GetInt("Coins"); _coins += coinsCount; PlayerPrefs.SetInt("Coins", _coins); if (PlayerPrefs.GetString("language") == "English") { coinText.text = _coins.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { coinText.text = Fa.ToPersianNumber(_coins.ToString()); } }
public void OnLoginBtnClicked() { string playerName = loginField.text; if (!string.IsNullOrEmpty(playerName)) { PhotonNetwork.LocalPlayer.NickName = playerName; playerNameText.text = playerName.faConvert(); PhotonNetwork.ConnectUsingSettings(); } else { connectionText.text = Fa.faConvert("نام تان را وارد نمایید!"); connectionText.color = Color.red; connectionText.fontStyle = FontStyle.Bold; } }
public void SetQuestion() { if (question.Title != string.Empty) { if (Fa.isFarsi(question.Title[0])) { titleQuestionText.lineSpacing = -1; titleQuestionText.text = question.Title.faConvert(); } else { titleQuestionText.lineSpacing = 1; titleQuestionText.text = question.Title; } } selectedStringText.text = ""; foreach (var item in lines) { item.HideLine(); } wordGameSize = (int)question.wordGameSize; for (int i = 0; i < maxLines; i++) { if (i < wordGameSize) { lines[i].ShowEmptyLine(wordGameSize); } else { lines[i].HideLine(); } } for (int i = 0; i < question.words.Length; i++) { List <Vector2> currentWordPosition = GetWordPositions(i); for (int j = 0; j < currentWordPosition.Count; j++) { lines[(int)Mathf.Round(currentWordPosition[j].y)].ShowChar(question.words[i][j], (int)Mathf.Round(currentWordPosition[j].x), i); } } }
public void StartGame() { //Loading.SetActive (true); //PlayerPrefs.SetInt ("AllScoreTemp", PlayerPrefs.GetInt ("Coins")); UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("Level" + PlayerPrefs.GetInt("SelectedLevel").ToString()); //sceneLoading.ActivateNextScene(); if (PlayerPrefs.GetString("language") == "English") { loading.GetComponentInChildren <Text>().text = "Loading ..."; } else if (PlayerPrefs.GetString("language") == "Persion") { loading.GetComponentInChildren <Text>().text = Fa.faConvert("بارگیری ... "); } loading.SetActive(true); //gameObject.SetActive (false); }
void Update() { if (Started) { CoinDistance(); if (player.position.x >= DistanceTemp) { if (PlayerPrefs.GetString("language") == "English") { DistanceTXT.text = Mathf.Floor(player.position.x).ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { DistanceTXT.text = Fa.ToPersianNumber(Mathf.Floor(player.position.x).ToString()); } DistanceTemp = player.position.x; DitanceSlider.value = player.position.x; } } }
//----------------------------------------------- //Add Coin----------------------------------------------- public void AddCoin(int value) { //add Coin called from coins trigger StartCoroutine(TakeCoins()); CoinTXT.transform.localScale = new Vector3(CoinTXT.transform.localScale.x, CoinTXT.transform.localScale.y + 0.7f, CoinTXT.transform.localScale.z); if (coinSound) { coinSound.Play(); } Coins += value; if (PlayerPrefs.GetString("language") == "English") { CoinTXT.text = Coins.ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { CoinTXT.text = Fa.ToPersianNumber(Coins.ToString()); } PlayerPrefs.SetInt("Coins", Coins); }
void Copy() { GUIUtility.systemCopyBuffer = Fa.faConvert(myStr); }
//Start----------------------------------------------- IEnumerator Start() { Time.timeScale = 1f; Application.targetFrameRate = 60; if (PlayerPrefs.GetString("language") == "English") { DistanceTXT.text = "0"; } else if (PlayerPrefs.GetString("language") == "Persion") { DistanceTXT.text = Fa.ToPersianNumber("0"); } DitanceSlider.gameObject.SetActive(true); DitanceSlider.maxValue = targetDistance; if (PlayerPrefs.GetString("language") == "English") { //Coins Initialization----------------------------------------------- Coins = PlayerPrefs.GetInt("Coins"); //read total scrore from saved Coins CoinTXT.text = Coins.ToString(); // Display total coins on Start //----------------------------------------------- } else if (PlayerPrefs.GetString("language") == "Persion") { //Coins Initialization----------------------------------------------- Coins = PlayerPrefs.GetInt("Coins"); //read total scrore from saved Coins CoinTXT.text = Fa.ToPersianNumber(Coins.ToString()); // Display total coins on Start //----------------------------------------------- } //Start Main Game ----------------------------------------------- yield return(new WaitForEndOfFrame()); //Player is Spawned afer milisecond. we wait .3 and then find it player = GameObject.FindGameObjectWithTag("Player").transform; Started = true; // The game is now started. you can run your codes on update function Finished = false; //----------------------------------------------- ////----------------------------------------------- /// // Read if distance based award is already gived for current level, Set it to gived if (PlayerPrefs.GetInt("c500" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c500 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("500") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c1000" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c1000 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:1000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("1000") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c1500" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c1500 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:1500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("1500") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c2000" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c2000 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:2000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("2000") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c2500" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c2500 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:2500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("2500") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c3000" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c3000 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:3000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("3000") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c3500" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c3500 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:3500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("3500") + Fa.faConvert("رکورد :"); } } if (PlayerPrefs.GetInt("c4000" + PlayerPrefs.GetInt("SelectedLevel").ToString()) == 3) { c4000 = true; if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:4000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("4000") + Fa.faConvert("رکورد :"); } } //Fuel Decreso r//----------------------------------------------- while (!Finished) //responsible to decrese fuel amount by time and value read from upgrade menu { yield return(new WaitForSeconds(FuelTime)); TotalFuel -= FuelVal; FuelSlider.value = TotalFuel; if (TotalFuel >= 0) { if (PlayerPrefs.GetString("language") == "English") { FuelTXT.text = Mathf.Floor(TotalFuel).ToString(); } else if (PlayerPrefs.GetString("language") == "Persion") { FuelTXT.text = Fa.ToPersianNumber(Mathf.Floor(TotalFuel).ToString()); } } if (TotalFuel < 0) { //youLostMenu.SetActive (true); //Time.timeScale = 0; fuelFinished = true; StartFuelFinish(); } } }
void OnGUI() { myStr = GUILayout.TextArea(myStr); GUILayout.TextArea(Fa.faConvert(myStr)); if (GUILayout.Button("Copy")) { Copy(); } if (GUILayout.Button("Translate")) { Translate(); } if (GUILayout.Button("Time Speed .1 - 1")) { TimeToggle(); } if (GUILayout.Button("Time Speed 3 - 1")) { TimeToggle3(); } if (GUILayout.Button("Copy wolrd pose")) { CopyWorldPose(); } if (GUILayout.Button("Paste world pose")) { PasteWorldPose(); } if (GUILayout.Button("Clone 20 Up")) { Clone(0, 20); } if (GUILayout.Button("Clone 20 Down")) { Clone(0, -20); } if (GUILayout.Button("Clone 20 Left")) { Clone(-20, 0); } if (GUILayout.Button("Clone 20 Right")) { Clone(20, 0); } GUILayout.Label("Select various Objects in the Hierarchy view"); selected = Selection.activeTransform ? Selection.activeTransform.name : ""; foreach (Transform t in Selection.transforms) { if (t.GetInstanceID() != Selection.activeTransform.GetInstanceID()) { alignTo += t.name + " "; } } EditorGUILayout.LabelField("Align: ", alignTo); alignTo = ""; EditorGUILayout.LabelField("With: ", selected); GUILayout.BeginHorizontal(); alignToX = EditorGUILayout.Toggle("X", alignToX); alignToY = EditorGUILayout.Toggle("Y", alignToY); alignToZ = EditorGUILayout.Toggle("Z", alignToZ); GUILayout.EndHorizontal(); if (GUILayout.Button("Align")) { Align(); } }
void Awake() { meterFa = Fa.faConvert("متر"); }
public void SetPackageButtonInfo(string name, string score, string imageUrl) { nameLbl.text = Fa.faConvert(name) + Fa.faConvert("نام: "); scoreLbl.text = Fa.faConvert(score) + Fa.faConvert("امتیاز: "); StartCoroutine(DownloadImage(imageUrl)); }
// Distance based award void CoinDistance() { if (!c500) { if (player.transform.position.x >= 500 && player.transform.position.x < 1000) { AddCoin(50); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "50 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert(" سکه جایزه داده شد ") + Fa.ToPersianNumber("50"); } StartCoroutine(Awardfalse()); c500 = true; PlayerPrefs.SetInt("c500" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("500") + Fa.faConvert("رکورد :"); } } } if (!c1000 && c500) { if (player.transform.position.x >= 1000 && player.transform.position.x < 1500) { AddCoin(100); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "100 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert(" سکه جایزه داده شد") + Fa.ToPersianNumber("100"); } StartCoroutine(Awardfalse()); c1000 = true; PlayerPrefs.SetInt("c1000" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:1000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("1000") + Fa.faConvert("رکورد :"); } } } if (!c1500 && c1000) { if (player.transform.position.x >= 1500 && player.transform.position.x < 2000) { AddCoin(150); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "150 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert(" سکه جایزه داده شد ") + Fa.ToPersianNumber("150"); } StartCoroutine(Awardfalse()); c1500 = true; PlayerPrefs.SetInt("c1500" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:1500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("1500") + Fa.faConvert("رکورد :"); } } } if (!c2000 && c1500) { if (player.transform.position.x >= 2000 && player.transform.position.x < 2500) { AddCoin(200); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "200 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert("سکه جایزه داده شد ") + Fa.ToPersianNumber("200"); } StartCoroutine(Awardfalse()); c2000 = true; PlayerPrefs.SetInt("c2000" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:2000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("2000") + Fa.faConvert("رکورد :"); } } } if (!c2500 && c2000) { if (player.transform.position.x >= 2500 && player.transform.position.x < 3000) { AddCoin(250); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "250 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert("سکه جایزه داده شد ") + Fa.ToPersianNumber("250"); } StartCoroutine(Awardfalse()); c2500 = true; PlayerPrefs.SetInt("c2500" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:2500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("2500") + Fa.faConvert("رکورد :"); } } } if (!c3000 && c2500) { if (player.transform.position.x >= 3000 && player.transform.position.x < 3500) { AddCoin(300); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "300 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert("سکه جایزه داده شد ") + Fa.ToPersianNumber("300"); } StartCoroutine(Awardfalse()); c3000 = true; PlayerPrefs.SetInt("c3000" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:3000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("3000") + Fa.faConvert("رکورد :"); } } } if (!c3500 && c3000) { if (player.transform.position.x >= 3500 && player.transform.position.x < 4000) { AddCoin(350); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "350 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert("سکه جایزه داده شد ") + Fa.ToPersianNumber("350"); } StartCoroutine(Awardfalse()); c3500 = true; PlayerPrefs.SetInt("c3500" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:3500"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("3500") + Fa.faConvert("رکورد :"); } } } if (!c4000 && c3500) { if (player.transform.position.x >= 4000 && player.transform.position.x < 4500) { AddCoin(400); coinAwardedBox.SetActive(true); awardAnimator.SetBool("Award", true); if (PlayerPrefs.GetString("language") == "English") { awardedText.text = "400 Coins Awarded"; } else if (PlayerPrefs.GetString("language") == "Persion") { awardedText.text = Fa.faConvert("سکه جایزه داده شد ") + Fa.ToPersianNumber("400"); } StartCoroutine(Awardfalse()); c4000 = true; PlayerPrefs.SetInt("c4000" + PlayerPrefs.GetInt("SelectedLevel").ToString(), 3); // 3 => true | 0 => false if (PlayerPrefs.GetString("language") == "English") { LastRecord.text = "Record:4000"; } else if (PlayerPrefs.GetString("language") == "Persion") { LastRecord.text = Fa.ToPersianNumber("4000") + Fa.faConvert("رکورد :"); } //youWinMenu.SetActive (true); //AddCoin (winnerAwardedCoins); //GameObject.FindGameObjectWithTag ("Player").GetComponent<Rigidbody2D> ().isKinematic = true; } } //Debug.Log ("Distance " + player.transform.position.x); if (player.transform.position.x >= targetDistance && !Finished) { Finished = true; //AdsControl.Instance.showAds (); // deprecated one: //PlayerPrefs.SetInt ("BestDistance" + (Application.loadedLevel - 1).ToString (), Mathf.CeilToInt (player.position.x)); //new one: PlayerPrefs.SetInt("BestDistance" + (SceneManager.GetActiveScene().buildIndex - 1).ToString(), Mathf.CeilToInt(player.position.x)); youWinMenu.SetActive(true); Time.timeScale = 0; AddCoin(winnerAwardedCoins); GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D> ().isKinematic = true; } }
public void OnChane() { resultTest.text = Fa.faConvert(input.text); }
public void SetChooseItem(int _index) { contentText.text = _item[_index]._content; _type = _index; if (_index == 0) { if (PlayerPrefs.GetInt("Engine" + id.ToString()) == _item[0].price.Length) { return; } MainIcon.sprite = icon1.sprite; _item[0]._border.sprite = _select; _item[1]._border.sprite = _unSelect; _item[2]._border.sprite = _unSelect; _item[3]._border.sprite = _unSelect; if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Upgrade cost : " + _item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())].ToString() + " coins"; headText.text = "Upgrade Engine"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert(" سکه ") + Fa.ToPersianNumber(_item[0].price[PlayerPrefs.GetInt("Engine" + id.ToString())].ToString()) + Fa.faConvert("هزينه بهبود کردن : "); headText.text = Fa.faConvert("بهبود کردن موتور"); } } else if (_index == 1) { MainIcon.sprite = icon2.sprite; _item[0]._border.sprite = _unSelect; _item[1]._border.sprite = _select; _item[2]._border.sprite = _unSelect; _item[3]._border.sprite = _unSelect; if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Upgrade cost : " + _item[1].price[PlayerPrefs.GetInt("Suspension" + id.ToString())].ToString() + " coins"; headText.text = "Upgrade Suspension"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert(" سکه ") + Fa.ToPersianNumber(_item[1].price[PlayerPrefs.GetInt("Suspension" + id.ToString())].ToString()) + Fa.faConvert("هزينه بهبود کردن : "); headText.text = Fa.faConvert("بهبود کردن چرخ آويزى"); } } else if (_index == 2) { MainIcon.sprite = icon3.sprite; _item[0]._border.sprite = _unSelect; _item[1]._border.sprite = _unSelect; _item[2]._border.sprite = _select; _item[3]._border.sprite = _unSelect; if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Upgrade cost : " + _item[2].price[PlayerPrefs.GetInt("Speed" + id.ToString())].ToString() + " coins"; headText.text = "Upgrade Tired"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert(" سکه ") + Fa.ToPersianNumber(_item[2].price[PlayerPrefs.GetInt("Speed" + id.ToString())].ToString()) + Fa.faConvert("هزينه بهبود کردن : "); headText.text = Fa.faConvert("بهبود کردن تایر"); } } else if (_index == 3) { MainIcon.sprite = icon4.sprite; _item[0]._border.sprite = _unSelect; _item[1]._border.sprite = _unSelect; _item[2]._border.sprite = _unSelect; _item[3]._border.sprite = _select; if (PlayerPrefs.GetString("language") == "English") { priceText.text = "Upgrade cost : " + _item[3].price[PlayerPrefs.GetInt("Fuel" + id.ToString())].ToString() + " coins"; headText.text = "Upgrade Fuel"; } else if (PlayerPrefs.GetString("language") == "Persion") { priceText.text = Fa.faConvert(" سکه ") + Fa.ToPersianNumber(_item[3].price[PlayerPrefs.GetInt("Fuel" + id.ToString())].ToString()) + Fa.faConvert("هزينه بهبود کردن : "); headText.text = Fa.faConvert("بهبود کردن سوخت"); } } }