Skip to main content

Drawers

If no constructor is defined here the default constructor will be used. This you will not have to pass any parameters in those cases.

Texture Drawers

ThryTexture

Draws the texture using the texture representation selected in the settings. (This is also used for textures not using a drawer)

SmallTexture

Draws the texture using the small texture representation.

BigTexture

Draws the texture using the default texture representation.

StylizedBigTexture

Draws the texture using the stylized big texture representation.

Curve

Draws an animation curve UI element that is used to generate a gradient texture.

ThryExternalTextureTool

Draws the texutre and a button to toggle the drawing of an extrnal tool right underneath.

  • Header: The header to draw
  • Typename: The name of the class of the external tool. Class need to have a non static OnGUI method. The drawer will create a new instance of the class and call the OnGUI method.

If the class can defined the event TextureGenerated the drawer will listen to it and update the texture when it is called. In this case the generated texutre needs to be saved to a field named generated_texture. Example: [ThryExternalTextureToolDrawer(Flood Tool,DreadScripts.GradientFlood)]

Available Constructors:

  • ThryExternalTextureToolDrawer(string header, string typename)

ThryRGBAPacker

Draws a texture packer for RGBA textures.

  • firstTextureIsRGB: If true the first texture will be used as RGB and the second as A. Else each texture will be used as the corresponding channel. Options: 0/1 Default: 0
  • sRGB: If true the generated texture will be marked as sRGB. Options: 0/1 Default: 1
  • label1: The label for the first texture
  • label2: The label for the second texture
  • label3: The label for the third texture
  • label4: The label for the fourth texture

Available constructors:

  • ThryRGBAPacker(label 1, label 2, label 3, label 4)

  • ThryRGBAPacker(label 1, label 2, label 3)

  • ThryRGBAPacker(label 1, label 2)

  • ThryRGBAPacker(label 1, label 2, label 3, label 4, sRGB)

  • ThryRGBAPacker(label 1, label 2, label 3, sRGB)

  • ThryRGBAPacker(label 1, label 2, sRGB)

  • ThryRGBAPacker(firstTextureIsRGB, label 1, label 2)

  • ThryRGBAPacker(firstTextureIsRGB, label 1, label 2, sRGB)

Gradient

Draws a gradient UI element that is used to generate a gradient texture. Tries to convert unknown textures to gradients, loads grandiesnt of known texutres (generated by the gradient drawer) from a save.

TextureArray

Draws a texture UI element that accepts drag and drops of gifs and collections of textures. In those cases the textures will be packed into a texture array.

Other Drawers

ThryRichLabel

Draws a rich label. This means the text supports unity rich text markdown. Uses the property display name as the text.

  • size: The size of the label. Default: EditorStyles.standardFont.fontSize Size can be omitted.

Available constructors:

  • ThryRichLabel()
  • ThryRichLabel(size)

ThryToggle

Draws a toggle that can be used to enable or disable a keyword. The difference to the Unity toggle drawer is that this works better with ThryEditor, fixing some edge cases.

  • keyword: The keyword to enable or disable
  • left: If true the toggle will be drawn on the left side of the property. Options: true/false. Default: false

Available constructors:

  • ThryToggle()
  • ThryToggle(left)
  • ThryToggle(keyword, left)

ThryToggleUI

This is only for backwards compatibility. Use ThryToggle without keyword instead.

MultiSlider

Draws a slider that has two handles. The handles can be moved independently. Requires the property to be a Vector The min and max values of the slider are defined by z,w of the vector.

VectorToSliders

Draws a slider for each component of the vector. Requires the property to be a Vector

If twoMinMaxDrawers is set to 1 the drawer will draw two min max drawers for the x,y and z,w components of the vector.

Available constructors:

  • VectorToSliders(label 1, min 1, max 1, label 2, min 2, max 2, label 3, min 3, max 3, label 4, min 4, max 4)
  • VectorToSliders(label 1, min 1, max 1, label 2, min 2, max 2, label 3, min 3, max 3)
  • VectorToSliders(label 1, min 1, max 1, label 2, min 2, max 2)
  • VectorToSliders(twoMinMaxDrawers, label 1, min 1, max 1, label 2, min 2, max 2)

Vector4Toggles

Draws a toggle for each component of the vector in a line. Sets the value to 1 if the toggle is on and 0 if it is off.

ThryMultiFloats

Draws multiple float fields horizontally next to this property. The floats can also be represented as toggles.

  • p: The name of the property that contains the floats
  • displayAsToggles: If true the floats will be represented as toggles. Options: true/false

Available constructors:

  • ThryMultiFloats(displayAsToggles, p1, p2, p3, p4, p5, p6, p7)
  • ThryMultiFloats(displayAsToggles, p1, p2, p3, p4, p5, p6)
  • ThryMultiFloats(displayAsToggles, p1, p2, p3, p4, p5)
  • ThryMultiFloats(displayAsToggles, p1, p2, p3, p4)
  • ThryMultiFloats(displayAsToggles, p1, p2, p3)
  • ThryMultiFloats(displayAsToggles, p1, p2)
  • ThryMultiFloats(displayAsToggles, p1)

Vector3

Draws a vector3 field.

Vector2

Draws a vector2 field.

VectorLabel

Draws a vector field with labels for each component.

Available constructors:

  • VectorLabel(label x, label y, label z, label w)
  • VectorLabel(label x, label y, label z)
  • VectorLabel(label x, label y)

Helpbox

Draws a helpbox with the property display name as the text.

  • type: The type of the helpbox. Options: 0/1/2/3. Default: 0

Available constructors:

  • Helpbox()
  • Helpbox(type)

LocalMessage

Draws a local message with the property display name as the text. Parses the property display name as ButtonData.

RemoteMessage

Draws a remote message with the property display name as source url. Loads the message from the url and parses it as ButtonData.

ThryShaderOptimizerLockButton

Draws a button that can be used to lock or unlock using the shader optimizer.

ThryWideEnum

Like the Unity enum drawer but with a more options.

Available constructors:

  • ThryWideEnum(label1, value1)
  • ThryWideEnum(label1, value1, label2, value2)
  • ...
  • ThryWideEnum(label1, value1, label2, value2, ..., label20, value20)

Docorators

NoAnimate

Marks the property as not animatable. This means the shader optimizer will not make it into a static define.

ThrySeperator(color)

Draws a seperator line.

  • color: The color of the line. Default: Styles.COLOR_FG Color can be omitted.

ThryHeaderLabel(string, size)

Draws a header label.

  • string: The text to draw
  • size: The size of the label. Default: EditorStyles.standardFont.fontSize Size can be omitted.

sRGBWarning

Draws a warning if the texture is marked or not marked as sRGB.

  • shouldHaveSRGB: If true the texture should be marked as sRGB. Options: true/false. Default: true

Available constructors:

  • sRGBWarning()
  • sRGBWarning(shouldHaveSRGB)