
Unity3D
文章平均质量分 61
zuig2
这个作者很懒,什么都没留下…
展开
-
From Built-in to URP
Unity’sScriptable Render Pipelinerepresents a great advance on the way that unity deals with graphics, giving more power to the users to customize the pipeline the way they want. I have started to use theUniversal Render Pipeline (URP)recently and, des...转载 2021-12-27 10:52:53 · 548 阅读 · 0 评论 -
lua不同版本的位操作
lua版本 Lua51 lua52 lua53 来源 bitlib.dll 内置bit32库 内置操作符 引入 require "bit" require "bit32" 按位与 bit.band(a,b) bit32.band(a,b) a & b 按位或 bit.bor(a,b) bit32.bor(a,b) a | b 按位取反 bit.bnot(a) bit32.bn.原创 2021-06-12 16:23:51 · 1093 阅读 · 0 评论 -
谈谈Unity2019纹理压缩格式
一、常见Unity纹理颜色模型1、RGB2、RGBA3、HDR二、全平台支持无压缩纹理格式RGB:RGB 24位RGBA:RGBA 32位三、三平台默认格式压缩选项为:Low QualityRGB-RGBA纹理:PC:RGB Compressed DXT1 - RGBA Compressed DXT5Android:RGB Compressed ETC - RGBA Compressed ETC2IOS:RGB Compresse...原创 2021-05-06 20:23:28 · 884 阅读 · 0 评论 -
把Sorting Order显示到Hierarchy左侧
using UnityEditor;using UnityEngine;public class ShowSortingOrderInHierarchy{ const string editorMenuPath = "Tools/Show SortingOrder In Hierarchy"; static bool isShowSortingOrder = false; //priority > 10 ? 菜单将会显示在Hierarchy中 [MenuIt.原创 2021-03-19 17:22:11 · 165 阅读 · 0 评论 -
关于Unity出现青色闪屏
Unity 2019 或 以上版本在编译shader的时候会出现青色闪屏,这是异步编译的正常显示官方说明异步着色器编译的工作方式通过异步着色器编译,编辑器可将着色器变体添加到编译队列中,并在作业线程中完成它们。它不会立即编译它们。。为了避免渲染停顿,编辑器在编译着色器变体的同时继续渲染。然后,编辑器用纯青色的虚拟着色器填充“ Shader Variant”的位置(您会偶尔看到青色虚拟着色器的短暂瞬态现象,显示出背景情况。)这样可以避免某些对象不在场景中渲染,因为编辑器仍在对其进行编译。编译完成原创 2020-12-24 18:13:08 · 1114 阅读 · 1 评论 -
NGUI笔记1之 UICamera
UICamera作用监听刚体组件(colliders)事件/// * OnHover (isOver) is sent when the mouse hovers over a collider or moves away./// * OnPress (isDown) is sent when a mouse button gets pressed on the collider.原创 2015-02-06 16:27:21 · 523 阅读 · 0 评论 -
Empty4Raycast 空白背景图片点击
using UnityEngine;using System.Collections;namespace UnityEngine.UI{ public class Empty4Raycast : MaskableGraphic { protected Empty4Raycast() { useLegacyMeshGeneration = false; } pro转载 2017-02-21 00:05:58 · 1647 阅读 · 0 评论 -
UGUI自适应笔记
策划要求图片比例必须为16:9,宽度跟屏幕宽度一致,长度可以延伸出屏幕外面本来想自己想自造轮子,挂脚本实现后来发现Unity已经有相应的脚本Aspect Ratio FitterAspect Mode:Envelope ParentAsperct Ratio:16/9(1.777778)即可转载 2017-07-10 20:18:13 · 413 阅读 · 0 评论 -
ExtendTransform仿NGUI在Transfrom左边添加重置按钮
using UnityEngine;using UnityEditor;[CanEditMultipleObjects][CustomEditor(typeof(Transform), true)]public class TransformInspector : Editor{ static public TransformInspector instance; Seriali转载 2015-10-16 13:45:04 · 934 阅读 · 0 评论 -
Unity ColorMask 对应值
0-1 A2-3 B4-5 G6-7 BG8-9 A10-11 RB12-13 RG14-15 RBG原创 2017-12-18 17:21:28 · 2123 阅读 · 0 评论 -
Unity 截图分享实现
public static IEnumerator CaptureScreenshot(Action<string> callback) { yield return new WaitForEndOfFrame();//在当前帧绘制完后才截屏 Rect rect = new Rect(0, 0, Scr...原创 2019-09-16 14:44:02 · 1203 阅读 · 1 评论 -
unity 实现Game窗口的Stats
unity 实现Game窗口的Stats转载 2016-12-22 22:15:58 · 2137 阅读 · 1 评论 -
知道两个点,及半径,求圆与直线的交点
local point1 = { ['x'] = -1, ['y'] = 0,}local point2= { ['x'] = -1, ['y'] = 1,}-- 获取斜截式直线(垂直x的直线不适用斜截式,因为斜率无限大)local GetKB = function(p1, p2) if p1.x == p2.x then return end local k, b k原创 2016-08-21 16:22:08 · 3305 阅读 · 1 评论 -
Dijkstra算法(单源最短路径)C#版
单源最短路径问题,即在图中求出给定顶点到其它任一顶点的最短路径。在弄清楚如何求算单源最短路径问题之前,必须弄清楚最短路径的最优子结构性质。原创 2016-07-26 17:01:49 · 1261 阅读 · 0 评论 -
Unity中HideInInspector和SerializeField
Unity会自动为Public变量做序列化,序列化的意思是说再次读取Unity时序列化的变量是有值的,不需要你再次去赋值,因为它已经被保存下来。什么样的值会被显示在面板上?已经被序列化,但是没有用HideInInspector标记的值。[HideInInspector]表示将原本显示在面板上的序列化值隐藏起来。[SerializeField]表示将原本不会被序列化的私有转载 2015-02-04 22:07:24 · 465 阅读 · 0 评论 -
Unity 内存管理——手机调试Profiler
手机连上.File>Build Setting 勾上Development Build 然后Build And Run 手机在Profiler窗口这个地方选择进入就行了原创 2015-10-16 13:52:26 · 424 阅读 · 0 评论 -
Unity3D序列化ScriptableObject
一、应用把策划数值转为游戏数值二、序列化类及数据结构类public class HeroAssetObject: ScriptableObject{ public Hero[] heroList;}原创 2015-09-14 11:44:22 · 1170 阅读 · 2 评论 -
Unity调试函数执行时间
using UnityEngine;using System.Collections;using UnityEngine.UI;using System.IO; public class TestLoading : MonoBehaviour { /// /// Image控件 /// private Image image; void原创 2015-10-22 10:28:42 · 760 阅读 · 0 评论 -
中文Chinese.txt文件加载读取
using UnityEngine;using System.Collections;using System.Collections.Generic;using System.IO;using System;// 中文文件加载读取 //public class TxTFiles : MonoBehaviour { private string path = ""; //原创 2015-10-09 20:46:10 · 1414 阅读 · 0 评论 -
一个Shader代码编写插件For VS
Latest Version - V0.6[2015-10-17] V0.6 release note:Add VS2015 supportImprove code completion featureIMPROTANT : We have to execute vs2015_register.cmd after extension instal原创 2015-10-25 11:46:15 · 1676 阅读 · 0 评论 -
Unity3D脚本自动添加tag和Layer
using UnityEditor;public class LoadTagAndLayer : AssetPostprocessor{ private static string[] Tags = { "aaaa", "bbbb", "cccc", "dddd" };//所有需要添加的tag值 private static string[] Layers = { "A原创 2015-11-13 01:34:09 · 1326 阅读 · 0 评论 -
清理Unity Console上的Log信息
private static void ClearConsole() { var logEntries = System.Type.GetType("UnityEditorInternal.LogEntries,UnityEditor.dll"); var clearMethod = logEntries.GetMethod("Clear", System.原创 2015-12-08 11:22:15 · 1970 阅读 · 2 评论 -
Diffuse_shadow顶点着色点光源阴影实现
Shader "Zon/Diffuse_shadow" { SubShader { pass{ Tags { "LightMode"="ForwardBase" } CGPROGRAM #pragma vertex vert #pragma fragment frag #include "unitycg.cginc" #include "lig原创 2016-02-27 21:22:12 · 1136 阅读 · 0 评论 -
一个对象绕某个轴旋转,朝向另一个对象(在旋转瞄准过程中只沿着y轴旋转)
transform.rotation = Quaternion.Slerp(transform.rotation , Quaternion.LookRotation(new Vector3(Point.x - transform.position.x,0,Point.z-transform.position.z)),10 * Time.deltaTime);原创 2016-04-24 11:26:16 · 1030 阅读 · 0 评论 -
Unity3D笔记之Asset Store默认下载目录
Asset Store默认下载目录C:\Users\Guio\AppData\Roaming\Unity\Asset Store\Unity Technologies\Unity EssentialsSample Projects转载 2015-02-02 10:23:05 · 870 阅读 · 0 评论