public void Open(GameObject item) { TextMeshProUGUI[] texts = item.GetComponentsInChildren <TextMeshProUGUI>(); TextLanguage[] textsTL = item.GetComponentsInChildren <TextLanguage>(); titleTL.textGreek = textsTL[0].textGreek; titleTL.textEnglish = textsTL[0].textEnglish; titleTL.SetLanguage(); //title = texts[0].text; //titleText.text = texts[0].text; price = texts[1].text; amountText.text = "1"; amount = 1; background.SetActive(true); window.SetActive(true); }
public void SetItemsEnd() { for (int i = 0; i < transportItems.Length; i++) { string sTransport = transportItems[i].transform.GetChild(1 + i % 2).GetComponentInChildren <TextMeshProUGUI>().text; //to do change language on dropdown nowDay.transportGreek[i] = sTransport; nowDay.transportEnglish[i] = sTransport; } int itemIndex = 0; for (int i = 0; i < 7; i++) { GameObject target = endItems[itemIndex].gameObject; if (nowDay.activitiesOn[i]) { string messageGreek = ""; string messageEnglish = ""; TextLanguage tl; tl = mainItems[i].GetComponentInChildren <TextLanguage>(); messageGreek += tl.textGreek; messageEnglish += tl.textEnglish; string withCoffeeGreek = nowDay.coffee[itemIndex] ? " - με καφέ" : ""; string withCoffeeEngish = nowDay.coffee[itemIndex] ? " - with coffee" : ""; messageGreek += withCoffeeGreek; messageEnglish += withCoffeeEngish; messageGreek += " - " + nowDay.time[itemIndex]; messageEnglish += " - " + nowDay.time[itemIndex]; messageGreek += " - " + nowDay.transportGreek[itemIndex]; messageEnglish += " - " + nowDay.transportEnglish[itemIndex]; TextLanguage targetTL = target.GetComponentInChildren <TextLanguage>(); targetTL.textGreek = messageGreek; targetTL.textEnglish = messageEnglish; targetTL.SetLanguage(); itemIndex++; target.SetActive(true); } } //print("itemIndex: "+itemIndex.ToString()); for (int i = itemIndex; i < 7; i++) { endItems[i].gameObject.SetActive(false); } }
public void Setup(TextLanguage cTitleTL, int cAmount, string cPrice) { sample = false; //Items.Add(this); titleTL.textGreek = cTitleTL.textGreek; titleTL.textEnglish = cTitleTL.textEnglish; titleTL.SetLanguage(); //titleText.text = TextLanguageManager.language; amount = cAmount; amountText.text = "X" + amount.ToString(); string[] s1 = cPrice.Split(' '); priceOne = 0; float.TryParse(s1[1].Substring(0, s1[1].Length - 1), NumberStyles.Float, CultureInfo.InvariantCulture, out priceOne); priceOneText.text = priceOne.ToString("F2") + "€"; price = amount * priceOne; priceText.text = price.ToString("F2") + "€"; gameObject.SetActive(true); }
public void OpenDay(CalenderDay day) { nowDay = day; OpenPanel(0); Toggle2[] toggles = dayCanvas.GetComponentsInChildren <Toggle2>(true) as Toggle2[]; foreach (Toggle2 toggle in toggles) { toggle.Set(false); } activityEnabled = new bool[7]; for (int i = 0; i < activityEnabled.Length; i++) { if (nowDay.isCompleted && nowDay.activities.Count > i) { activityEnabled[i] = true; } else { activityEnabled[i] = false; } } string newTextEnglish = ((Weekday)day.weekday).ToString() + " " + day.day + " March"; string newTextGreek = ((WeekdayGreek)day.weekday).ToString() + " " + day.day + " Μαρτίου"; TextLanguage tl = cw1DayTitleText.GetComponent <TextLanguage>(); tl.textGreek = newTextGreek; tl.textEnglish = newTextEnglish; tl.SetLanguage(); dayCanvas.SetActive(true); }