自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

转载 C#判定用户输入的是否为字母数字的组合且长度限制在6-12

using System.Text.RegularExpressions;InputField pWord,PeWord; void Start () { //获取InputField组件 PeWord = GameObject.Find("PeWord").GetComponent<InputField>(); }bo...

2018-11-29 17:26:04 1451

原创 C#截取字符串方法

1、单字符分隔用split截取string str = "123_4";string[] strArray = str.Split('_');//输出:sArray[0]="123" //sArray[1]="4"2、多字符分隔字符串string str = "AAAA_BBBBKBB_000";string[] strArray = str.Split(new cha...

2018-05-09 15:25:18 383

原创 Unity 报错TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocati

解决方案:退出unity工程,删除除Assets,ProjectSettings,Visual Studio以外的所有文件。再次打开运行工程错误消失。不知道原因是啥 参考https://issuetracker.unity3d.com/issues/assertion-alloc-temp-thread-dot-dot-dot-appears-when-closing-unity-in-play...

2018-04-08 18:57:23 11702 4

原创 Unity UGUI Slider颜色改变(过渡)

using UnityEngine;using System.Collections;using UnityEngine.UI;public class SliderColor : MonoBehaviour{ public Color[] colors = new Color[] { Color.red, Color.yellow, Color.green }; Sli...

2018-03-28 16:05:32 3697

转载 UGUI优化小技巧批量取消Image<RaycastTarget>

UGUI的Image组件的RaycastTarget勾选以后会消耗一些效率,为了节省效率就不要勾选它了,不仅Image组件Text组件也是这样。 一般UI里也就是按钮才需要接收响应事件,那么大部分image和text是是不需要开RaycastTarget的,一个个取消太过繁琐。 所以可以重写Create-&gt;UI-&gt;Image的事件:[MenuItem("GameObject...

2018-03-01 17:21:28 1035

原创 解决Security.LoadAndVerifyAssembly()过时问题

统一版本检查。当然这里没有统一_5_1。 #if UNITY_4_5 || UNITY_4_6 需加上 #if UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1

2018-01-22 14:27:10 1703

转载 unity动态控制RigidbodyConstraints

RigidbodyConstraints为枚举类型; (|:可以理解为又啊又啊又) 全部锁定: rigidbody.constraints = RigidbodyConstraints.FreezePositionX| RigidbodyConstraints.FreezePositionY| RigidbodyConstraints.FreezePositionZ; 全部解锁: ri

2018-01-15 19:18:55 3622

原创 简单的状态机

using System.Collections;using System.Collections.Generic;using UnityEngine;public class State1 : MonoBehaviour { enum State { state1, state2, state3 } St

2018-01-05 13:51:32 349

原创 Unity判断动画是否播放完毕(随手记,好脑袋不如烂笔头)

Animaotr ani; AnimatorStateInfo animatorInfo; animatorInfo = ani.GetCurrentAnimatorStateInfo(0); //normalizedTime的值为0~1,0为开始,1为结束。 if ((animatorInfo.normalizedTime >= 1

2018-01-05 13:23:53 9731

转载 System.Action委托

一、传统的委托定义及调用C# 代码 using System;using System.Windows.Forms;public delegate void DisplayMessage();public class testTestDelegate{ public static void Main() { DisplayMessage

2017-12-29 10:30:37 4767

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除