Unity
青竹浪
草泥马、跳跳羊和扑街牛是三个生活在Debug大草原上的好朋友。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用华为NAS开共享并上传下载
使用华为NAS开共享并上传下载原创 2023-06-26 13:58:49 · 4202 阅读 · 0 评论 -
unity编辑器菜单+自定义宏
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEditor;public class MyEditorCtr { /// <summary> ///MenuItem(string itemName, bool isValidateFunction, int priority) ///ite...原创 2021-06-02 18:29:58 · 546 阅读 · 2 评论 -
unity路径返回上一级文件夹
返回路径的上一级文件夹Path.Combine(Path.Combine(Application.streamingAssetsPath, "../"), "cnm.txt")返回路径的上两级文件夹Path.Combine(Path.Combine(Application.streamingAssetsPath, "../../"), "cnm.txt")返回路径的上三级文件夹Path.Combine(Path.Combine(Application.streamingAssetsPath,原创 2021-06-02 18:20:44 · 3279 阅读 · 1 评论 -
VisualEffectGraph的VFX粒子的point cache制作
1.准备一张png格式的图片,有透明度方便扣。导入unity后设置为可读可写,并且勾选AlphaIsTransparency。2.在packagemanager安装好Visual Effect Graph后,从Window—UsualEffects—Utility—PointCacheBakeTool打开转换工具窗口。3.把转换窗口的BakeMode换成Texture,把图片拉上去,该设置什么设置什么,然后点SavetopCachefile生成到指定路径就OK了。4.该...原创 2021-06-02 18:18:55 · 847 阅读 · 0 评论 -
使用 ComputeShader 将图片转成灰阶图
C # :using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class Test : MonoBehaviour{ public Texture2D inputTexture; public RawImage outputImage; public ComputeShader shader;...原创 2021-06-02 18:07:44 · 254 阅读 · 0 评论 -
Unity将RenderTexture转化为Texture2D
方法一:int width = renderTexture.width;int height = renderTexture.height;Texture2D texture2D = new Texture2D(width, height, TextureFormat.ARGB32, false);RenderTexture.active = renderTexture;texture2D.ReadPixels(new Rect(0, 0, width, height), 0, 0);原创 2021-06-02 18:04:18 · 4078 阅读 · 2 评论 -
在场景内查找加有某组件的对象
unity报component出错,但是场景的GameObject太多忘了这component加在哪个GameObject上了,可以改改这工具脚本的Start方法里查找的组件类型(这脚本查找的是AudioListener)拖到空GameObject上运行,根据打印出的对象名一个个去看哪里出问题了。using UnityEngine;public class ComponentFind : MonoBehaviour{ void Start() { Fi原创 2020-08-28 15:48:00 · 1108 阅读 · 0 评论 -
路线指示箭头的生成——两个Vector3计算Distance,Rotation
根据 所在位置 到 目标位置,生成一系列箭头来指示路线,预制体有偏差的,需要改一些值using System.Collections.Generic;using UnityEngine;public class ArrowTips : MonoBehaviour{ private List<Transform> arrowList = new List<Transform>(); public void CreateArrowLine(A...原创 2020-08-28 15:36:36 · 1868 阅读 · 0 评论
分享