public class InspectorExample : MonoBehaviour { //序列化 [SerializeField] public int[] intArray; [SerializeField] public List<string> stringList; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. using UnityEditor; [CustomEditor(typeof(InspectorExample))] public class InspectorExampleEditor : Edit...
[Title("Advanced List Customization")][InfoBox("Using [ListDrawerSettings], lists can be customized in a wide variety of ways.")] ReadOnly -- 只读属性 [ReadOnly]publicint[]ReadOnlyArray2=newint[]{1,2,3}; PropertyOrder属性展示顺序 ...
Disables reordering of an array or list in the Inspector window. By default, array or list script variables are presented with a UI control that allows array element reordering via drag handles to the left of element content. You can use [NonReorderable] attribute on a script array or list ...
首先在面板上隐藏默认的List绘制方法,使用HideInInspector隐藏属性: public class PistonE03 : MonoBehaviour { public float Speed; public Vector3 AddForceWhenHittingPlayer; //We are hiding this in the inspector because we want to draw our own custom //inspector for it. [HideInInspector] public List<...
In this example, a new List is being declared. It has been given the generic type int (meaning it will be a list of integers) after the class name List. The generic type is also used as part of the constructor, after the class name but before the parameter list. ...
Making decisions in code Paper and pencil are powerful tools Summary Chapter 3. Getting into the Details of Variables Writing C# statements properly Understanding component properties in Unity's Inspector Changing a property's value in the Inspector panel Private variables Naming your variables properly...
A Unity Extension to Expose Properties in the the Unity Inspector for Monobehaviours unityunity3dunityengineasset UpdatedApr 7, 2018 C# Utilities to access the PackageManager Internal API (scopes registry, dependencie, registry) in Unity. apipackage-managerpackageunityunity-editorunityengineunity-toolpac...
Project: All the files in your project. You can drag and drop from Explorer into Unity to add files to your project. Scene: The currently open scene. Hierarchy: All the game objects in the scene. Note the use of the term GameObjects and the GameObjects dropdown menu. Inspector: The co...
Project: All the files in your project. You can drag and drop from Explorer into Unity to add files to your project. Scene: The currently open scene. Hierarchy: All the game objects in the scene. Note the use of the term GameObjects and the GameObjects dropdown menu. Insp...
这样在菜单栏创建出来的ScriptableObject,其Inspector界面也是一样的,如下图所示: ReorderableList里存储Array 问题 这里的Wave里的数据是这样,都是单个数据: publicMobs mobs;// What kind of enemy should be spawned in this wave?publicintlevel;// Level of the enemy.publicintquantity;// How many enemies ...