config); //npcHealth.config是引用的SO实例而不是脚本 // show the variables from the MonoBehaviour base.OnInspectorGUI(); // draw the ScriptableObjects inspector editorInstance.DrawDefaultInspector(); } } 上述代码效果如下: 使用自定义Inspector来在MB中展示SO变量 这样,我们就可以在MB中检查SO文件NPC...
步骤7.在节点的Inspector面板,分别设置Dialogue Text为“Hello.”,"Goodbye." 步骤8.创建一个空游戏对象重命名为“Player”,创建一个Cube命名为NPC将空游戏对象。 步骤9,点击NPC。加一个对话系统触发器: 步骤10.单击Add Action并选择Start Conversation: 步骤11.从Conversation下拉,指定Conversation字段为New Conv...
2D)="white"{}_Color("Main texture Tint",Color)=(1,1,1,1)[Header(General Settings)][MaterialToggle]_OutlineEnabled("Outline Enabled",Float)=1[MaterialToggle]_ConnectedAlpha("Connected Alpha",Float)=0[HideInInspector]_AlphaThreshold("Alpha clean",Range(0,1))=0_Thickness("Width (Max recomm...
[MenuItem("Tools/Test")]staticvoidCreateWindow(){ var window = GetWindow(typeof(MyTypeEditor),true); window.Show(); } privatevoidOnGUI(){ EditorGUILayout.HelpBox("请在场景中选择任意物体", MessageType.Info); EditorGUILayout.LabelField("选中的物体:"); foreach (var item in Selection.gameOb...
1. 在Prefab UI界面中右键点击节点,指定变量为private/protected/public,然后弹出可选择的变量类型菜单。 2. 添加绑定后,数据在Inspector面板显示,方便修改变量相关类型等;支持添加变量和数组变量;默认变量名为节点名,变量名重复时自动修改变量名,可自行编辑变量名;支持数组添加/移除;拖动数组元素可调整索引; 3. 选择...
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view. // Very handy for organization! // The last collision flags returned from controller.Move [System.NonSerialized] ...
Some simple techniques that may help us to reduce the use of Find() in our code include setting references to objects using the Inspector panel where possible or creating scripts that manage references to things that are commonly searched for. Transform Setting the position or rotation of a ...
Controlling Quests in Conversations 在对话中控制任务您通常可以使用指向并单击Lua向导来检查和设置对话中的任务状态。Quest-Related Lua Functions Quest-Related Lua函数如果你想直接使用quest management Lua函数,可以总结如下: Quest Management Triggers 任务触发管理器你可以使用这些组件来控制任务: ...
using Sirenix.OdinInspector.Editor; using Sirenix.Utilities.Editor; using UnityEngine; using Sirenix.Utilities; public class OdinConfigWindow : OdinMenuEditorWindow { [MenuItem("Sugarzo/项目配置设置")] private static void OpenWindow() { var window = GetWindow<OdinConfigWindow>(); ...
Create a new public float variable at the top of the script: publicfloatspeed =0; 2. Multiply the force by speed. In theFixedUpdatefunction, revise theAddForcecall to include the speed variable: rb.AddForce(movement*speed); 3. Increase the speed in the Inspector window. ...