CallbackFunction要从 EditorApplication 回调中调用的委托。 HierarchyWindowItemCallback要在每个 OnGUI 事件上为 Hierarchy 窗口中的每个可见列表项调用的委托。 ProjectWindowItemCallback要在每个 OnGUI 事件上为 Project 窗口中的每个可见列表项调用的委托。
Editor Scripting can help you customize and extend the Unity editor to make it easier to use on your projects. This tutorial covers the basics of editor scripting, including building custom inspectors, gizmos, and other Editor windows.
2.包含父类:如下所示: 2.1.EditorWindow:它是Unity中创建编辑器窗口的基类。当继承自该类时,Odin就具有Unity编辑器窗口中所有的功能。 2.2.ISerializationCallbackReceiver:它是Unity中进行序列化&反序列化游戏类型对象时,调用回调函数的接口。 3.包含属性:如下所示: 3.1.CurrentDrawingTargets:当前正在绘制的目标实例...
SetEase(Ease easeType \ AnimationCurve animCurve \ EaseFunction customEase) 作用:设置渐变的easeType类别。 注意:Ease.Flash/InFlash/OntFlas/InOutFlash,将适用于属性闪烁的效果 例子:iamge.DoColor(Color color,float time).SetEase(Ease easeType,int overshoot,int period) overshoot:指示要应用的闪烁总数。偶...
Custom editor in the Inspector. usingUnityEditor; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; [CustomEditor(typeof(MyPlayer))] public class MyPlayerEditor :Editor{ const string resourceFilename = "custom-editor-uie"; public override VisualElement CreateInspectorGUI(...
The serializedObject can be used inside the OnInspectorGUI function of a custom Editor as described on the page about the Editor class. The serializedObject should not be used inside OnSceneGUI or OnPreviewGUI. Use the target property directly in those callback functions instead.就是说...
You can also supplement the 3D Handle GUI in the scene with 2D buttons and other controls overlaid on the scene view. This is done by enclosing standard Unity GUI calls in a Handles.BeginGUI / EndGUI pair within the /OnSceneGUI/ function. You can use HandleUtility.GUIPointToWorldRay and...
然后便可以通过luaEnv执行lua方法替换添加了[LuaCallCshap]方法内的相关代码了。 如: luaEnv.DoString(@" xlua.hotfix(CS.XLuaTest.HotfixTest, 'Update', function(self) local s = CS.UnityEngine.GameObject.FindWithTag('MainCamera'); CS.UnityEngine.Debug.Log(s.name) ...
请注意,某些脚本方法在 Editor 中运行时会产生分配内存,但在构建项目后不会产生分配内存。GetComponent是最常见的示例;此方法始终在 Editor 中执行时分配内存,而不会在已构建的项目中分配内存。 通常,强烈建议所有开发人员在项目处于交互状态时最大限度减少托管堆内存分配。非交互操作(例如场景加载)期间的内存分配很少产...
or callEditorApplication.Exitwith a non-zero return code. To pass parameters, add them to the command line and retrieve them inside the function usingSystem.Environment.GetCommandLineArgs. To use-executeMethod, you need to place the enclosing script in an Editor folder. The method you execute mu...