共 305 篇文章 |
|
Unity 冰材质 Shader.Shader "Custom/Ice" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("BaseTex ", 2D) = "white" {} _BumpMap ("Normalmap", 2D) = "bump" {} _BumpAmt ("Distortion", range (0,2)) = 0.1 } SubShader { Tags { "Queue... 阅3 转0 评0 公众公开 24-03-20 11:20 |
Shader"PengLu/normal/iceTrans" {Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("BaseTex ", 2D) = "white" {} _BumpMap ("Normalmap", 2D) = "bump" {} _BumpAmt ("Distortion", range (0,2)) = 0.1}SubShader { Tags { "Queue"="... 阅9 转0 评0 公众公开 24-03-20 11:19 |
Navmesh如何判断当前已经没有路using UnityEngine;using UnityEngine.AI; 阅42 转0 评0 公众公开 23-09-26 16:19 |
在unity中如何try catch类似按钮onclick的操作。大佬,我有个问题想问一下,就是我想搞一个全局的try-catch,把所有异常都能捕捉到。但是像按钮的onClick这种该怎么弄。就我的思路就是在update外面套一个try-catch,最开始的全局初始化函数包一个try-catch就行了。UnhandledException += CurrentDomain_UnhandledException; 阅9 转0 评0 公众公开 23-09-23 23:36 |
阅58 转0 评0 公众公开 23-08-31 11:25 |
【Unity URP】设置光源层Light Layers.光源层 (Light Layers) 功能允许配置某些光源仅影响特定的游戏对象。1.开启光源层并设置光源层名称。在勾选后下方会多出两个选项Mixed Lighting和Light Layers.我们勾选Light Layers以开启光源层。红色光源:将光源的General的Light Layer设置为刚才的Red层级。再勾选Shadows的Custom Shadow Layers设置La... 阅110 转0 评0 公众公开 23-08-30 17:37 |
Unity Spine动画常用API_skeletonanimation.FindSlot(“torso”); Debug.Log(_slot.data.name);//获取slot的名字 Debug.Log(_slot.data.boneData.name);//获取slot挂靠的bone Debug.Log(_slot.r.ToString());//获取slot的颜色R值 Debug.Log(_slot.data.attachmentName);//获取pose下slot的attachment名 _slot.data.additiveBlending = true;//... 阅382 转0 评0 公众公开 23-06-07 20:56 |
URP | 粒子系统Custom自定义数据控制溶解粒子Custom介绍自定义数据。Custom1.xyzw控制对应Shader里的变量texcoord1的xyzw变量使用Custom.half4 frag (v2f i) : SV_Target { float2 uv = i.uv.xy * i.uv2.xy + i.uv2.zw;//控制UV属性 half4 col = SAMPLE_TEXTURE2D(_MainTex,sampler_MainTex,uv) * _BaseColor; float alpha = SAMPLE_TEXTURE2D(... 阅7 转0 评0 公众公开 23-06-07 16:46 |
//创建状态机 public static AnimatorController CreateStudentAnimator(Object Obj) { GameObject item_obj = (Obj as GameObject); item_obj.AddComponent<Animator>(); if (!Directory.Exists(AnimatorPath)) { Directory.CreateDirectory(AnimatorPath); } AnimatorController controller = AnimatorController.CreateAnimatorContro... 阅87 转1 评0 公众公开 23-06-06 23:04 |
mesh法线反转。GetComponent<MeshFilter>().mesh.normals;GetComponent<MeshFilter>().mesh.normals = normals;GetComponent<MeshFilter>().mesh.triangles;GetComponent<MeshFilter>().mesh.triangles = triangles;GetComponent<MeshCollider>().sharedMesh.normals;GetComponent<MeshCollider>().shared... 阅55 转0 评0 公众公开 23-04-27 10:01 |