自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

翻译 Unity Awake 和 Start 关于值初始化、惰性值和优化

使用惰性值,达到提前给关键变量赋值,而不初始化的目的,从而优化系统

2022-08-18 18:36:29 435 1

原创 Unity 避免DataHazard和竞态的几条准则

Unity 避免DataHazard和竞态的几条准则

2022-08-18 15:19:16 564

原创 Unity 关于读取存档中可能会出现加载用户信息错误(空值类)

Unity 关于读取存档中可能会出现加载用户信息错误(空值类)

2022-08-05 17:56:38 667

原创 UnityShader 错误小集锦 持续更新

这个贴是专门记录在Shader学习和生产过程中发现的各种小问题,方便查阅复习1. 局部光太亮当发生这种情况时,往往是某个方向向量没有归一化。

2022-04-07 10:14:09 808

原创 Unity前向渲染路径简单概括笔记

Unity自5.0版本更新后,最常用的渲染路径有两个,一个是前向渲染ForwardRenderingPath,另一个是延迟渲染路径DeferredRenderingPath,而顶点照明渲染路径由于功能上已经被前向渲染覆盖,故目前已经是遗留状态。前向渲染路径可以理解为直接计算该模型的渲染图元,并计算颜色缓冲区和深度缓冲区的信息。深度缓冲区决定片元是否可见,颜色缓冲区决定片元最终呈现的效果。在一个有多个逐像素光源影响的场景内,我们需要分别使用不同的Pass来计算不同的逐像素光源,并把这些不同的光照结果在帧缓

2022-04-07 08:39:23 3247

原创 Unity 切换场景导致的MissingReferenceException

在制作过场效果时发现的问题。场景为当使用DontDestroyOnLoad保存渐变效果的Canvas时,转换场景会导致CanvasGroup的丢失,这是系统产生了类似于null.some_property的空值错误。解决办法就是在丢失的变量前加上this. this.canvasGroup = GetComponent<CanvasGroup>();解决办法参考自c# - 'MissingComponentException' with 'CanvasGroup.int..

2022-03-18 14:13:56 5045

原创 CountingSort C#

public void CountingSort(ref int[] list, int min = 0, int max = 0) { if(min == 0 && max == 0) { for (int i = 0; i < list.Length; ++i) { if (list[i] < min) .

2022-03-07 15:04:52 366

原创 ShellSort C#

public int[] InsertSortGap(int[] list, int gap) { int m_lenth = list.Length; int m_sortNum; for (int i = gap; i < m_lenth; i += gap)//每次取一个数,gap:希尔排序分段 { for (int s = i - gap; s &..

2022-03-07 13:49:52 165

原创 TopK and HeapSort C#

2022-03-04 13:35:48 281

原创 QuickSort C#

public int Partition(int[] list, int pFirst =0, int pLast=0) { int m_length = list.Length; int m_midNum = 0; int p1 = pFirst; int p2; if(pLast != 0) { ...

2022-02-21 12:10:59 182

原创 InsertSort c#

public int[] InsertSort(int[] list) { int m_lenth = list.Length; int m_sortNum; for(int i = 1; i < m_lenth; i++)//每次取一个数 { for(int s = i - 1; s >= 0 ; s--)//插入有序区 .

2022-02-18 15:09:01 90

原创 SelectSort c#

public int[] SelectSort (int[] list) { int m_min = 0; int m_minNum = 0; int m_lenth = list.Length; for (int i = 0; i < m_lenth; i++)//趟 { fo.

2022-02-18 13:20:07 98

原创 BubbleSort C#

public int[] BubbleSort(int[] list) { int m_lenth = list.Length; int m_sortedNum; int m_perfectNum = 0; for (int m_chaosList = m_lenth; m_chaosList > 1; m_chaosList--)//趟,每一趟m_chaosList无序区都少一个数 ...

2022-02-18 12:23:50 194

原创 [Python]KMP算法下用字符串切片方法实现的字符串替换

class StrPlaces: """用户需求在原文档中,查找相关字符并给出相关信息,并可实现替换操作, 用字符串切片功能实现str.replace功能""" def __init__(self, str, rex ,repl): self.str = str # 原文档 self.rex = rex # 被替换词 self.repl = repl # 替换词 def _rex_pnext_(self): .

2021-09-02 16:01:26 233

空空如也

空空如也

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

TA关注的人

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