白泽图

  • 文章
    • Unity渲染
    • Unity项目开发
    • 工具
    • 数学
    • 算法
    • 网站搭建
    • 网络&操作系统
蒋程个人博客
互联网技术经验总结&分享
Unity项目开发

如何使用EditorGUILayout编辑PropertyDrawer

Unity提供PropertyDrawer使我们可以编写指定类型数据的Inspector,比如我们重写Vector3属性的Inspector面板,那么任何使用Vector3的类,其中Vector3类型的序列化数据在Inspector都会变成我们重写的样式,下面是官方使用PropertyDrawer重写属性的示例代码 // The property drawer class should be placed in an editor script, inside a folder called Editor. // …

2022-05-29 0条评论 1441点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Unity Editor 修改鼠标样式

EditorGUIUtility.AddCursorRect(Rect position, MouseCursor mouse) Postion: 鼠标区域 MouseCursor: 鼠标样式类型 0. MouseCursor.Arrow 1.  MouseCursor.Text 2. MouseCursor.ResizeVertical 3. MouseCursor.ResizeHorizontal 4. MouseCursor.Link 5. MouseCursor.SlideArrow 6. Mou…

2022-05-05 0条评论 1407点热度 0人点赞 蒋程 阅读全文
Unity项目开发

获取Unity UnReadable Texture

从assetbundle中获取的Texture2D 的 isReadable 属性是 false,无法直接读取,下面的方法可以将 isReadable 为false的Texture2D提取出来 using System.IO; using UnityEditor; using UnityEngine; public class SaveUnReadableTexture { [MenuItem(("Tools/Save UnReadable Texture"))] static void Sav…

2022-04-29 0条评论 1011点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Unity 内置 Icon 读取

Unity的内置Icon使用 EditorGUIUtility.TrIconContent(string iconName, string tooltip = null) 来获取,可以丰富自己的编辑器,这里撸了一个简单的Icon查看器,代码如下 using System.Collections.Generic; using UnityEngine; using UnityEditor; using System.IO; public class UnityInternalIconsReader : EditorWi…

2022-04-28 0条评论 1850点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Unity C#代码动态编译

static void GenerateCode() { UnityEngine.Debug.LogError("编译"); var code = @" using UnityEditor; using TBC.Timeline; namespace TBC.Editor.Timeline { [CustomEditor(typeof(TBCParticleClip))] public class BattleParticleInspector : UnityEditor.Editor { public overr…

2022-04-27 0条评论 1359点热度 0人点赞 蒋程 阅读全文
Unity项目开发

截获并阻止Unity运行

using UnityEngine; using UnityEditor; public class JCDebugEditor { [InitializeOnLoadMethod] static void OnStart() { EditorApplication.playModeStateChanged += (PlayModeStateChange mode) => { if (mode == PlayModeStateChange.ExitingEditMode) { //TODO... Debug.…

2022-03-31 0条评论 1095点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Unity强行编译接口

// 强制编译 UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();

2022-03-22 0条评论 991点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Lua Queue

function class(classname, super) local superType = type(super) local cls if superType ~= "table" then superType = nil super = nil end if super then cls = {} setmetatable(cls, {__index = super}) cls.super = super else cls = {ctor = function() end} end cls.__cna…

2022-03-12 0条评论 1059点热度 0人点赞 蒋程 阅读全文
Unity项目开发

为Unity扩展基本几何体-圆锥

这两天想做一个可视化坐标系用于辅助学习推导公式,然后看到Unity的在Scene场景中选中物体时显示的坐标系的顶端是三个圆锥体,于是也想搞一个和unity自带一样坐标系,虽然在Unity中可以通过GameObject / 3D Object / 菜单创建一些常用的基础几何网络,如Cube,Sphere,同时Unity也提供代码创建方式 如下 GameObject.CreatePrimitive(PrimitiveType.Sphere) 但是Unity并不支持圆锥,下面给出我的代码,具体讲解已经写在代码注释中了,不…

2022-01-09 0条评论 2533点热度 0人点赞 蒋程 阅读全文
Unity项目开发

unity 资源导入管线 AssetPostprocessor

可以监听Unity Project面板下,所有资源的变化(导入,删除,重载) using UnityEngine; using UnityEditor; class MyAllPostprocessor : AssetPostprocessor { static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)…

2022-01-09 0条评论 1144点热度 0人点赞 蒋程 阅读全文
12345…9
分类
  • Unity渲染 / 26篇
  • Unity项目开发 / 41篇
  • 工具 / 20篇
  • 数学 / 2篇
  • 算法 / 1篇
  • 网站搭建 / 4篇
  • 网络&操作系统 / 5篇
最新 热点 随机
最新 热点 随机
在Unity中通过反射获取SerializedProperty的值 Unity Hierarchy与Scene窗口的操作限制 常用Gizmos图形封装 使用命令行调用unity案例模板(支持update) vscode安装chatgpt 判断TimelineAsset是否被修改
自建Zerotier根服务器 贝塞尔曲线与伯恩斯坦多项式 解决Microsoft Office无法卸载的问题 关于visual studio 2022默认不支持.net4.0以下版本的问题 github访问不稳定的解决方案 byte[]类型在Lua中的使用注意事项

COPYRIGHT © 2023 白泽图. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

登录
注册|忘记密码?