白泽图

  • 文章
    • Unity渲染
    • Unity项目开发
    • 工具
    • 数学
    • 算法
    • 网站搭建
    • 网络&操作系统
Unity项目开发
Unity项目开发

Unity Editor 扩展 ProjectSetting 与 Preferences 窗口

先看一下最终效果 这是ProjectSetting窗口效果,我实际存储了TBCEditorSetting.asset这个资源的GUID,这里只是重写了GUI 数据存储在ProjectSettings/TBCFrameworkSettings.asset 这里要注意的是这个asset文件不在Assets文件夹下,所以不能使用AssetDatabase来加载,需要使用InternalEditorUtility的LoadSerializedFileAndForget与SaveToSerializedFileAndForg…

2022-06-07 0条评论 2618点热度 1人点赞 蒋程 阅读全文
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条评论 1587点热度 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条评论 1558点热度 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条评论 1108点热度 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条评论 2001点热度 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条评论 1430点热度 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条评论 1166点热度 0人点赞 蒋程 阅读全文
Unity项目开发

Unity强行编译接口

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

2022-03-22 0条评论 1071点热度 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条评论 1131点热度 0人点赞 蒋程 阅读全文
Unity项目开发

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

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

2022-01-09 0条评论 2717点热度 0人点赞 蒋程 阅读全文
12345
分类
  • Unity渲染 / 26篇
  • Unity项目开发 / 41篇
  • 工具 / 20篇
  • 数学 / 2篇
  • 算法 / 1篇
  • 网站搭建 / 4篇
  • 网络&操作系统 / 5篇
最新 热点 随机
最新 热点 随机
在Unity中通过反射获取SerializedProperty的值 Unity Hierarchy与Scene窗口的操作限制 常用Gizmos图形封装 使用命令行调用unity案例模板(支持update) vscode安装chatgpt 判断TimelineAsset是否被修改
模糊效果原理与实现 截获并阻止Unity运行 解决VisualStudio安装ErrorCode1714的问题 常用Gizmos图形封装 UnityShader if判断优化 Unity Editor 修改鼠标样式

COPYRIGHT © 2023 白泽图. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

登录
注册|忘记密码?