
Being able to develop faster often makes this tradeoff worthwhile, however if your application requires the highest possible performance, you may want to stick with Unity's built-in UI system. So, it's largely a tradeoff between development speed versus runtime performance.

You can use the plethora of existing web UI components (like date pickers, charts, Google Maps embed).Unity has its own proprietary UI system, so why would we want to use HTML? Here are just some of the advantages: If you want to jump to a specific section, you can use the following links: You can see the dropdown values in each option change in the console window.In this article, I show how surprisingly easy it is to create a UI in Unity using standard HTML, CSS, and JavaScript. Run the application by clicking on the Play button.Drag UI Controller object into the OnValueChanged event in the inspector and select OnValueChanged function from the dropdown.Drag UI Controller object into the OnValueChanged event in the inspector and select OnValueChanged method from the dropdown. Assign the custom method ( OnValueChanged) into the OnValueChanged event.

Using System.Collections using using UnityEngine using UnityEngine.UI public class TextDemo : MonoBehaviour Right click on Scripts folder, select Create → C# Script and name it as TextDemo.cs. Create a folder named Scripts under Assets folder.Refer the textObject into the script and assign the desired text as the text attribute value as follows, textObject.text = “sample text” Let’s have a look at the UI scripting for the text component. Alignment - Defines the alignment of the text as left, right or center.Font Size - Defines the size of the text.Font Style - Defines the text style as normal (default), bold, italic or bold and italic.
