text里面设置这个字符串 publicvoidOnPointerClick(PointerEventData eventData) {intlinkIndex =TMP_TextUtilities.FindIntersectingLink(_desText, Input.mousePosition, eventData.pressEventCamera);if(_desText.textInfo.linkInfo.Length ==0)return; TMP_LinkInfo linkInfo=_desText.textInfo.linkInfo[linkIndex]; RectTra...
Unity心得-1 1.Application.persistentDataPath 沙盘路径,在ios平台下用UnityWebRequest方法获取的时候,要在路径前加 "file://"。在用File.Exists()方法判断路径是否存在时,不能加"file://"。 2.接口可以跨dll 抽象类不行 3.TMP_TextUtilities.FindIntersectingLink返回带link的文本在总文本的搜索索引 4.Tween有个...
// 注册链接点击事件的回调函数textMeshProUGUI.color = Color.black; textMeshProUGUI.richText = true; textMeshProUGUI.raycastTarget = true; } public void OnPointerClick(PointerEventData eventData) { // 检查点击的区域是否是文本链接 int linkIndex = TMP_TextUtilities.FindIntersectingLink(textMeshProUG...
= -1) { TMP_LinkInfo linkInfo = textComponent.textInfo.linkInfo[linkIndex]; Application.OpenURL(linkInfo.GetLinkID()); } } } 在这个脚本中,我们使用了TMP_TextUtilities.FindIntersectingLink方法来查找点击位置是否在超链接区域内。如果找到了超链接,我们使用Application.OpenURL方法来打开对应的URL。 4. ...
TMP_TextUtilitiesNamespace: TMProSyntaxpublic static class TMP_TextUtilities Methods DistanceToLine(Vector3, Vector3, Vector3)Function returning the Square Distance from a Point to a Line.Declarationpublic static float DistanceToLine(Vector3 a, Vector3 b, Vector3 point) Parameters...
return bIsTmpText; } public float GetHeight() { float height = 0.0f; bool bIsTmpText = GetBIsTMPText(); if (bIsTmpText) { height = m_tmpText.renderedHeight; if (CachedRectTransform.rect.height != m_tmpText.renderedHeight) CachedRectTransform.sizeDelta = new Vector2(CachedRectTransform.siz...
public class TMP_TextParsingUtilities Properties instanceGet a singleton instance of the TextModuleUtilities.Declarationpublic static TMP_TextParsingUtilities instance { get; } Property ValueTypeDescription TMP_TextParsingUtilities Methods GetHashCode(String)...
Unity恐怖游戏解谜插件扩展:https://assetstore.unity.com/packages/tools/utilities/302624?aid=1100lpo99 终极FPS恐怖游戏模板URP:https://assetstore.unity.com/packages/templates/systems/254506?aid=1100lpo99 终极FPS恐怖游戏模板HDRP:https://assetstore.unity.com/packages/templates/systems/293702?aid=1100lpo...
<Compile Include="Library\PackageCache\com.unity.textmeshpro@3.0.6\Scripts\Runtime\TMP_TextProcessingStack.cs" /> <Compile Include="Library\PackageCache\com.unity.textmeshpro@3.0.6\Scripts\Runtime\TMP_TextUtilities.cs" /> <Compile Include="Library\PackageCache\com.unity.textmeshpro@3.0.6\...
TextMeshProUGUIpTextMeshPro=GetComponent<TextMeshProUGUI>(); intlinkIndex= TMP_TextUtilities.FindIntersectingLink(pTextMeshPro,eventData.position, null);// If you are not in a Canvas using Screen Overlay, put your camera instead of null ...