摘要: //1.解决方案如下 m_introduceContent.text = System.Text.RegularExpressions.Regex.Unescape(content); //2.替换文本 动态赋值会把文本中的\n变成\\n 所以替换就可以了 m_introduceContent.te 阅读全文
posted @ 2021-06-29 19:22 nanyang0310 阅读(1656) 评论(0) 推荐(0) 编辑
摘要: 方法一:∂=arcos(a·b); a和b是单位向量,∂返回的是弧度 代码如下: GameObject a; GameObject b; private void Start() { float angle = Mathf.Acos(Vector3.Dot(a.transform.position. 阅读全文
posted @ 2021-06-13 16:44 nanyang0310 阅读(707) 评论(0) 推荐(0) 编辑
摘要: 记录一个坑 Vector3 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); //因为Input.mousePosition的Z=0,所以转换的位置永远是同一个点 //必须要加上Z的深度再进行转换 Vector3 point = 阅读全文
posted @ 2021-06-11 16:43 nanyang0310 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 /// 功能: 绘制箭头 3 /// 时间: 4 /// 版本: 5 */ 6 7 using System.Collections; 8 using System.Collections.Generic; 9 using UnityEngine; 10 using UnityEngi 阅读全文
posted @ 2021-05-28 14:23 nanyang0310 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 /// 功能: 3 /// 时间: 4 /// 版本: 5 */ 6 7 using System.Collections; 8 using System.Collections.Generic; 9 using UnityEngine; 10 11 public class Mesh 阅读全文
posted @ 2021-05-28 14:21 nanyang0310 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 1.改shader using System.Collections.Generic; using UnityEngine; /// <summary> /// 枚举Shader4种状态类型 /// </summary> public enum RenderingMode { Opaque, Cut 阅读全文
posted @ 2020-12-31 14:07 nanyang0310 阅读(1623) 评论(0) 推荐(0) 编辑
摘要: //需要分割的字符串private string logicFormula="!SW1||SW2&&SW3"; //用于分割的特殊字符 private string[] m_delims = new string[] { "&&", "||", "!", "==" }; //想要的效果 方法如下: 阅读全文
posted @ 2020-10-13 17:05 nanyang0310 阅读(1360) 评论(0) 推荐(1) 编辑
摘要: /* 获取模型对应的贴图中的像素点,修改颜色 */ using System.Collections; using System.Collections.Generic; using UnityEngine; public class DrowLine : MonoBehaviour { public GameObject m_obj; private Texture2... 阅读全文
posted @ 2018-07-03 17:09 nanyang0310 阅读(7095) 评论(0) 推荐(0) 编辑
摘要: using System; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine.Video; using UnityEngine.UI; using TMPro; using UIWidgets; public clas... 阅读全文
posted @ 2018-06-15 16:51 nanyang0310 阅读(10511) 评论(1) 推荐(1) 编辑
摘要: 前言:在最近项目中需要做一个功能,对image可进行放大缩小,移动,放大缩小,移动都比较简单,难点在于限定image的移动范围 阅读全文
posted @ 2018-06-15 16:34 nanyang0310 阅读(4022) 评论(1) 推荐(0) 编辑