Class SuperBehaviourPreferenceProvider
Base class for creating preference providers for SuperBehaviour
Use this class to manage preferences for your custom modules
HINT: Use [InitializeOnLoadMethod] to register your provider on domain reload
public abstract class SuperBehaviourPreferenceProvider
- Inheritance
-
SuperBehaviourPreferenceProvider
Properties
Name
Return Name of the preference provider (part of the final property path)
public abstract string Name { get; }
Property Value
Order
Return the order of the preference provider (higher order will be displayed first)
Do not use negative values for non built-in providers
public virtual int Order { get; }
Property Value
Methods
OnGUI()
Render the GUI (only internal drawing allowed here)
e.g. RenderTitle("Title"), RenderTextField("Label", "Key", "Default"), etc.
public abstract void OnGUI()
RenderBoolField(string, string, bool)
Render a bool field
protected bool RenderBoolField(string label, string key, bool defaultValue)
Parameters
Returns
RenderEnumField<T>(string, string, T)
Render an Enum field
protected T RenderEnumField<T>(string label, string key, T defaultValue) where T : Enum
Parameters
Returns
- T
Type Parameters
T
RenderFloatField(string, string, float)
Render a float field
protected float RenderFloatField(string label, string key, float defaultValue)
Parameters
Returns
RenderIntField(string, string, int)
Render an int field
protected int RenderIntField(string label, string key, int defaultValue)
Parameters
Returns
RenderRangeField(string, string, float, float, float)
Render a range field
protected float RenderRangeField(string label, string key, float defaultValue, float min, float max)
Parameters
Returns
RenderTextField(string, string, string)
Render a text field
protected string RenderTextField(string label, string key, string defaultValue)
Parameters
Returns
RenderTitle(string)
Render a title
protected void RenderTitle(string title)
Parameters
title
string
RenderTitleCollapse(string, string)
Render a collapsable title (use this to allowe users to enable or disable a module)
protected bool RenderTitleCollapse(string title, string key)
Parameters
Returns
RenderToggle(string, string, bool)
Render a toggle field
protected bool RenderToggle(string label, string key, bool defaultValue)