Class MaterialEditor
Inheritance
MaterialEditor
Assembly: UnityEditor.dll
Syntax
[CustomEditor(typeof(Material))]
public class MaterialEditor : Editor, IPreviewable, IToolModeOwner
Fields
|
Improve this Doc
View Source
kMiniTextureFieldLabelIndentLevel
Declaration
public const int kMiniTextureFieldLabelIndentLevel = 2
Field Value
Properties
|
Improve this Doc
View Source
isVisible
Declaration
public bool isVisible { get; }
Property Value
Methods
|
Improve this Doc
View Source
ApplyMaterialPropertyDrawers(Material)
Declaration
public static void ApplyMaterialPropertyDrawers(Material material)
Parameters
|
Improve this Doc
View Source
ApplyMaterialPropertyDrawers(Object[])
Declaration
public static void ApplyMaterialPropertyDrawers(Object[] targets)
Parameters
Type |
Name |
Description |
Object[] |
targets |
|
|
Improve this Doc
View Source
Awake()
Declaration
public virtual void Awake()
|
Improve this Doc
View Source
BeginAnimatedCheck(MaterialProperty)
Declaration
public void BeginAnimatedCheck(MaterialProperty prop)
Parameters
|
Improve this Doc
View Source
BeginAnimatedCheck(Rect, MaterialProperty)
Declaration
public void BeginAnimatedCheck(Rect totalPosition, MaterialProperty prop)
Parameters
|
Improve this Doc
View Source
ColorProperty(String, String)
Declaration
[Obsolete("Use ColorProperty with MaterialProperty instead.")]
public Color ColorProperty(string propertyName, string label)
Parameters
Returns
|
Improve this Doc
View Source
ColorProperty(MaterialProperty, String)
Declaration
public Color ColorProperty(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
ColorProperty(Rect, MaterialProperty, String)
Declaration
public Color ColorProperty(Rect position, MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
DefaultPreviewGUI(Rect, GUIStyle)
Declaration
public void DefaultPreviewGUI(Rect r, GUIStyle background)
Parameters
|
Improve this Doc
View Source
DefaultPreviewSettingsGUI()
Declaration
public void DefaultPreviewSettingsGUI()
|
Improve this Doc
View Source
DefaultShaderProperty(MaterialProperty, String)
Declaration
public void DefaultShaderProperty(MaterialProperty prop, string label)
Parameters
|
Improve this Doc
View Source
DefaultShaderProperty(Rect, MaterialProperty, String)
Declaration
public void DefaultShaderProperty(Rect position, MaterialProperty prop, string label)
Parameters
|
Improve this Doc
View Source
DoubleSidedGIField()
Declaration
public bool DoubleSidedGIField()
Returns
|
Improve this Doc
View Source
EmissionEnabledProperty()
Declaration
public bool EmissionEnabledProperty()
Returns
|
Improve this Doc
View Source
EnableInstancingField()
Declaration
public bool EnableInstancingField()
Returns
|
Improve this Doc
View Source
EnableInstancingField(Rect)
Declaration
public void EnableInstancingField(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
|
Improve this Doc
View Source
EndAnimatedCheck()
Declaration
public void EndAnimatedCheck()
|
Improve this Doc
View Source
FixupEmissiveFlag(Color, MaterialGlobalIlluminationFlags)
Declaration
public static MaterialGlobalIlluminationFlags FixupEmissiveFlag(Color col, MaterialGlobalIlluminationFlags flags)
Parameters
Returns
|
Improve this Doc
View Source
FixupEmissiveFlag(Material)
Declaration
public static void FixupEmissiveFlag(Material mat)
Parameters
|
Improve this Doc
View Source
FloatProperty(String, String)
Declaration
[Obsolete("Use FloatProperty with MaterialProperty instead.")]
public float FloatProperty(string propertyName, string label)
Parameters
Returns
|
Improve this Doc
View Source
FloatProperty(MaterialProperty, String)
Declaration
public float FloatProperty(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
FloatProperty(Rect, MaterialProperty, String)
Declaration
public float FloatProperty(Rect position, MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
GetColor(String, out Boolean)
Declaration
[Obsolete("Use GetMaterialProperty instead.")]
public Color GetColor(string propertyName, out bool hasMixedValue)
Parameters
Returns
|
Improve this Doc
View Source
GetDefaultPropertyHeight(MaterialProperty)
Declaration
public static float GetDefaultPropertyHeight(MaterialProperty prop)
Parameters
Returns
|
Improve this Doc
View Source
GetFlexibleRectBetweenFieldAndRightEdge(Rect)
Declaration
public static Rect GetFlexibleRectBetweenFieldAndRightEdge(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Returns
|
Improve this Doc
View Source
GetFlexibleRectBetweenLabelAndField(Rect)
Declaration
public static Rect GetFlexibleRectBetweenLabelAndField(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Returns
|
Improve this Doc
View Source
GetFloat(String, out Boolean)
Declaration
[Obsolete("Use GetMaterialProperty instead.")]
public float GetFloat(string propertyName, out bool hasMixedValue)
Parameters
Returns
|
Improve this Doc
View Source
GetLeftAlignedFieldRect(Rect)
Declaration
public static Rect GetLeftAlignedFieldRect(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Returns
|
Improve this Doc
View Source
GetMaterialProperties(Object[])
Declaration
public static MaterialProperty[] GetMaterialProperties(Object[] mats)
Parameters
Type |
Name |
Description |
Object[] |
mats |
|
Returns
|
Improve this Doc
View Source
GetMaterialProperty(Object[], Int32)
Declaration
public static MaterialProperty GetMaterialProperty(Object[] mats, int propertyIndex)
Parameters
Type |
Name |
Description |
Object[] |
mats |
|
Int32 |
propertyIndex |
|
Returns
|
Improve this Doc
View Source
GetMaterialProperty(Object[], String)
Declaration
public static MaterialProperty GetMaterialProperty(Object[] mats, string name)
Parameters
Returns
|
Improve this Doc
View Source
GetPropertyHeight(MaterialProperty)
Declaration
public float GetPropertyHeight(MaterialProperty prop)
Parameters
Returns
|
Improve this Doc
View Source
GetPropertyHeight(MaterialProperty, String)
Declaration
public float GetPropertyHeight(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
GetRectAfterLabelWidth(Rect)
Declaration
public static Rect GetRectAfterLabelWidth(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Returns
|
Improve this Doc
View Source
GetRightAlignedFieldRect(Rect)
Declaration
public static Rect GetRightAlignedFieldRect(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
Returns
|
Improve this Doc
View Source
GetTexture(String, out Boolean)
Declaration
[Obsolete("Use GetMaterialProperty instead.")]
public Texture GetTexture(string propertyName, out bool hasMixedValue)
Parameters
Returns
|
Improve this Doc
View Source
GetTextureOffset(String, out Boolean, out Boolean)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public Vector2 GetTextureOffset(string propertyName, out bool hasMixedValueX, out bool hasMixedValueY)
Parameters
Returns
|
Improve this Doc
View Source
GetTexturePropertyCustomArea(Rect)
Declaration
public Rect GetTexturePropertyCustomArea(Rect position)
Parameters
Type |
Name |
Description |
Rect |
position |
|
Returns
|
Improve this Doc
View Source
GetTextureScale(String, out Boolean, out Boolean)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public Vector2 GetTextureScale(string propertyName, out bool hasMixedValueX, out bool hasMixedValueY)
Parameters
Returns
|
Improve this Doc
View Source
GetVector(String, out Boolean)
Declaration
[Obsolete("Use GetMaterialProperty instead.")]
public Vector4 GetVector(string propertyName, out bool hasMixedValue)
Parameters
Returns
|
Improve this Doc
View Source
HasPreviewGUI()
Declaration
public override sealed bool HasPreviewGUI()
Returns
Overrides
|
Improve this Doc
View Source
HelpBoxWithButton(GUIContent, GUIContent)
Declaration
public bool HelpBoxWithButton(GUIContent messageContent, GUIContent buttonContent)
Parameters
Returns
|
Improve this Doc
View Source
IsInstancingEnabled()
Declaration
public bool IsInstancingEnabled()
Returns
|
Improve this Doc
View Source
LightmapEmissionFlagsProperty(Int32, Boolean)
Declaration
public void LightmapEmissionFlagsProperty(int indent, bool enabled)
Parameters
|
Improve this Doc
View Source
LightmapEmissionProperty()
Declaration
public void LightmapEmissionProperty()
|
Improve this Doc
View Source
LightmapEmissionProperty(Int32)
Declaration
public void LightmapEmissionProperty(int labelIndent)
Parameters
Type |
Name |
Description |
Int32 |
labelIndent |
|
|
Improve this Doc
View Source
LightmapEmissionProperty(Rect, Int32)
Declaration
public void LightmapEmissionProperty(Rect position, int labelIndent)
Parameters
Type |
Name |
Description |
Rect |
position |
|
Int32 |
labelIndent |
|
|
Improve this Doc
View Source
OnDisable()
Declaration
public virtual void OnDisable()
|
Improve this Doc
View Source
OnEnable()
Declaration
public virtual void OnEnable()
|
Improve this Doc
View Source
Declaration
protected override void OnHeaderGUI()
Overrides
|
Improve this Doc
View Source
OnInspectorGUI()
Declaration
public override void OnInspectorGUI()
Overrides
|
Improve this Doc
View Source
OnInteractivePreviewGUI(Rect, GUIStyle)
Declaration
public override void OnInteractivePreviewGUI(Rect r, GUIStyle background)
Parameters
Overrides
|
Improve this Doc
View Source
OnPreviewGUI(Rect, GUIStyle)
Declaration
public override void OnPreviewGUI(Rect r, GUIStyle background)
Parameters
Overrides
|
Improve this Doc
View Source
OnPreviewSettings()
Declaration
public override void OnPreviewSettings()
Overrides
|
Improve this Doc
View Source
OnShaderChanged()
Declaration
protected virtual void OnShaderChanged()
|
Improve this Doc
View Source
PrepareMaterialPropertiesForAnimationMode(MaterialProperty[], Boolean)
Declaration
public static Renderer PrepareMaterialPropertiesForAnimationMode(MaterialProperty[] properties, bool isMaterialEditable)
Parameters
Returns
|
Improve this Doc
View Source
PropertiesChanged()
Declaration
public void PropertiesChanged()
|
Improve this Doc
View Source
PropertiesDefaultGUI(MaterialProperty[])
Declaration
public void PropertiesDefaultGUI(MaterialProperty[] props)
Parameters
|
Improve this Doc
View Source
PropertiesGUI()
Declaration
public bool PropertiesGUI()
Returns
|
Improve this Doc
View Source
RangeProperty(String, String, Single, Single)
Declaration
[Obsolete("Use RangeProperty with MaterialProperty instead.")]
public float RangeProperty(string propertyName, string label, float v2, float v3)
Parameters
Returns
|
Improve this Doc
View Source
RangeProperty(MaterialProperty, String)
Declaration
public float RangeProperty(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
RangeProperty(Rect, MaterialProperty, String)
Declaration
public float RangeProperty(Rect position, MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
RegisterPropertyChangeUndo(String)
Declaration
public void RegisterPropertyChangeUndo(string label)
Parameters
Type |
Name |
Description |
String |
label |
|
|
Improve this Doc
View Source
RenderQueueField()
Declaration
public void RenderQueueField()
|
Improve this Doc
View Source
RenderQueueField(Rect)
Declaration
public void RenderQueueField(Rect r)
Parameters
Type |
Name |
Description |
Rect |
r |
|
|
Improve this Doc
View Source
RenderStaticPreview(String, Object[], Int32, Int32)
Declaration
public override sealed Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
RequiresConstantRepaint()
Declaration
public override bool RequiresConstantRepaint()
Returns
Overrides
|
Improve this Doc
View Source
SetColor(String, Color)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetColor(string propertyName, Color value)
Parameters
|
Improve this Doc
View Source
SetDefaultGUIWidths()
Declaration
public void SetDefaultGUIWidths()
|
Improve this Doc
View Source
SetFloat(String, Single)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetFloat(string propertyName, float value)
Parameters
|
Improve this Doc
View Source
SetShader(Shader)
Declaration
public void SetShader(Shader shader)
Parameters
Type |
Name |
Description |
Shader |
shader |
|
|
Improve this Doc
View Source
SetShader(Shader, Boolean)
Declaration
public void SetShader(Shader newShader, bool registerUndo)
Parameters
|
Improve this Doc
View Source
SetTexture(String, Texture)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetTexture(string propertyName, Texture value)
Parameters
|
Improve this Doc
View Source
SetTextureOffset(String, Vector2, Int32)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetTextureOffset(string propertyName, Vector2 value, int coord)
Parameters
|
Improve this Doc
View Source
SetTextureScale(String, Vector2, Int32)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetTextureScale(string propertyName, Vector2 value, int coord)
Parameters
|
Improve this Doc
View Source
SetVector(String, Vector4)
Declaration
[Obsolete("Use MaterialProperty instead.")]
public void SetVector(string propertyName, Vector4 value)
Parameters
|
Improve this Doc
View Source
ShaderProperty(MaterialProperty, String)
Declaration
public void ShaderProperty(MaterialProperty prop, string label)
Parameters
|
Improve this Doc
View Source
ShaderProperty(MaterialProperty, String, Int32)
Declaration
public void ShaderProperty(MaterialProperty prop, string label, int labelIndent)
Parameters
|
Improve this Doc
View Source
ShaderProperty(MaterialProperty, GUIContent)
Declaration
public void ShaderProperty(MaterialProperty prop, GUIContent label)
Parameters
|
Improve this Doc
View Source
ShaderProperty(MaterialProperty, GUIContent, Int32)
Declaration
public void ShaderProperty(MaterialProperty prop, GUIContent label, int labelIndent)
Parameters
|
Improve this Doc
View Source
ShaderProperty(Rect, MaterialProperty, String)
Declaration
public void ShaderProperty(Rect position, MaterialProperty prop, string label)
Parameters
|
Improve this Doc
View Source
ShaderProperty(Rect, MaterialProperty, String, Int32)
Declaration
public void ShaderProperty(Rect position, MaterialProperty prop, string label, int labelIndent)
Parameters
|
Improve this Doc
View Source
ShaderProperty(Rect, MaterialProperty, GUIContent)
Declaration
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label)
Parameters
|
Improve this Doc
View Source
ShaderProperty(Rect, MaterialProperty, GUIContent, Int32)
Declaration
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label, int labelIndent)
Parameters
|
Improve this Doc
View Source
ShaderProperty(Shader, Int32)
Declaration
[Obsolete("Use ShaderProperty that takes MaterialProperty parameter instead.")]
public void ShaderProperty(Shader shader, int propertyIndex)
Parameters
Type |
Name |
Description |
Shader |
shader |
|
Int32 |
propertyIndex |
|
|
Improve this Doc
View Source
TextureCompatibilityWarning(MaterialProperty)
Declaration
public void TextureCompatibilityWarning(MaterialProperty prop)
Parameters
|
Improve this Doc
View Source
TextureProperty(String, String, ShaderUtil.ShaderPropertyTexDim)
Declaration
[Obsolete("Use TextureProperty with MaterialProperty instead.")]
public Texture TextureProperty(string propertyName, string label, ShaderUtil.ShaderPropertyTexDim texDim)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(String, String, ShaderUtil.ShaderPropertyTexDim, Boolean)
Declaration
[Obsolete("Use TextureProperty with MaterialProperty instead.")]
public Texture TextureProperty(string propertyName, string label, ShaderUtil.ShaderPropertyTexDim texDim, bool scaleOffset)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(MaterialProperty, String)
Declaration
public Texture TextureProperty(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(MaterialProperty, String, Boolean)
Declaration
public Texture TextureProperty(MaterialProperty prop, string label, bool scaleOffset)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(Rect, MaterialProperty, String)
Declaration
public Texture TextureProperty(Rect position, MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(Rect, MaterialProperty, String, Boolean)
Declaration
public Texture TextureProperty(Rect position, MaterialProperty prop, string label, bool scaleOffset)
Parameters
Returns
|
Improve this Doc
View Source
TextureProperty(Rect, MaterialProperty, String, String, Boolean)
Declaration
public Texture TextureProperty(Rect position, MaterialProperty prop, string label, string tooltip, bool scaleOffset)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertyMiniThumbnail(Rect, MaterialProperty, String, String)
Declaration
public Texture TexturePropertyMiniThumbnail(Rect position, MaterialProperty prop, string label, string tooltip)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertySingleLine(GUIContent, MaterialProperty)
Declaration
public Rect TexturePropertySingleLine(GUIContent label, MaterialProperty textureProp)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertySingleLine(GUIContent, MaterialProperty, MaterialProperty)
Declaration
public Rect TexturePropertySingleLine(GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertySingleLine(GUIContent, MaterialProperty, MaterialProperty, MaterialProperty)
Declaration
public Rect TexturePropertySingleLine(GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, MaterialProperty extraProperty2)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertyTwoLines(GUIContent, MaterialProperty, MaterialProperty, GUIContent, MaterialProperty)
Declaration
public Rect TexturePropertyTwoLines(GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, GUIContent label2, MaterialProperty extraProperty2)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertyWithHDRColor(GUIContent, MaterialProperty, MaterialProperty, Boolean)
Declaration
public Rect TexturePropertyWithHDRColor(GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, bool showAlpha)
Parameters
Returns
|
Improve this Doc
View Source
TexturePropertyWithHDRColor(GUIContent, MaterialProperty, MaterialProperty, ColorPickerHDRConfig, Boolean)
Declaration
[Obsolete("Use TexturePropertyWithHDRColor(GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, bool showAlpha)")]
public Rect TexturePropertyWithHDRColor(GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, ColorPickerHDRConfig hdrConfig, bool showAlpha)
Parameters
Returns
|
Improve this Doc
View Source
TextureScaleOffsetProperty(MaterialProperty)
Declaration
public void TextureScaleOffsetProperty(MaterialProperty property)
Parameters
|
Improve this Doc
View Source
TextureScaleOffsetProperty(Rect, MaterialProperty)
Declaration
public float TextureScaleOffsetProperty(Rect position, MaterialProperty property)
Parameters
Returns
|
Improve this Doc
View Source
TextureScaleOffsetProperty(Rect, MaterialProperty, Boolean)
Declaration
public float TextureScaleOffsetProperty(Rect position, MaterialProperty property, bool partOfTexturePropertyControl)
Parameters
Returns
|
Improve this Doc
View Source
TextureScaleOffsetProperty(Rect, Vector4)
Declaration
public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset)
Parameters
Type |
Name |
Description |
Rect |
position |
|
Vector4 |
scaleOffset |
|
Returns
|
Improve this Doc
View Source
TextureScaleOffsetProperty(Rect, Vector4, Boolean)
Declaration
public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl)
Parameters
Type |
Name |
Description |
Rect |
position |
|
Vector4 |
scaleOffset |
|
Boolean |
partOfTexturePropertyControl |
|
Returns
|
Improve this Doc
View Source
Declaration
public virtual void UndoRedoPerformed()
|
Improve this Doc
View Source
VectorProperty(String, String)
Declaration
[Obsolete("Use VectorProperty with MaterialProperty instead.")]
public Vector4 VectorProperty(string propertyName, string label)
Parameters
Returns
|
Improve this Doc
View Source
VectorProperty(MaterialProperty, String)
Declaration
public Vector4 VectorProperty(MaterialProperty prop, string label)
Parameters
Returns
|
Improve this Doc
View Source
VectorProperty(Rect, MaterialProperty, String)
Declaration
public Vector4 VectorProperty(Rect position, MaterialProperty prop, string label)
Parameters
Returns
Extension Methods