Epigene.UI.UIText.Update C# (CSharp) Метод

Update() публичный Метод

This will update the text based on formatting and localization settings. The localization will be updated only in Editor Mode to avoid unnecessary performance overhead.
public Update ( ) : void
Результат void
		public virtual void Update() 
		{			

			//modify properties only in editor mode
			if(Application.isEditor)
			{

				//textId = gameObject.name;
			 	//if text localized, reload the text 
			 	//using the name of the object
			 	I18nManager i18n = I18nManager.Instance;
				if(isLocalized 
					&&  i18n != null && i18n.Contains(textId))
				{
					//Log.Debug("Valid key");
					
					text = (wrapSize > 0 ) 	? WordWrap(i18n.Get(textId), wrapSize) 
											: i18n.Get(textId);
					//text = i18n.Get(textId);
				}
				
				// meshRenderer = gameObject.GetComponent<MeshRenderer>();
				// if (meshRenderer)
				// {
				// 	meshRenderer.sortingOrder = sortingOrder;
				// 	//Debug.Log("Set order: " + sortingOrder);
				// }
			}

			//always update
			string formattedText = "";
			if(isNumeric)
			{	
				try
				{
					if(text == "") text = "0";
					float f = 0;
					f = float.Parse(text);
					formattedText = string.Format(format, f);
				}
				catch
				{
					//deny formating errors for now
					Log.Debug("wrong numeric format in:"+gameObject.name);
				}
			}
			else
			{
				formattedText = string.Format(format, text);
			}

			//limit the length if specifed
			if((maxLength > 0) && (maxLength <= formattedText.Length))
			{
				formattedText = formattedText.Substring(0, maxLength);
				formattedText += "...";
			}
			if (uiText)
			{
				uiText.text = formattedText;
			}
		
		}//update()