DemiEditor
Utils to use he correct method based on Unity's version
Encodes to PNG using reflection to use correct method depending if editor is version 2017 or earlier
Returns the prefab parent by using different code on Unity 2018 or later
Starts an editor coroutine. You can't use normal yield new WaitFor methods because
those are Unity runtime, but you can instead use .
Other than that, you can use normal yield null/etc.
Returns an which you can use with to cancel the coroutine.
Stops the given coroutine generated by
To be used inside a coroutine as a yield instruction: waits for the given seconds
(replaces Unity's yield new WaitForSeconds because it's not available in-editor).
Example usage:
yield return DeEditorCoroutines.WaitForSeconds(1);
File utils
Path slash for AssetDatabase format
Path slash to replace for AssetDatabase format
Current OS path slash
Path slash to replace on current OS
Full path to project directory, without final slash.
Full path to project's Assets directory, without final slash.
Returns TRUE if the given path is an absolute path
Returns TRUE if the given path is an AssetDatabase path
Returns TRUE if the given GUID refers to a valid and existing project folder
Converts the given project-relative path to a full path
Converts the given full path to a project-relative path
Returns TRUE if the file/directory at the given path exists.
Path, relative to Unity's project folder
Validates the string as a valid fileName
(uses commonly accepted characters an all systems instead of system-specific ones).
BEWARE: doesn't check for reserved words
string to replace
Minimum length for considering the string valid
Returns TRUE if the given filepath is within this Unity project Assets folder
Full file path
Returns the given string stripped of any invalid filename characters.
BEWARE: doesn't check for reserved words
string to replace
Character to use as replacement for invalid ones
Returns the given path with all slashes converted to the correct ones used by the system
Returns the asset path of the given GUID (relative to Unity project's folder),
or an empty string if either the GUID is invalid or the related path doesn't exist.
Checks if the given directory (full path) is empty or not
Deletes all files and subdirectories from the given directory
Returns the adb path to the given ScriptableObject
Returns the adb path to the given MonoBehaviour
Returns the adb directory that contains the given ScriptableObject without final slash
Returns the adb directory that contains the given MonoBehaviour without final slash
Returns the adb paths to the selected folders in the Project panel, or NULL if there is none.
Contrary to Selection.activeObject, which only returns folders selected in the right side of the panel,
this method also works with folders selected in the left side.
Sets the script execution order of the given MonoBehaviour
Gets the script execution order of the given MonoBehaviour
Precisely returns the last controlId assigned to a GUI element
Utils to manage UnityPackages import/export and file mirroring
Stores all file paths (excluding metas) found in the given AssetDatabase directory and subdirectory
into the given AssetDatabase file (which will be created if missing),
writing them as relative to the given directory.
EXAMPLE:
adbReadFromDirPath = "Plugins/DOTween"
file "Assets/Plugins/DOTween/aScript.cs" stored as "aScript.cs"
file "Assets/Plugins/DOTween/Subdir/aScript.cs" stored as "Subdir/aScript.cs"
AssetDatabase path ("Assets/...") where the list should be written
AssetDatabase path ("Assets/...") from which the list of files should be retrieved, without final slash
Parses a file list created via and removes any files not present in the list from the given directory
Label to use when logging the result
AssetDatabase path ("Assets/...") to the file containing the list
AssetDatabase path ("Assets/...") to the directory to parse for extra files to remove
If TRUE only returns a report log and doesn't actually delete the files
Utilities for Editor Panels.
Connects to a asset.
If the asset already exists at the given path, loads it and returns it.
Otherwise, depending on the given parameters, either returns NULL or automatically creates it before loading and returning it.
Asset type
File path (relative to Unity's project folder)
If TRUE and the requested asset doesn't exist, forces its creation
If TRUE also creates the path folders if they don't exist
Check if the at the given path exists and eventually if it's available
File path (relative to Unity's project folder)
If TRUE also check if the file is available
(file can be unavailable if it was deleted outside Unity, or if Unity is just starting)
Returns TRUE if the given is dockable, FALSE if instead it's a utility window
Sets the icon and title of an editor window. Works with older versions of Unity, where the titleContent property wasn't available.
Reference to the editor panel whose icon to set
Icon to apply
Title. If NULL doesn't change it
Repaints the currently focues editor
Prefab utilities
Behaves as the Inspector's Apply button, applying any modification of this instance to the prefab parent
Returns TRUe if a prefab instance has unapplied modifications, ignoring any modifications applied to the transform.
NOTE: this a somehow costly operation (since it generates GC)
Completely removes any prefab connection from the given prefab instances, by desotroing the original object and recreating it.
Returns a list with all the new elements created.
Based on RodGreen's method (http://forum.unity3d.com/threads/82883-Breaking-connection-from-gameObject-to-prefab-for-good.?p=726602&viewfull=1#post726602)
Completely removes any prefab connection from the given prefab instance, by desotroing the original object and recreating it.
Based on RodGreen's method (http://forum.unity3d.com/threads/82883-Breaking-connection-from-gameObject-to-prefab-for-good.?p=726602&viewfull=1#post726602)
Calls the given action after the given delay
Return the size of the editor game view, eventual extra bars excluded (meaning the true size of the game area)
Returns a value from 1 to N (2 for 200% scaling) indicating the UI Scaling of Unity's editor.
The first time this is called it will store the scaling and keep it without refreshing,
since you need to restart Unity in order to apply a scaling change
Clears all logs from Unity's console
Adds the given global define (if it's not already present) to all the
or only to the given , depending on passed parameters,
and returns TRUE if it was added, FALSE otherwise.
NOTE: when adding to all of them some legacy warnings might appear, which you can ignore.
to use. Leave NULL to add to all of them.
Removes the given global define (if present) from all the
or only from the given , depending on passed parameters,
and returns TRUE if it was removed, FALSE otherwise.
NOTE: when removing from all of them some legacy warnings might appear, which you can ignore.
to use. Leave NULL to remove from all of them.
Returns TRUE if the given global define is present in all the
or only in the given , depending on passed parameters.
to use. Leave NULL to check in all of them.
Sets the gizmos icon visibility in the Scene and Game view for the given class names
Visibility
Class names (no namespace), as many as you want separated by a comma
Sets the gizmos icon visibility in the Scene and Game view for all custom icons
(for example icons created with HOTools)
Visibility
Returns all components of type T in the currently open scene, or NULL if none could be found.
If you're on Unity 5 or later, and have DeEditorTools, use DeEditorToolsUtils.FindAllComponentsOfType
instead, which is more efficient.
Shifts an item from an index to another, without modifying the list except than by moving elements around
Expands the given array and adds the given element as the last one
Removes the element at index from the given array, shifts everything after by -1 position and resizes the array
Nothing is being dragged
Dragging
Dragging concluced and accepted
Dragging concluced but item position didn't change
Dragging canceled
Dragging concluced but not accepted because too short
Automatically determines if dragged elements are horizontal, vertical, or both
Forces vertical drag
Forces horizontal drag (useful to avoid initial wrong drag indicators
if the users starts dragging an horizontal system vertically)
Manages the dragging of GUI elements
True if a GUI element is currently being dragged
Return the current item being dragged, or NULL if there is none
Type of current item being dragged, or NULL if there is none
Starting index of current item being dragged, or NULL if there is none
Retrieves the eventual optional data stored via the StartDrag method
Starts a drag operation on a GUI element.
Reference to the current editor drawing the GUI (used when a Repaint is needed)
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Optional data that can be retrieved via the static property
Starts a drag operation on a GUI element.
ID for this drag operation (must be the same for both StartDrag and Drag
Reference to the current editor drawing the GUI (used when a Repaint is needed)
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Optional data that can be retrieved via the static property
Starts a drag operation on a GUI element.
Reference to the current editor drawing the GUI (used when a Repaint is needed)
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Optional data that can be retrieved via the static property
Starts a drag operation on a GUI element.
ID for this drag operation (must be the same for both StartDrag and Drag
Reference to the current editor drawing the GUI (used when a Repaint is needed)
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Optional data that can be retrieved via the static property
Call this after each draggable GUI block, to calculate and draw the current drag state
(or complete it if the mouse was released).
ID for this drag operation (must be the same for both StartDrag and Drag
List containing the draggable item and all other relative draggable items
Current index of the draggable item being drawn
If NULL will calculate this automatically using .
Pass this if you're creating a drag between elements that don't use GUILayout
Drag direction. You can leave it to
unless you want to skip eventual layout calculations
Call this after each draggable GUI block, to calculate and draw the current drag state
(or complete it if the mouse was released).
List containing the draggable item and all other relative draggable items
Current index of the draggable item being drawn
If NULL will calculate this automatically using .
Pass this if you're creating a drag between elements that don't use GUILayout
Drag direction. You can leave it to
unless you want to skip eventual layout calculations
Call this after each draggable GUI block, to calculate and draw the current drag state
(or complete it if the mouse was released).
ID for this drag operation (must be the same for both StartDrag and Drag
List containing the draggable item and all other relative draggable items
Current index of the draggable item being drawn
Color to use for drag divider and selection
If NULL will calculate this automatically using .
Pass this if you're creating a drag between elements that don't use GUILayout
Drag direction. You can leave it to
unless you want to skip eventual layout calculations
Call this after each draggable GUI block, to calculate and draw the current drag state
(or complete it if the mouse was released).
List containing the draggable item and all other relative draggable items
Current index of the draggable item being drawn
Color to use for drag divider and selection
If NULL will calculate this automatically using .
Pass this if you're creating a drag between elements that don't use GUILayout
Drag direction. You can leave it to
unless you want to skip eventual layout calculations
Ends the drag operations, and eventually applies the drag outcome.
Returns TRUE if the position of the dragged item actually changed.
Called automatically by Drag method. Use it only if you want to force the end of a drag operation.
If TRUE applies the drag results, otherwise simply cancels the drag
Abstract dynamic class used for every node of the same type
(meaning there is only a single recycled instance for all same-type nodes)
Used to fill
Called when the node needs to be drawn
The connectedNodesIds list will be automatically increased/decreased when adding/removing connections
(otherwise connectedNodesIds will have to be increased via custom code)
Requires only two connectedNodesIds (no more, no less),
uses regular CTRL+Drag to connect connection 0, CTRL+SPACE+Drag to connect connection 1
Like , but with an extra connection as a last extra index, which is set when pressing CTRL+SPACE+Drag.
Must always have at least one element in connectedNodesIds
Layout, Repaint, LayoutAndRepaint
Stores cloned nodes for pasting
Returns a list of pasteable nodes, with their GUID recreated and their connections adapted
Returns a deep clone of the given node but doesn't clone UnityEngine references.
A new ID will be automatically generated.
Always connects a node from BottomOrRight side to TopOrLeft side
Always connects from BottomOrRight side to TopOrLeft side.
If ALT is pressed shows the delete connection button.
Called during Repaint or MouseDown/Up.
Returns TRUE if the connection was deleted using the delete connection button.
Always connects a node from BottomOrRight side to TopOrLeft side
Always connects from BottomOrRight side to TopOrLeft side.
If ALT is pressed shows the delete connection button.
Called during Repaint or MouseDown/Up.
Returns TRUE if the connection was deleted using the delete connection button.
You can attach to this
Use this to add a content group to the Help Panel
Regular note
Editable note (activated by setting to TRUE
(but you will have to save the result somewhere yourself)
If TRUE shows the textArea
Add definition. Supports rich-text but also these special tags:
- [b][/b]
Add key, automatically formatting these special keys:
/
+
→
If TRUE and there's other keys/targets, adds the new key on a new line preceded by a comma
Recalculates all rects based on the given Y shift
One per .
Partially independent, mainly controlled by process.
TRUE when read-to or dragging nodes
Returns TRUE if the given node is currently being dragged
Returns TRUE if a repaint is required
Main class for DeGUI Node system.
Create it, then enclose your GUI node calls inside a .
CODING ORDER:
- Create a to use for your node system (create it once, obviously)
- Inside OnGUI, write all your nodes GUI code inside a
- To draw the nodes, loop through the list and call for each node
Distance at which nodes will be placed when snapping next to each other
Full area without zeroed coordinates
Position with zeroed coordinates (used by all node GUI since it's inside a GUILayout(area))
Contains the nodes passed to NodeProcessScope ordered by depth.
You should loop through this list when drawing nodes
Creates a new NodeProcess.
EditorWindow for this process
Callback called when one or more nodes are going to be deleted.
Return FALSE if you want the deletion to be canceled.
Can be NULL, in which case it will be ignored
Callback called when a node is cloned.
Return FALSE if you want the cloning to be canceled.
Can be NULL, in which case it will be ignored
Needs to be called when loading a complete new series of nodes
Call this when the layout/size of one or more nodes changed because of external intervention
(if a whole new range of nodes has been loaded, just call instead)
Forces the refresh of the area calculations. Useful if you need them before the first GUI call has run
Shifts the visible are to the given coordinates and repaints on end
Shifts the visible are to the given coordinates and repaints on end
Tells the process to repaint once the process has ended.
Calling this
Draws the given node using the given T editor GUINode type.
Returns the full area of the node
Opens the Help Panel
Closes the Help Panel
Opens or closes the Help panel based on its current state
Returns TRUE if the given area is visible (even if partially) inside the current nodeProcess area
Captures a screenshot of the node editor area and returns it when calling the onComplete method.
Sadly this requires a callback because if called immediately the capture will fail
with a "[d3d11] attempting to ReadPixels outside of RenderTexture bounds!" error in most cases
Screenshot mode
A callback that accepts the generated Texture2D object
Screenshot scale factor (only used if screenshotMode is set to )
If TRUE (default) displays a progress bar during the operation.
You'll want to set this to FALSE when you're already using a custom progressBar
and the screenshot is only part of a larger queue of operations
Use this to encapsulate node GUI operations.
Automatically manages various operations (press F1 to see them).
Sets GUI.changed to TRUE if the area is panned, a node is dragged, controlNodes change sorting or are deleted.
Wraps all content inside a GUILayout Area (nodeArea).
The to use
Area within which the nodes will be drawn
Area shift (caused by dragging)
This list will be sorted based on current node draw order,
and changed in case one of its nodes is deleted.
IMPORTANT: this list should be part of your serialized class (MonoBehaviour or ScriptableObject),
so it will be stored as a reference and modifying one will modify the other.
Usually you want to pass all nodes to this except the eventual start node (or nodes that can't be sorted nor deleted).
Set automatically when a selection ends up selecting a single node,
reset when deselecting all nodes, selecting multiple nodes, or resetting the
Returns TRUE if something was actually deselected, FALSE if there were no selected nodes
Returns key modifiers currently pressed.
Requires to be updated at the beginning of every GUI call.
Call this method to update data required by softCtrl calculations.
Automatically called from within a .
Returns a object with the keys that were just pressed and just released
Required to have the correct for the given target call
Returns the given as an int, or -1 if it's not a number
Used code from Celtc on StackOverflow: https://stackoverflow.com/a/54044197/10151925
Gets all fields from an object and its hierarchy inheritance
Perform a deep copy of the class
Does the copy
Returns by .
Contains properties and methods to manage non-layout scrollview better.
Remember to use or to increase or set the full content height
Area used by ScrollView and its content
Full content area regardless if visible or not. Its height should be set manually based on the contents' height
Content area currently visible (scroll bars excluded)
Current scrollPosition
Returns the current open, or an empty one if none is open.
Sets the height
Increase the height by the given amount
Returns a Rect for a single line at the current scrollView yMax
If less than 0 uses default line height, otherwise the value passed
if TRUE (default) automatically increases the height of the accordingly
Returns TRUE if the given rect is at least partially visible in the displayed scroll area
Contains both free and pro skins GUIStyle variations,
and automatically returns the correct one when converted to GUIStyle
Plays the given clip in the Editor
Stops playing the given clip.
Stops all clips playing.
A stopwatch whose time can be changed manually via
Start or resume playing
Stop the watch and reset the time
Restart measuring from zero
Pause the watch
Send the watch to the given time
Util to determine Unity editor version and store them as comparable numbers
Full major version + first minor version (ex: 2018.1f)
Major version
First minor version (ex: in 2018.1 it would be 1)
Assembly extensions
Full path to the assembly directory, without final slash
AssetDatabase path to the assembly directory, without final slash
GUI extension methods
Clones the style and adds the given formats to it. You can pass any of these types of values:
- Format:Rich-text, wordwrap
- FontStyle:Font style
- TextAnchor:Content anchor
- int:Font size
- Color/DeSkinColor:Font color
Adds the given formats to the style. You can pass any of these types of values:
- Format:RichText, WordWrap
- FontStyle:Font style
- TextAnchor:Content anchor
- int:Font size
- Color/DeSkinColor:Font color
Sets the border of the style
Sets the border of the style
Sets the background of the style
Sets the background of the style
Sets the contentOffset of the style
Sets the contentOffset of the style
Sets the X contentOffset of the style
Sets the Y contentOffset of the style
Sets the margin of the style
Sets the margin of the style
Sets the margin of the style
Sets the left margin of the style
Sets the right margin of the style
Sets the top margin of the style
Sets the bottom margin of the style
Sets the overflow of the style
Sets the overflow of the style
Sets the overflow of the style
Sets the left overflow of the style
Sets the right overflow of the style
Sets the top overflow of the style
Sets the bottom overflow of the style
Sets the padding of the style
Sets the padding of the style
Sets the padding of the style
Sets the left padding of the style
Sets the right padding of the style
Sets the top padding of the style
Sets the bottom padding of the style
Sets the Y fixedWidth of the style
Sets the fixedHeight of the style
Sets the stretchHeight property of the style
Sets the stretchWidth property of the style
Stores a GUIStyle palette, which can be passed to default DeGUI layouts when calling DeGUI.BeginGUI,
and changed at any time by calling DeGUI.ChangePalette.
You can inherit from this class to create custom GUIStyle palettes with more options.
Each of the sub-options require a public Init method to initialize the styles, which will be called via Reflection.
Called automatically by DeGUI.BeginGUI.
Override when adding new style subclasses.
Returns TRUE if the styles were initialized or re-initialized
Extend any custom subpalettes from this, so they will be initialized correctly
GUILayout methods
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you set a background to the button's GUIStyle).
Requires to be activated.
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you set a background to the button's GUIStyle)
and also assigns different GUI colors based on the button's state and the given one.
Requires to be activated.
Content
Default color
Style
GUILayout options
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you set a background to the button's GUIStyle)
and also assigns different GUI colors based on the button's state with options to eventually auto-generate them.
Requires to be activated.
Content
Default color
Hover color (if NULL auto-generates it from the given one by making it brighter
Pressed color (if NULL auto-generates it from the given one by making it even brighter
Style
GUILayout options
Shaded button
Shaded button
Shaded button
Shaded button
Colored button
Colored button
Colored button
Colored button
Draws a button that returns TRUE the first time it's pressed, instead than when its released.
Draws a button that returns TRUE the first time it's pressed, instead than when its released.
Toolbar foldout button
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Begins an horizontal toolbar layout
Begins an horizontal toolbar layout
Begins an horizontal toolbar layout
Begins an horizontal toolbar layout
Ends an horizontal toolbar layout
A toolbar with a label
A toolbar with a label
A toolbar with a label
A toolbar with a label
A toolbar with a label
A toolbar with a label
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values. Auto-determines object type from the field's type
Returns TRUE if there's mixed values. Forces field to accept only objects of the given type
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Vertical box layout with style and color options
Vertical box layout with style and color options
End vertical box layout
Horizontal Divider
A text field that becomes editable only on double-click
EditorWindow reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click
Editor reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click and can also be dragged
EditorWindow reference
A unique ID to use in order to determine if the text is selected or not
Text
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click and can also be dragged
Editor reference
A unique ID to use in order to determine if the text is selected or not
Text
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Style for default (non-editing mode) appearance
Style for editing mode
Creates a Gradient field by using Unity 4.x hidden default one and Reflection.
Scene field
Global Demigiant GUI manager. Call to initialize it inside GUI calls.
Default color palette
Default style palette
TRUE if we're using the PRO skin
Call this at the beginning of GUI methods.
Returns TRUE if the styles were initialized or re-initialized
Eventual to use
Eventual to use
Better implementation of GUI.BeginScrollView.
Returns the modified scrollView struct.
Must be closed by a DeGUI..
Area used by the scrollView
target
If TRUE (default) resets .height to 0
after beginning the ScrollView
Closes a DeGUI. correctly
Exits the current event correctly, also taking care of eventual drag operations
Changes the active palettes to the given ones
(or resets them to the default ones if NULL).
Returns TRUE if the styles were initialized or re-initialized
Resets the GUI colors to the default ones (only available if BeginGUI was called first)
Sets the GUI colors to the given ones
Opens a panel that previews the given texture (if not NULL)
Sets the GUI cursor color to the given ones
Sets the GUI matrix to the given ones
Wrapper to set serialized fields with multiple sources selected: automatically sets GUI to show mixed values when necessary
and contains a fieldInfo which is set within the wrapper.
Note that you must set the property within the wrapper so that it's assigned correctly when closing the scope.
Multi property scope
Name of the field so it can be found and set/get via Reflection
List of the sources containing the given field
If TRUE validates EditorGUI.EndChangeCheck before calling it
(fixes an issue which happens with advanced Undo usage in DOTween Timeline and ColorFields)
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you apply a background to the button's GUIStyle).
Requires to be activated.
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you apply a background to the button's GUIStyle)
and also assigns different GUI colors based on the button's state and the given one.
Requires to be activated.
Rect
Content
Default color
Style
A button that triggers an immediate repaint when hovered/pressed/unhovered
(which otherwise doesn't happen if you apply a background to the button's GUIStyle)
and also assigns different GUI colors based on the button's state with options to eventually auto-generate them.
Requires to be activated.
Rect
Content
Default color
Hover color (if NULL auto-generates it from the given one by making it brighter
Pressed color (if NULL auto-generates it from the given one by making it even brighter
Style
Shaded button
Shaded button
Shaded button
Shaded button
Colored button
Colored button
Colored button
Colored button
Toolbar foldout button which allows clicking even on its label
Foldout button + label (not intended to be used in toolbar) which allows click-to-foldout/foldin
Draws a button that returns TRUE the first time it's pressed, instead than when its released.
Draws a button that returns TRUE the first time it's pressed, instead than when its released.
Toolbar foldout button
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Button that can be toggled on and off
Scene field
Draws a background grid using the given grid texture
Area rect
Offset from 0, 0 position (used when area has been dragged)
Texture to use for the grid
Eventual scale to apply to the grid
Draws a background grid using default grid textures
Area rect
Offset from 0, 0 position (used when area has been dragged)
If TRUE forces a dark skin, otherwise uses a skin that fits with the current Unity's one
Eventual scale to apply to the grid
Box with style and color options
Can be used instead of EditorGUI.PropertyField, to draw a serializedProperty without its attributes
(very useful in case you want to use this from within a PropertyDrawer for that same property,
since otherwise bad infinite loops might happen)
Draws a colored square
Draws the given texture tiled within the given rect
Rect
Texture
Eventual scale to apply
If not NULL, colorizes the texture with this color
A text field that becomes editable only on double-click
Area
EditorWindow reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click
Area
Editor reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click and can also be dragged
Area
EditorWindow reference
A unique ID to use in order to determine if the text is selected or not
Text
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Style for default (non-editing mode) appearance
Style for editing mode
A text field that becomes editable only on double-click and can also be dragged
Area
Editor reference
A unique ID to use in order to determine if the text is selected or not
Text
List containing the dragged item and all other relative draggable items
DraggableList index of the item being dragged
Style for default (non-editing mode) appearance
Style for editing mode
A textArea that becomes editable only on double-click
Area
EditorWindow reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
A textArea that becomes editable only on double-click
Area
Editor reference
A unique ID to use in order to determine if the text is selected or not
Text
Style for default (non-editing mode) appearance
Style for editing mode
Divider
Draws a Vector3Field that can have single axes disabled
Draws a Vector3Field that can have single axes disabled
Draws a Vector3Field that can have single axes disabled
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values. Supports using an int as an enum
Returns TRUE if there's mixed values. Supports using an int as an enum
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values. Supports also uint fields
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values. Auto-determines object type from the field's type
Returns TRUE if there's mixed values. Forces field to accept only objects of the given type
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values. Supports passing int values as bool (1 = true, 0 = false)
Returns TRUE if there's mixed values. Supports passing int values as bool (1 = true, 0 = false)
Returns TRUE if there's mixed values. Supports passing int values as bool (1 = true, 0 = false)
Returns TRUE if there's mixed values. Requires a SerializedProperty representation of each UnityEven field
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns TRUE if there's mixed values
Returns a new color equal to the given one with changed brightness
Color to evaluate
Brightness factor (multiplied by current brightness)
If set applies this alpha value
Returns a new color equal to the given one with changed saturation
Color to evaluate
Saturation factor (multiplied by current brightness)
If set applies this alpha value
Changes the alpha of this color and returns it
Returns a new color equal to the given one with changed alpha
Returns a HEX version of the given Unity Color, without the initial #
If TRUE, also converts the alpha value and returns a hex of 8 characters,
otherwise doesn't and returns a hex of 6 characters
Returns a HEX version of the given Unity Color, without the initial #
If TRUE, also converts the alpha value and returns a hex of 8 characters,
otherwise doesn't and returns a hex of 6 characters
Replicates parts of DeExtensions.ListExtensions for internal usage
Shifts an item from an index to another, without modifying the list except than by moving elements around
Shuffles the list
Replicates DeExtensions.RectExtensions for internal usage
Adds one rect into another, and returns the resulting a
Returns a copy or the Rect expanded around its center by the given amount
Indicates how much to expand the rect on each size
Returns a copy or the Rect expanded around its center by the given amount
Indicates how much to expand the rect on each horizontal side
Indicates how much to expand the rect on each vertical side
Returns a copy or the Rect contracted around its center by the given amount
Indicates how much to contract the rect on each size
Returns a copy or the Rect contracted around its center by the given amount
Indicates how much to contract the rect on each horizontal side
Indicates how much to contract the rect on each vertical side
Returns a copy of the Rect resized so it fits proportionally within the given size limits
Width to fit
Height to fit
If TRUE (default) only shrinks the rect if needed, if FALSE also enlarges it to fit
Returns TRUE if the first rect includes the second one
If TRUE, returns TRUE only if the second rect is fully included,
otherwise just if some part of it is included
Returns a copy of the Rect with its X/Y coordinates set to 0
Returns a copy of the Rect with its values shifted according the the given parameters
Returns a copy of the Rect with its X value shifted by the given value
Returns a copy of the Rect with its Y value shifted by the given value
Returns a copy of the Rect with its x shifted by the given value and its width shrinked/expanded accordingly
(so that the xMax value will stay the same as before)
Returns a copy of the Rect with its y shifted by the given value and its height shrinked/expanded accordingly
(so that the yMax value will stay the same as before)
Returns a copy of the Rect with its X property set to the given value
Returns a copy of the Rect with its Y property set to the given value
Returns a copy of the Rect with its height property set to the given value
Returns a copy of the Rect with its width property set to the given value
Returns a copy of the Rect with its X,Y properties set so the rect center corresponds to the given values
Returns a copy of the Rect with its X property set so the rect X center corresponds to the given value
Returns a copy of the Rect with its Y property set so the rect Y center corresponds to the given value
Returns the value of the given property (works like a cast to type).
Improved from HiddenMonk's functions (http://answers.unity3d.com/questions/627090/convert-serializedproperty-to-custom-class.html)
Returns TRUE if this property is inside an array
Returns -1 if the property is not inside an array, otherwise returns its index inside the array
Returns the height of a UnityEvent serializedProperty
Uses code from FlaShG's GitMerge: https://github.com/FlaShG/GitMerge-for-Unity/blob/master/Editor/SerializedPropertyExtensions.cs
Uses code from FlaShG's GitMerge: https://github.com/FlaShG/GitMerge-for-Unity/blob/master/Editor/SerializedPropertyExtensions.cs
String extensions
Returns TRUE if the string is null or empty
If TRUE (default) and the string contains only spaces, considers it empty
Compares a version string (in format #.#.###) with another of the same format,
and return TRUE if this one is minor. Boths trings must have the same number of dot separators.
Converts a HEX color to a Unity Color and returns it
The HEX color, either with or without the initial # (accepts both regular and short format)
Nicifies a string, replacing underscores with spaces, and adding a space before Uppercase letters (except the first character)
If the given string is a directory path, returns its parent
with or without final slash depending on the original directory format
If the string is a directory, returns the directory name,
if instead it's a file returns its name without extension.
Works better than Path.GetDirectoryName, which kind of sucks imho
Evaluates the string as a property or field and returns its value.
If NULL considers the string as a static property, otherwise uses obj as the starting instance
Texture extensions
Returns the full Rect of this texture, with options for position and scale
Checks that the texture uses the correct import settings, and applies them if they're incorrect.
Returns a clone of the event