Skip to content

Instantly share code, notes, and snippets.

@nyunesu

nyunesu/Unity.xml Secret

Last active Oct 30, 2020
Embed
What would you like to do?
Rider Unity Style XML
<?xml version="1.0" encoding="UTF-8"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns" xmlns:unity="urn:schemas-jetbrains-com:member-reordering-patterns-unity">
<!-- Pattern to match classes used by Unity that contain serialised fields and event
function methods. Based on the standard "Default Pattern", this will also order
event functions before normal methods, and does not reorder serialised fields,
as this order is reflected in the Unity editor's Inspector -->
<TypePattern DisplayName="Unity classes" Priority="100">
<TypePattern.Match>
<unity:SerializableClass />
</TypePattern.Match>
<Entry DisplayName="Public events">
<Entry.Match>
<And>
<Kind Is="Event" />
<Access Is="Public" />
</And>
</Entry.Match>
<Entry.SortBy>
<Access Order="Public" />
<Static />
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Public Delegates" Priority="100">
<Entry.Match>
<And>
<Access Is="Public" />
<Kind Is="Delegate" />
</And>
</Entry.Match>
<Entry.SortBy>
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Public Enums" Priority="100">
<Entry.Match>
<And>
<Access Is="Public" />
<Kind Is="Enum" />
</And>
</Entry.Match>
<Entry.SortBy>
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Static Fields and Constants">
<Entry.Match>
<Or>
<Kind Is="Constant" />
<And>
<Kind Is="Field" />
<Static />
</And>
</Or>
</Entry.Match>
<Entry.SortBy>
<Kind>
<Kind.Order>
<DeclarationKind>Constant</DeclarationKind>
<DeclarationKind>Field</DeclarationKind>
</Kind.Order>
</Kind>
</Entry.SortBy>
</Entry>
<Entry DisplayName="Properties, Indexers">
<Entry.Match>
<Or>
<Kind Is="Property" />
<Kind Is="Indexer" />
</Or>
</Entry.Match>
</Entry>
<Entry DisplayName="Public Fields">
<Entry.Match>
<And>
<Kind Is="Field" />
<Access Is="Public" />
<Not>
<Static />
</Not>
</And>
</Entry.Match>
<Entry.SortBy>
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Serialized Fields">
<Entry.Match>
<unity:SerializedField />
</Entry.Match>
<!-- No sorting -->
</Entry>
<Entry DisplayName="Non-serialised Fields">
<Entry.Match>
<And>
<Kind Is="Field" />
<Not>
<unity:SerializedField />
</Not>
</And>
</Entry.Match>
<Entry.SortBy>
<Readonly />
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Constructors">
<Entry.Match>
<Kind Is="Constructor" />
</Entry.Match>
<Entry.SortBy>
<Static />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Awake Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="Awake" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnEnable Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnEnable" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnDisable Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnDisable" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnDestroy Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnDestroy" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="Start Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="Start" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="FixedUpdate Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="FixedUpdate" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnTrigger Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnTrigger" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnCollision Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnCollision" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnMouse Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnMouse" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="OnPointer Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="OnPointer" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="Update Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="Update" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="LateUpdate Method">
<Entry.Match>
<And>
<Kind Is="Method" />
<Name Is="LateUpdate" />
</And>
</Entry.Match>
</Entry>
<Entry DisplayName="Event Functions">
<Entry.Match>
<unity:EventFunction />
</Entry.Match>
<Entry.SortBy>
<!-- Prioritises common event functions. For alphabetical, replace with <Name /> -->
<unity:EventFunctionName />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Interface Implementations" Priority="100">
<Entry.Match>
<And>
<Kind Is="Member" />
<ImplementsInterface />
</And>
</Entry.Match>
<Entry.SortBy>
<ImplementsInterface Immediate="true" />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Public Methods">
<Entry.Match>
<And>
<Access Is="Public" />
<Kind Is="Method" />
</And>
</Entry.Match>
<Entry.SortBy>
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="Private Methods">
<Entry.Match>
<And>
<Kind Is="Method" />
<Access Is="Private" />
</And>
</Entry.Match>
<Entry.SortBy>
<Name />
</Entry.SortBy>
</Entry>
<Entry DisplayName="All other members" />
<Entry DisplayName="Nested Types">
<Entry.Match>
<Kind Is="Type" />
</Entry.Match>
</Entry>
</TypePattern>
</Patterns>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.