当前位置: 首页 > news >正文

手机网站开发要哪些人南京百度seo代理

手机网站开发要哪些人,南京百度seo代理,网站底部版权信息,手机友好型网站问题1#xff1a;unity text显示文本时#xff0c;符号可能显示在某行的开头的位置 问题2#xff1a;打字机效果没有适配问题1的脚本 解决方法#xff1a; 问题1#xff1a;通过遍历text组件每一行数据(第二行开始)#xff0c;如果是符号#xff0c;就在它之前的字符前…问题1unity text显示文本时符号可能显示在某行的开头的位置 问题2打字机效果没有适配问题1的脚本 解决方法 问题1通过遍历text组件每一行数据(第二行开始)如果是符号就在它之前的字符前添加换行符 问题2适配上述脚本 脚本1 解决文本符号显示问题 TextSymbolFit.cs public class TextSymbolFit : Text{/// summary/// 用于匹配标点符号/// /summaryprivate readonly string strRegex \p{P};/// summary/// 用于存储text组件中的内容/// /summaryprivate System.Text.StringBuilder MExplainText null;/// summary/// 用于存储text生成器中的内容/// /summaryprivate IListUILineInfo MExpalinTextLine;protected override void OnPopulateMesh(VertexHelper toFill){base.OnPopulateMesh(toFill);StartCoroutine(MClearUpExplainMode(this, text));}private IEnumerator MClearUpExplainMode(Text _component, string _text){_component.text _text;yield return new WaitForEndOfFrame();MExplainText new System.Text.StringBuilder(_component.text);MExpalinTextLine _component.cachedTextGenerator.lines;int mChangeIndex;// 从第二行开始进行检测for (int i 1; i MExpalinTextLine.Count; i){try{if (MExpalinTextLine[i].startCharIdx _component.text.Length) continue;//首位是否有标点bool match Regex.IsMatch(MExplainText.ToString()[MExpalinTextLine[i].startCharIdx].ToString(), strRegex);if (match){mChangeIndex MExpalinTextLine[i].startCharIdx - 1;// 解决联系多个都是标点符号的问题for (int j MExpalinTextLine[i].startCharIdx - 1; j 0; j--){match Regex.IsMatch(MExplainText.ToString()[j].ToString(), strRegex);if (match){mChangeIndex--;}else{break;}}MExplainText.Insert(mChangeIndex, \n);}}catch (Exception e){Debug.LogException(e);}}_component.text MExplainText.ToString();}}脚本2适配TextSymbolFit脚本 UITextType.cs public class UITextType : MonoBehaviour{public delegate void OnComplete();[SerializeField] float defaultSpeed 0.05f;private Text label;private string finalText string.Empty;private Coroutine typeTextCoroutine;private static readonly string[] uguiSymbols { b, i };private static readonly string[] uguiCloseSymbols { b, i, size, color };private OnComplete OnCompleteCallback;private void InitText(){if (label null) label GetComponentText();}public void Awake(){InitText();}public void SetText(string text, float speed -1){InitText();defaultSpeed speed 0 ? speed : defaultSpeed;finalText ReplaceSpeed(text);label.text ;if (typeTextCoroutine ! null){StopCoroutine(typeTextCoroutine);typeTextCoroutine null;}typeTextCoroutine StartCoroutine(InnerTypeText(text));}public void SkipTypeText(){if (typeTextCoroutine ! null){StopCoroutine(typeTextCoroutine);typeTextCoroutine null;}label.text finalText;OnCompleteCallback?.Invoke();}public IEnumerator InnerTypeText(string text){string currentText ;int length text.Length;float speed defaultSpeed;bool tagOpened false;string tagType ;for (int i 0; i length; i){currentText ;//匹配speedif (text[i] [ i 6 length text.Substring(i, 7).Equals([speed)){string parseSpeed ;for (int j i 7; j length; j){if (text[j] ]){break;}parseSpeed text[j];}if (!float.TryParse(parseSpeed, out speed)){speed defaultSpeed;}i 8 parseSpeed.Length - 1;continue;}bool symbolDetected false;//匹配 i 或 bfor (int j 0; j uguiSymbols.Length; j){string symbol string.Format({0}, uguiSymbols[j]);if (text[i] i 1 uguiSymbols[j].Length length text.Substring(i, 2 uguiSymbols[j].Length).Equals(symbol)){currentText symbol;i (2 uguiSymbols[j].Length) - 1;symbolDetected true;tagOpened true;tagType uguiSymbols[j];break;}}//匹配富文本color格式if (text[i] i 1 15 length text.Substring(i, 2 6).Equals(color#) text[i 16] ){currentText text.Substring(i, 2 6 8);i (2 14) - 1;symbolDetected true;tagOpened true;tagType color;}//匹配富文本size格式if (text[i] i 5 length text.Substring(i, 6).Equals(size)){string parseSize ;for (var j i 6; j length; j){if (text[j] ){break;}parseSize text[j];}if (int.TryParse(parseSize, out _)){currentText text.Substring(i, 7 parseSize.Length);i (7 parseSize.Length) - 1;symbolDetected true;tagOpened true;tagType size;}}//匹配富文本结束 /i /b /size /colorfor (int j 0; j uguiCloseSymbols.Length; j){string symbol string.Format(/{0}, uguiCloseSymbols[j]);if (text[i] i 2 uguiCloseSymbols[j].Length length text.Substring(i, 3 uguiCloseSymbols[j].Length).Equals(symbol)){currentText symbol;i (3 uguiCloseSymbols[j].Length) - 1;symbolDetected true;tagOpened false;break;}}if (symbolDetected) continue;currentText text[i];label.text currentText (tagOpened ? string.Format(/{0}, tagType) : );yield return new WaitForSeconds(speed);}typeTextCoroutine null;OnCompleteCallback?.Invoke();}private string ReplaceSpeed(string text){return Regex.Replace(text, \[speed\d(\.\d)?\], );}public bool IsSkippable(){return typeTextCoroutine ! null;}public void SetOnComplete(OnComplete onComplete){OnCompleteCallback onComplete;}}public static class UITypeTextUtility{public static void TypeText(this Text label, string text, float speed 0.05f, UITextType.OnComplete onComplete null){if (!label.TryGetComponentUITextType(out var typeText)){typeText label.gameObject.AddComponentUITextType();}typeText.SetText(text, speed);typeText.SetOnComplete(onComplete);}public static bool IsSkippable(this Text label){if (!label.TryGetComponentUITextType(out var typeText)){typeText label.gameObject.AddComponentUITextType();}return typeText.IsSkippable();}public static void SkipTypeText(this Text label){if (!label.TryGetComponentUITextType(out var typeText)){typeText label.gameObject.AddComponentUITextType();}typeText.SkipTypeText();}}
http://www.dnsts.com.cn/news/263618.html

相关文章:

  • 初创品牌网站建设网站和app的关系
  • 网站制作是怎样做的微信放在网站根目录
  • 海口网站建设方面网站建设 业务
  • 网站防恶意注册网站模版网
  • 湖南做网站磐石网络案例绍兴网站建设设计制作
  • php网站开发试题及答案网站建设单子
  • p2p做网站建设网站都需要注意什么
  • 新手做免费网站免费视频网站怎么赚钱
  • 网站建设需要入无形资产吗响应式网站建设的未来发展6
  • 网站开发公司网站模板抖音商家页面模板
  • 一 美食 视频网站模板下载安装手机设计
  • php开源企业网站安徽网新科技有限公司网站开发
  • 网站机房建设成本ui最好的网站
  • 三星网站建设内容p图做网站兼职
  • 湖北企业响应式网站建设价位福田专业网站建设公司哪家好
  • 笔记本做网站服务器福州建网站的公司
  • 做网站怎么排版好看网络运维工程师招聘要求
  • 成都网站建设商家app开发公司加盟
  • 建设部网站核对编号创办网站需要什么
  • 个人网站还用备案吗网站做营销推广
  • phpmysql网站开发全程实例php 网站开发框架
  • 如何做网站主赚钱一个静态网页多少钱
  • 网站开发合作协议网站内容管理平台
  • 什么网站上做推广iis7新建网站
  • 广东网站开发收费大气网站后台界面
  • 国内最好的在线网站建设制作公司网页思路怎么写
  • 南昌网站开发制作公司苏州市吴江建设局网站
  • 在线网站建设怎么样铜梁城乡建设网站
  • 上海企业网站开发网站建设用户画像例子
  • 哪些行业做网站的多南宁网站开发招聘