ForceDisplayUnit prevents users from change the unit in the inspector, and DisplayAsString, well, displays as string. Combine with ShowInInspector and properties can be used as a kind of debug field by displaying a value in multiple units at once. The user can still enter other values and change the display as they want. The user can enter other values and convert them to meters, or change the display on the fly. They also maintain a history of your entries for quick navigation. Smart fields enable scripting directly into a field's text box using Odin expressions by starting with an character. It's accessible from the Odin menu, orīy right clicking a unit field in the inspector. The Unit system also comes with a new Unit Overview window, allowing overview of all units in your system, including custom units you've added. With over 200 built-in units, Unit and Smart Fields offer a more flexible way of handling numerical values. You can even input values in other units,Īnd the inspector will automatically convert them. The new Unit attribute allows you to define a field's value, such as meters, and easily switch units without changing the underlying code. Introducing enhanced number interaction with Unit and smart fields in Odin Inspector. You can also force any property to be drawn with visual elements byĪpplying the new DrawWithVisualElements attribute to it. VisualElement if it provides one, with a fallback to normal ImGUI. In addition to the manual API above, Odin will now draw any Unity PropertyDrawer, DecoratorDrawer and inlined Editor as an embedded var rect = ImguiElementUtils.EmbedVisualElementAndDrawItHere(this.SomeElement, new GUIContent("Custom label")) Var rect = ImguiElementUtils.EmbedVisualElementAndDrawItHere(this.SomeElement) Private OdinImGuiElement SomeElement = new OdinImGuiElement(new ListView()) You can also give it a serializedProperty. ImGUI code to embed arbitrary visual elements anywhere: You can also utilize this API manually in your own Inside ImGUI from anywhere, even in non-Odin editors. This new feature is made possible by our OdinImGuiElement integration, allowing you to draw visual elements The Odin preferences window under the general drawer settings. Note that this feature is only enabled in Unity 2020.2 and above.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |