利用反射打开PreferencesWindow

作者:追风剑情 发布于:2018-4-11 15:02 分类:Unity3d

示例 [MenuItem ("Tool/Open Unity Preferences")] static void OpenUnityPreferences() { //GetType("NameSpace.ClassName+嵌套类,程序集") System.Type T = System.Type.GetType("U...

阅读全文>>

标签: Unity3d

评论(0) 浏览(2894)

AssetDatabase.FindAssets()

作者:追风剑情 发布于:2018-4-11 10:31 分类:Unity3d

搜索资源 public static string[] FindAssets(string filter, string[] searchInFolders); public static string[] FindAssets(string filter); 示例 var GUIDs = AssetDatabase.FindAssets("t:Script VSCode"); for...

阅读全文>>

标签: Unity3d

评论(0) 浏览(16856)

[UnityEditor.Callbacks.DidReloadScripts()]

作者:追风剑情 发布于:2018-4-10 14:37 分类:Unity3d

示例 using UnityEngine; using UnityEditor; using System.Collections; public class TestEditor { //监听脚本编译完成 [UnityEditor.Callbacks.DidReloadScripts()] static void OnScriptReload...

阅读全文>>

标签: Unity3d

评论(0) 浏览(7577)

Camera参数设置

作者:追风剑情 发布于:2018-4-8 14:53 分类:Unity3d

https://docs.unity3d.com/Manual/class-Camera.html camera.aspect = 0.5f //调整摄像机的宽高比为0.5 camera.fieldOfView = 60; //设置视场,Unity会根据aspect进行等比缩放 camera.rect = new Rect(0, 0...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3347)

自己写个性能统计窗口(Profiler Stats)

作者:追风剑情 发布于:2018-4-1 18:04 分类:Unity3d

示例代码 using System; using System.Text; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Profiling; /// <summary> /// GUI stats. /...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5808)

设置天空盒(Skybox)

作者:追风剑情 发布于:2018-3-31 13:01 分类:Unity3d

一、准备6张天空盒纹理(上、下、左、右、前、后) 纹理的Wrap Mode一定要设置成Clamp,以防止在接缝处出现不匹配的现象。 二、把纹理拖到天空盒材质球上 Tint Color:用于控制该材质的整体颜色 Exposure:用于调整天空盒子的亮度 Rotation:用于调整天空盒子沿+y轴方向的旋转角度 三...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5526)

导出NavMesh并保存为obj文件

作者:追风剑情 发布于:2018-3-18 16:08 分类:Unity3d

本文转自: http://blog.csdn.net/huutu/article/details/52672505 一、新建一个场景并烘焙好导航网格 隐藏掉障碍物效果 代码: Unity2017 //本代码转自 http://blog.csdn.net/huutu/article/details/52...

阅读全文>>

标签: Unity3d

评论(0) 浏览(16397)

Unity5的渲染统计窗口

作者:追风剑情 发布于:2018-3-18 10:53 分类:Unity3d

渲染统计窗口(Rendering Statistics Window) 信息名称 描述 每帧的时间和FPS 在Graphic的右侧显示,给出了处理和渲染一帧所需的时间,以及FPS数目 ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(11159)

监听Unity3d启动事件[InitializeOnLoad]

作者:追风剑情 发布于:2018-3-8 15:18 分类:Unity3d

示例 using UnityEngine; using UnityEditor; //这个类放在Editor目录下 //加上这个标签可以监听UnityEditor启动 [InitializeOnLoad] public class Startup { static Startup() { Debug.Log("[Startup] Sta...

阅读全文>>

标签: Unity3d

评论(0) 浏览(6527)

自动生成图集

作者:追风剑情 发布于:2018-1-30 11:04 分类:Unity3d

示例代码 using UnityEngine; using UnityEditor; using System.IO; using System.Collections; using System.Collections.Generic; public class MenuEditor { [MenuItem("Tools/Generate Atlas")] ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4558)

PropertyModification

作者:追风剑情 发布于:2018-1-12 14:05 分类:Unity3d

利用PropertyModification,在Prefab中保存额外属性信息。 示例 using UnityEngine; using UnityEditor; using System; using System.IO; using System.Collections; public class MenuEditor { [MenuItem(...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5416)

自定义Hierarchy中的对象排序——BaseHierarchySort

作者:追风剑情 发布于:2017-12-29 13:58 分类:Unity3d

开启Hierarchy排序(Edit->preferences->General) 勾上Enable Alpha Numeric Sorting 示例(必须放在Editor文件夹下) using UnityEngine; using UnityEditor; using System.Collections; /// <sum...

阅读全文>>

标签: Unity3d

评论(0) 浏览(52738)

获取对象的预览图——AssetPreview.GetAssetPreview()

作者:追风剑情 发布于:2017-12-27 17:49 分类:Unity3d

获取对象的预览图 示例代码 using UnityEngine; using UnityEditor; using System.Collections; public class AssetPreviewWindow : EditorWindow { [MenuItem("Example/AssetPreviewWindow")] ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(7459)

EditorGUIUtility.Load()

作者:追风剑情 发布于:2017-12-27 11:47 分类:Unity3d

先来看看这个方法的实现(可通过ILSpy反编译UnityEngine.dll查看源码) // UnityEditor.EditorGUIUtility [TypeInferenceRule(TypeInferenceRules.TypeReferencedBySecondArgument)] private static UnityEngine.Object Load(string ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3601)

提取Unity内置资源图标

作者:追风剑情 发布于:2017-12-27 11:37 分类:Unity3d

参考 http://blog.csdn.net/warrenmondeville/article/details/53247181 示例代码 using UnityEngine; using UnityEditor; using System; using System.Collections; using System.Reflection; ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5443)

PopupWindowContent

作者:追风剑情 发布于:2017-12-26 16:44 分类:Unity3d

自定义弹出菜单 PopupExample.cs using UnityEngine; using UnityEditor; using System.Collections; public class PopupExample : PopupWindowContent { bool toggle1 = true; bool toggl...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3985)

选择对象——EditorGUIUtility.ShowObjectPicker()

作者:追风剑情 发布于:2017-12-25 21:45 分类:Unity3d

TestInspector.cs using UnityEngine; using UnityEditor; using System.Collections; [CustomEditor(typeof(Test))] public class TestInspector : Editor { Test test; bool toggleGr...

阅读全文>>

标签: Unity3d

评论(0) 浏览(10145)

DecoratorDrawer

作者:追风剑情 发布于:2017-12-25 17:39 分类:Unity3d

工程截图 示例代码 Range1DecoratorDrawer.cs using UnityEngine; using UnityEditor; using System.Collections; //自定义特性的装饰属性样式 [CustomPropertyDrawer(typeof(Range1Attribute))] public ...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3304)

PropertyDrawer

作者:追风剑情 发布于:2017-12-25 17:32 分类:Unity3d

工程截图 示例代码 Range1PropertyDrawer.cs using UnityEngine; using UnityEditor; using System.Collections; //自定义特性属性样式 [CustomPropertyDrawer(typeof(Range1Attribute))] publi...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3171)

获取对象依赖关系

作者:追风剑情 发布于:2017-12-21 21:14 分类:Unity3d

手动查看对象依赖关系 代码获取对象依赖关系 using UnityEngine; using UnityEditor; using System; using System.IO; using System.Collections; public class MenuEditor { [MenuItem("Tool/Ed...

阅读全文>>

标签: Unity3d

评论(0) 浏览(5773)

分离Alpha通道

作者:追风剑情 发布于:2017-12-21 11:01 分类:Unity3d

工程 示例代码 using UnityEngine; using UnityEditor; using System; using System.IO; using System.Collections; public class MenuEditor { [MenuItem("Tool/Texture S...

阅读全文>>

标签: Unity3d

评论(0) 浏览(3484)

SerializedObject

作者:追风剑情 发布于:2017-12-8 16:53 分类:Unity3d

对SerializedObject中的部分方法进行说明 SerializedObject //Inspector中的值变化同步到targetObject中 ApplyModifiedProperties(); //更新Inspector界面显示 //targetObject中的值变化同步到Inspector中 Update(); //更新Inspector界面显示...

阅读全文>>

标签: Unity3d

评论(0) 浏览(4346)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号