- 博客(33)
- 收藏
- 关注
原创 字符串拼接优化
using System.Collections;using System.Collections.Generic;using System.Text;using UnityEngine;public class CSStringBuilder{ public static CSStringBuilder CS { get; set; } = new CSStringBuilder(); public StringBuilder sb = new StringBuilder(10
2020-11-12 15:13:56
157
原创 事件管理
using System.Collections;using System.Collections.Generic;using UnityEngine;public class BaseEvent{ //委托 public delegate void CallBack(uint id, params object[] objs); //事件集合 Dictionary<uint, EventHandler> eventDic = new Dictionar
2020-11-12 14:49:08
137
转载 关于unity中图片的压缩格式
unityAPI有详细的解释(官方中文版)特定于平台的覆盖的纹理压缩格式(TextureImporterOverride)
2019-09-12 16:29:48
395
转载 帧同步(转载)
https://mp.weixin.qq.com/s?__biz=MzA5ODExMTkwMA==&mid=2650255562&idx=1&sn=a457e6dbf7bdd99d1e75dbf7e500dd44&scene=0#wechat_redirect?ref=myread
2019-09-02 17:51:05
173
原创 shaderUI特效,图片表面显示光柱(主要用于UI按钮简单特效)
Shader "FlowLight"{ Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _FlashColor ("Flash Color", Color) = (1,1,1,1) _Angle ("Flash Angle", Range(0, 180)) = 45 _W...
2019-09-02 13:42:41
923
原创 Shader 使图片围绕自己中心旋转(主要是用于旋转的loading界面)
Shader "LoadingImage"{ Properties { _MainTex ("Texture", 2D) = "white" {} _Speed ("Speed",float) = 2 } SubShader { // No culling or depth //Cull Off ZWrite Off ZTest Always T...
2019-09-02 13:33:31
1057
转载 关于LayerMask的解释
https://blog.youkuaiyun.com/qq_34562355/article/details/91876362
2019-08-26 17:26:48
295
原创 Unity官网中文API地址
https://connect.unity.com/doc/Manual/SL-PlatformDifferences
2019-08-09 17:43:36
3323
转载 unity与Andorid交互,andoridStuido导出纯净jar包
https://www.jianshu.com/p/8256c0da444a
2019-08-07 10:57:53
116
转载 tolua 判断对象是否为空
https://blog.youkuaiyun.com/baidu_39447417/article/details/80001371
2019-08-07 10:44:51
558
转载 lua require加载机制以及卸载已经require的模块
require加载机制https://www.cnblogs.com/softidea/p/5242941.html卸载已经require的模块https://blog.youkuaiyun.com/qq_28412897/article/details/82883133
2019-08-07 10:39:12
3788
原创 修改文件名字(这里只是将文件夹的名字添加到文件中,只适用于编辑器模式下)
项目中需要大量修改名字,网上大部分代码都是通过File.Move()函数修改,在实际运用的时候总是报各种IO异常,所以利用了另外一种方法原理:先通过字符拼接生成新名字的文件,再将原文件的数据写入到新文件中,然后再删除新文件,可以达到修改文件名的目的说明:string s = fl.Replace(@"\", "/"); string d= dir.Replace(@"\", "/");这两段代...
2019-07-11 18:03:05
857
原创 通过输入ab包名和后缀名自动添加或修改ab包名(同一文件夹下的所有文夹都会被修改包括子文件夹)
using System.Collections;using System.Collections.Generic;using System.IO;using UnityEditor;using UnityEngine;public class SetGoAssertBundleName : EditorWindow { //文件夹名字 string DictorNa...
2019-07-10 17:08:04
1781
1
原创 shader 入门精要代码以及部分方法的底层实现 1_漫反射
Shader "Custom/_MyDiffuse" { Properties{ _DiffuseColor("Color",Color)=(1,1,1,1)//漫反射强度 } SubShader { Tags { "LightMode=ForwardBase" } CGPROGRAM fixed4 _DiffuseColor; #include "Lightin...
2019-07-05 15:46:02
259
原创 关于lua实现面向对象,实现数据分离
类的实现之前一直在看菜鸟教程的lua面向对象,发现并不能应用到实际开发中,最主要的原因是没能实现数据分离,所有的类都是基于同一个属性,修改其中的一个属性会改变其他所有类的属性,下面是菜鸟教程笔记中的例子Rectangle = {area = 0, length = 0, breadth = 0}function Rectangle:new (o,length,breadth) o = ...
2019-06-24 17:14:15
263
原创 shader 固定取值
渐变法线 fixed halfLambert = 0.5 * dot(worldNormal, worldLightDir) + 0.5;//半兰伯特光照模型 fixed3 diffuseColor = tex2D(_RampTex, fixed2(halfLambert, halfLambert)).rgb*_Color.rgb;//通过半兰伯特光照模型对渐变法线取值...
2019-06-03 13:41:36
294
转载 棋牌类游戏利用字节表示卡牌(仅扑克牌)
#region 成员变量和枚举 public enum CardType { None = 0, WuShiK = 1, Single = 2, Double = 3, Three = 4, Boom = 5, KingBoom = 6, King ...
2019-03-06 17:44:09
1064
转载 unity资源管理帮助
public class ABInfo : Component{ private int refCount; public string Name { get; } public int RefCount { get { return this.refCount; } set { //Log.Debug($"{this.Name} refcount: {...
2019-03-06 17:36:52
309
原创 时间类(unix)(Timer)(c#)
public static class Timer{ public static long Seconds() { return DateTimeOffset.Now.ToUnixTimeSeconds(); } public static long Milliseconds() { return DateTime...
2019-03-06 17:18:53
463
原创 unity编译器打包类(BuildEditor)
public class BundleInfo{ public List<string> ParentPaths = new List<string>();}public enum PlatformType{ None, Android, IOS, PC, MacOS,}public enum BuildType{ Development,...
2019-03-06 17:05:46
1632
原创 unity打包帮助类(BuildHelper)(c#)
public static class BuildHelper{private const string relativeDirPrefix = “…/Release”;public static string BuildFolder = “…/Release/{0}/StreamingAssets/”; public static void Build(PlatformType type...
2019-03-06 16:59:55
457
原创 版本信息(VersionConfig)(c#)
public class FileVersionInfo{public string File;public string MD5;public long Size;}public class VersionConfig : Object{ public int Version; public long TotalSize; [BsonIgnore] public D...
2019-03-06 16:56:12
659
原创 unity编译器资源帮助类(EditorResHelper)(c#)
FileHelper为博客中另一个文件帮助类public class EditorResHelper{/// /// 获取文件夹内所有的预制跟场景路径/// /// 源文件夹/// 是否获取子文件夹/// public static List GetPrefabsAndScenes(string srcPath){List paths = new List();F...
2019-03-06 16:51:55
411
原创 文件md5值的获取(MD5Helper)(c#)
获取文件md5的值public static string FileMD5(string filePath) { byte[] retVal; using (FileStream file = new FileStream(filePath, FileMode.Open)) { MD5 md5 = new MD5CryptoServiceP...
2019-03-06 16:40:21
668
原创 unity强制刷新布局
LayoutRebuilder.ForceRebuildLayoutImmediate(“传入RectTransform组件”);
2019-03-06 16:39:31
3470
转载 文件帮助类(FileHelper)(c#)
public static class FileHelper{//得到目录下所有的文件public static void GetAllFiles(List files, string dir){string[] fls = Directory.GetFiles(dir);foreach (string fl in fls){files.Add(fl);}string[] su...
2019-03-06 16:39:18
1393
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人