自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 ugui拖拽

整理了下以前写的using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.EventSystems;[RequireComponent(typeof(CanvasGroup))]public class ItemDrag ...

2019-10-05 12:44:00 300

转载 unity shader 热扭曲 (屏幕后处理)

效果:c#using System;using System.Collections;using System.Collections.Generic;using UnityEngine;//编辑模式可见[ExecuteInEditMode]public class TestImageEffect : MonoBehavio...

2019-09-27 23:46:00 1017

转载 英文取名神器

介绍一个代码命名搜索神器https://unbug.github.io/codelf/https://github.com/unbug/codelfrider添加教程:https://www.jianshu.com/p/f578791b0f2d转载于:https://www.cnblogs.com/sanyejun/p/11597492.html...

2019-09-27 13:42:00 1496

转载 lua正则表达式替换字符串

local _t = {}_t.name = "Li"_t.age = 49local str = string.gsub("hahah---[name]----[age]--xrz-", "[%[](.-)[%]]", function(s) return tostring(_t[s]) end)print(str)转载于:https://ww...

2019-09-26 11:49:00 923

转载 C#新特性span 和 Tuple

span可用于高性能字符串分割等https://www.cnblogs.com/lonelyxmas/p/10171869.htmlhttps://www.codemag.com/article/1807051/Introducing-.NET-Core-2.1-Flagship-Types-Span-T-and-Memory-T?tdsourcetag=s_pctim_ai...

2019-09-10 20:44:00 150

转载 unity监听粒子播放结束

需要在粒子上挂脚本脚本添加代码 public void OnParticleSystemStopped() { Debug.Log("粒子停止"); }这是个生命周期粒子的 StopAction 设置成Callback最好再加上 void Start() { Part...

2019-09-09 16:02:00 4640

转载 2d平台怪物逻辑

2d来回巡逻遇到坑会自动转向可配置单次方向行走的时间,转向等待时间等using System;using System.Collections;using System.Collections.Generic;using System.Threading.Tasks;using UnityEngine;using UnityEngine.Seriali...

2019-09-01 15:27:00 180

转载 unity让碰撞只发生一次

碰撞发生在帧的开始,所以你可以检测到冲突,并在LateUpdate复位:private bool hasCollided = false; void OnCollisionEnter(Collision col) { if(this.hasCollided == true){ return; } this.hasCollided = true; ...

2019-08-31 14:48:00 2275

转载 ugui点击穿透判断

using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.EventSystems;public class ClickTest : MonoBehaviour { // Use this for initializati...

2019-08-19 13:19:00 142

转载 c#字符串代码,动态创建编译器

https://www.cnblogs.com/mrma/p/3998679.html试了,确实可行,在unity也能用值得注意的是UnityScript.Scripting.Evaluator 也有这个类,应该可以实现类似的功能,具体用法未研究转载于:https://www.cnblogs.com/sanyejun/p/11372929.html...

2019-08-18 16:46:00 125

转载 github项目分享

unity 项目合集:https://michidk.github.io/Unity-Script-Collection/ugui特效:https://github.com/mob-sakai/UIEffect?tdsourcetag=s_pctim_aiomsgecs破碎特效:https://github.com/keijiro/Firefly?tdsourcetag=s_pc...

2019-08-08 16:16:00 976

转载 unity 2d 版的lookAt

void LookAt2D(Transform target) { Vector3 dir = target.position - transform.position; float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; transform.rota...

2019-08-06 13:30:00 311

转载 unity全屏截图

using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class Jietu : MonoBehaviour { //ui //ui挂在一个unlitTexture材质球上 pu...

2019-08-06 11:36:00 115

转载 shader例子

1.水波涟漪:https://zhuanlan.zhihu.com/p/472048442.shaderToy转unity:https://zhuanlan.zhihu.com/p/522870863.知乎unity shader教程:https://zhuanlan.zhihu.com/p/467456944.图片流光shader:https://blog.csdn.ne...

2019-07-31 16:21:00 139

转载 unity编辑器Hierarchy添加图标

效果素材using UnityEditor;using UnityEngine;using System.Collections.Generic;[InitializeOnLoad]class MyHierarchyIcon{ static Texture2D texture; static List&lt...

2019-07-30 18:04:00 531

转载 游戏编程模式中文版

https://gpp.tkchu.me/转载于:https://www.cnblogs.com/sanyejun/p/11267325.html

2019-07-29 23:55:00 427

转载 unity不规则按钮解决方案

一种是alpha检测一种是设置collider参考:https://zhuanlan.zhihu.com/p/34204396下面给出第二种方案代码///按钮多边形点击方案,注意Canvas模式应该是Screen Space - Camera 需设置 Render Camera///选中按钮右键UI->变更为多边形按钮,编辑子物体的Collide...

2019-07-23 14:07:00 371

转载 2019-7月 gamejam

https://www.youxibd.com/gamejam转载于:https://www.cnblogs.com/sanyejun/p/11156805.html

2019-07-09 13:45:00 93

转载 unity editor 折叠树

https://blog.csdn.net/e295166319/article/details/52370575需要两个类:树节点类和界面实现类1:树节点类(TreeNode)using UnityEngine;using System.Collections;using System.Collections.Generic; public ...

2019-07-02 11:14:00 452

转载 随记

【DOTween】SetEase 过渡类型SetAutoKill 播放完不自动消除DoMove 第三个参数 snapping设置为 true ,Ease。Linear的设置才有效Tweener t = GetComponent<RectTransform>().DOLocalMove(new Vector3(300, a.y, a.z), 1.5...

2019-06-19 13:44:00 127

转载 unity 编辑器教程

教程1:https://blog.csdn.net/u010019717/article/details/80300136教程2:https://blog.csdn.net/liqiangeastsun/article/details/79262656转载于:https://www.cnblogs.com/sanyejun/p/11037389.html...

2019-06-16 23:18:00 93

转载 The Book of Shaders------shader教程

https://thebookofshaders.com/?lan=ch转载于:https://www.cnblogs.com/sanyejun/p/10975008.html

2019-06-04 17:42:00 728

转载 ugui代码设置ui锚点

using UnityEngine; public enum AnchorPresets { TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, ...

2019-05-31 17:25:00 626

转载 神器 工具 推荐 SRDebugger

unity asset store 关联下载 ,添加这个书签javascript:varurl=window.location.href;varid=url.substr(url.lastIndexOf("-")+1);varsubmitto="http://www.cgsoso.com/misc.php?mod=tag&id="+id;windo...

2019-05-16 15:27:00 919

转载 属性绑定数据绑定思路

/// 方案对比:/// 表现层监听消息--->数据层改变发消息---->表现层收到消息,表现层改变/// 表现层监听消息--->数据层改变会自动发消息(少写了发消息的代码),表现层改变/// 优点:少写了发消息的代码可以说是另外一种思路,但是也可以其他办法解决,自动发消息这个过程,这里我实现了个核心代码using System;using Syst...

2019-05-07 15:41:00 169

转载 游戏中的网络同步机制——Lockstep(帧同步)

本文来自:https://bindog.github.io/blog/2015/03/10/synchronization-in-multiplayer-networked-game-lockstep/#top值得参考文章:https://blog.codingnow.com/2018/08/lockstep.html可参考的项目工程:https://github.com/Cr...

2019-04-30 11:50:00 774

转载 unity 图片 粉碎效果 破碎效果

效果:点击按钮后:这些碎片具有物理碰撞效果,下面会有隐形的支柱垫着碎片,n秒后支柱消失,碎片落下当然你也可以控制生成的碎片,让他们从下而上一块一块地落下插件源码:https://github.com/mjholtzem/Unity-2D-Destruction基本使用说明导入Unity 2D Destruction包将精灵拖...

2019-04-17 10:34:00 1384

转载 lua的克隆函数,table的深度拷贝

--深度拷贝Tablefunction DeepCopy(obj) local InTable = {}; local function Func(obj) if type(obj) ~= "table" then --判断表中是否有表 return obj; end loca...

2019-04-10 15:54:00 774

转载 unity 图片变纯色填充 变色

unity自带shader 即可转载于:https://www.cnblogs.com/sanyejun/p/10671325.html

2019-04-08 16:25:00 2012

转载 图形学 shader教程推荐

https://www.bilibili.com/video/av37119580http://edu.manew.com/my/course/96http://edu.manew.com/my/course/198转载于:https://www.cnblogs.com/sanyejun/p/10667902.html

2019-04-07 22:49:00 51

转载 ugui使用自带功能实现反向遮罩

不需要编写额外的shader和任何代码,只使用自带的功能新建一个材质球,取名为mask,选择自带的UI/Default,调节参数如下图再新建一个材质球,取名为masked,调节参数如下图如下图所示,背景图为Panel遮罩图为Image_m注意层级关系!即可实现来源:https://answers.unit...

2019-04-02 18:23:00 847

转载 git bash常用命令

详细教程https://www.yiibai.com/git/git_push.html常用命令git pull origingit add xxx.txtgit commit -m "说明xx"git push origin mastergit查看某个文件的修改历史1. git log filename可以看到fileName相关的commi...

2019-03-16 20:11:00 65

转载 lua元表详解

https://www.cnblogs.com/blueberryzzz/p/8947446.html元表的作用元表是用来定义对table或userdata操作方式的表举个例子local t1 = {1}local t2 = {2}local t3 = t1 + t2我们直接对两个table执行+运算,会报错lua: /usercode/fil...

2019-03-04 22:04:00 95

转载 恶性bug解决,Encoding 1252 data could not be found. Make sure you have correct international codeset asse...

百度是没有的,google了下这句话的意思是编码1252没找到,确保程序及是国际化格式发生在我使用unity读取xlsx文件,在编辑器运行正常,但是发布出来不正常,报错解决方案:链接:https://answers.unity.com/questions/42955/codepage-1252-not-supported-works-in-editor-but-...

2019-02-22 12:31:00 1697

转载 真随机数,随机数辅助类

using System.Collections;using System.Collections.Generic;using UnityEngine;using System;using System.Linq;public static class RandomHelper{ // 默认生成一个自动分配随机种子的随机数生成器 pri...

2019-02-06 11:32:00 95

转载 unity批量设置图片为etc2格式或者astc格式

网上找了半天,没一个能用的,干脆自己写个,直接拷贝这个脚本就行这个是ios版本的,安卓的话写在注释里面,去掉注释就能用了现在ios支持一种新格式叫astc比原本的pvrtc压缩比更高,而且质量更高,但是iphone5及更老的机子不支持,所以不打算支持iphone5的话,可以用新格式,不然还是用pvrtc我试了下,感觉6*6的astc的性价比最高下面放脚本using...

2019-01-12 15:01:00 899

转载 unity 优化之overdraw查看

scene视图里面能直接看,打开左上角那个下拉选项,选择overdraw就行转载篇在game视图下查看overdraw: https://blog.csdn.net/complicatedcc/article/details/70214681c#代码,要挂在摄像机上using System.Collections;using System....

2019-01-09 21:32:00 1846

转载 unity代码创建草和模拟风的效果

void Start() { Test4(); } //草 private Vector3[] grassArray = new Vector3[7]; private GameObject grassobj; void Test4() { GameObject ob...

2019-01-08 14:57:00 686

转载 unity字库精简

有2种办法,具体看情况使用1.unity自带功能选择放入的字体,修改Character项为"Custom set",接着出现Custom Chars中输入你想使用的字符串,字符重复无所谓,因为最终会自动过滤掉重复字符.如输入"你好世界",那么整个字体最终只包含"你好世界"这四个字的 字符贴图,也就是你仅仅能用这个字库来显示"你好世界"这几个字简单可行...

2019-01-07 20:19:00 259

转载 xcode发布ipa

--------Xcode-------product 产品archive 存档(等)distribute app 分发appdevelopment 开发者next next(等 比较漫长)export 选择你要导出的ipa放在哪个文件夹(完毕)转载于:https://www.cnblogs.com/sanyejun/p/10223864....

2019-01-05 11:45:00 82

空空如也

空空如也

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

TA关注的人

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