白泽图

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

关于PlayableGrahp在编辑器下改变状态无法立即更新的问题

在编辑器下,做playable相关的操作,比如调用PlayableGrahp.Stop()后再执行PlayableGrahp.Play(),但是更新函数没有被调用 解决方法: 调用UnityEditor.EditorApplication.QueuePlayerLoopUpdate(); Normally, a player loop update will occur in the editor when the Scene has been modified.  This method al…

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

Unity编辑器Reorderable List

Unity默认对List与Array的序列化,在Inspector面板上的显示,对操作并不是很友好,比如需要交换两个数组元素下标时,需要挨个赋值两个被交换的元素,当数组元素为复杂的类对象时,此操作更加麻烦,而Reorderable List可以更加直观的显示数组元素,整体上会更加美观,并且自带拖拽等操作,以下使用案例截取Cinemachine插件使用Reorderable List的部分代码 声明 private ReorderableList mWaypointList; 初始化 void SetupWaypoi…

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

获取UnitySceneView中的相机

GameObject sceneCameraGo = EditorUtility.CreateGameObjectWithHideFlags("SceneCamera", HideFlags.HideAndDontSave, typeof(Camera)); var sceneCamera = sceneCameraGo.GetComponent<Camera>();

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

Unity编辑器模式下获取GameView的鼠标操作事件

最近希望在编辑器模式下通过GameView的鼠标操作镜头,所以首先需要获取到鼠标的操作事件 编辑器模式下运行一般来有监听EditorApplication.update回调,或者 在MonoBehaviour的类声明[ExecuteInEditMode]、[ExecuteAlways]标签两种方式。获取鼠标方式一般有Input和Event两种方式,下面直接说在编辑器模式下的组合结果 1.监听EditorApplication.update回调的方式:  无法使用Input(Input.touchCount…

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

Unity Editor 扩展 ProjectSetting 与 Preferences 窗口

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

2022-06-07 0条评论 2695点热度 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条评论 1638点热度 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条评论 1654点热度 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条评论 1170点热度 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条评论 2126点热度 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条评论 1477点热度 0人点赞 蒋程 阅读全文
12345
分类
  • Unity渲染 / 26篇
  • Unity项目开发 / 45篇
  • 工具 / 20篇
  • 数学 / 2篇
  • 算法 / 1篇
  • 网站搭建 / 4篇
  • 网络&操作系统 / 5篇
最新 热点 随机
最新 热点 随机
坐标系转换技术应用 解决Quaternion.FromToRotation两方向平行相反的问题 Unity Animator.Rebind() 接口会导致TPose 使用反向深度拷贝赋值unity对象 在Unity中通过反射获取SerializedProperty的值 Unity Hierarchy与Scene窗口的操作限制
坐标系转换技术应用
在NGUI之间显示模型(SortingOrder、RenderQueue、ZTest应用) Phong光照模型与BlinnPhong光照模型 截获并阻止Unity运行 边缘检测 CentOS内核升级 C#所有编码格式

COPYRIGHT © 2023 白泽图. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

登录
注册|忘记密码?