Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

TextMesh Pro - set fontStyle via script

$
0
0
using TMPro;

[SerializeField] private TMP_Text quadTermsLegalAge;

quadTermsLegalAge.GetComponent<TMP_Text>().fontStyle = FontStyle.Bold;


Error:

Assets\Scripts\SceneMainController_Scene2.cs(193,76): error CS0266: Cannot implicitly convert type 'UnityEngine.FontStyle' to 'TMPro.FontStyles'. An explicit conversion exists (are you missing a cast?)

Why is this not working ??? :(

Unity Version: 2020.3
TextMeshPro Version: 3.0.6

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>