C# Class UnityEditor.MaterialEditor

Inheritance: Editor
显示文件 Open project: randomize/VimConfig Class Usage Examples

Private Properties

Property Type Description
CheckSetup void
ColorProperty Color
CreateCustomShaderGUI void
DetectShaderChanged void
DoPowerRangeProperty float
DoRenderPreview void
DoesPreviewAllowRotation bool
ExtraPropertyAfterTexture void
FloatProperty float
GetAssociatedRenderFromInspector UnityEngine.Renderer
GetColor Color
GetControlRectForSingleLine UnityEngine.Rect
GetFloat float
GetGlobalIlluminationInt int
GetPreviewType PreviewType
GetPropertyRect UnityEngine.Rect
GetTexture UnityEngine.Texture
GetTextureFieldHeight float
GetTextureOffset Vector2
GetTextureScale Vector2
GetVector Vector4
HandleRenderer void
HandleSkybox void
HasMultipleMixedShaderValues bool
Init void
IsMaterialEditor bool
OnAssetStoreInspectorGUI void
OnHeaderControlsGUI void
OnSceneDrag void
OnSelectedShaderPopup void
PreviewSettingsMenuButton bool
RangeProperty float
SetColor void
SetFloat void
SetTexture void
SetTextureOffset void
SetTextureScale void
SetVector void
ShaderPopup void
ShaderProperty void
ShaderPropertyInternal void
TextureProperty UnityEngine.Texture
TextureProperty UnityEngine.Texture
TexturePropertyBody UnityEngine.Texture
TextureScaleOffsetProperty Vector4
TextureValidator UnityEngine.Object
VectorProperty Vector4

Public Methods

Method Description
ApplyMaterialPropertyDrawers ( Material material ) : void
ApplyMaterialPropertyDrawers ( UnityEngine targets ) : void
Awake ( ) : void
BeginAnimatedCheck ( MaterialProperty prop ) : void
ColorProperty ( MaterialProperty prop, string label ) : Color
ColorProperty ( Rect position, MaterialProperty prop, string label ) : Color
DefaultPreviewGUI ( Rect r, GUIStyle background ) : void
DefaultPreviewSettingsGUI ( ) : void
DefaultShaderProperty ( MaterialProperty prop, string label ) : void
DefaultShaderProperty ( Rect position, MaterialProperty prop, string label ) : void
EndAnimatedCheck ( ) : void
FloatProperty ( MaterialProperty prop, string label ) : float
FloatProperty ( Rect position, MaterialProperty prop, string label ) : float
GetDefaultPropertyHeight ( MaterialProperty prop ) : float
GetFlexibleRectBetweenFieldAndRightEdge ( Rect r ) : Rect
GetFlexibleRectBetweenLabelAndField ( Rect r ) : Rect
GetLeftAlignedFieldRect ( Rect r ) : Rect
GetMaterialProperties ( UnityEngine mats ) : UnityEditor.MaterialProperty[]
GetMaterialProperty ( UnityEngine mats, int propertyIndex ) : MaterialProperty
GetMaterialProperty ( UnityEngine mats, string name ) : MaterialProperty
GetPropertyHeight ( MaterialProperty prop ) : float
GetPropertyHeight ( MaterialProperty prop, string label ) : float
GetRectAfterLabelWidth ( Rect r ) : Rect
GetRightAlignedFieldRect ( Rect r ) : Rect
GetTexturePropertyCustomArea ( Rect position ) : Rect
HasPreviewGUI ( ) : bool
HelpBoxWithButton ( GUIContent messageContent, GUIContent buttonContent ) : bool
LightmapEmissionProperty ( ) : void
LightmapEmissionProperty ( Rect position, int labelIndent ) : void
LightmapEmissionProperty ( int labelIndent ) : void
OnDisable ( ) : void
OnEnable ( ) : void
OnInspectorGUI ( ) : void
OnInteractivePreviewGUI ( Rect r, GUIStyle background ) : void
OnPreviewGUI ( Rect r, GUIStyle background ) : void
OnPreviewSettings ( ) : void
PrepareMaterialPropertiesForAnimationMode ( MaterialProperty properties, bool isMaterialEditable ) : Renderer
PropertiesChanged ( ) : void
PropertiesDefaultGUI ( MaterialProperty props ) : void
PropertiesGUI ( ) : bool
RangeProperty ( MaterialProperty prop, string label ) : float
RangeProperty ( Rect position, MaterialProperty prop, string label ) : float
RegisterPropertyChangeUndo ( string label ) : void
RenderStaticPreview ( string assetPath, UnityEngine subAssets, int width, int height ) : Texture2D
RequiresConstantRepaint ( ) : bool
SetDefaultGUIWidths ( ) : void
SetShader ( Shader shader ) : void
SetShader ( Shader newShader, bool registerUndo ) : void
ShaderProperty ( MaterialProperty prop, string label ) : void
ShaderProperty ( MaterialProperty prop, string label, int labelIndent ) : void
ShaderProperty ( Rect position, MaterialProperty prop, string label ) : void
ShaderProperty ( Rect position, MaterialProperty prop, string label, int labelIndent ) : void
TextureCompatibilityWarning ( MaterialProperty prop ) : void
TextureProperty ( MaterialProperty prop, string label ) : Texture
TextureProperty ( MaterialProperty prop, string label, bool scaleOffset ) : Texture
TextureProperty ( Rect position, MaterialProperty prop, string label ) : Texture
TextureProperty ( Rect position, MaterialProperty prop, string label, bool scaleOffset ) : Texture
TextureProperty ( Rect position, MaterialProperty prop, string label, string tooltip, bool scaleOffset ) : Texture
TexturePropertyMiniThumbnail ( Rect position, MaterialProperty prop, string label, string tooltip ) : Texture
TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp ) : Rect
TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1 ) : Rect
TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, MaterialProperty extraProperty2 ) : Rect
TexturePropertyTwoLines ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, GUIContent label2, MaterialProperty extraProperty2 ) : Rect
TexturePropertyWithHDRColor ( GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, ColorPickerHDRConfig hdrConfig, bool showAlpha ) : Rect
TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset ) : Vector4
TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl ) : Vector4
TextureScaleOffsetProperty ( Rect position, MaterialProperty property ) : float
TextureScaleOffsetProperty ( Rect position, MaterialProperty property, bool partOfTexturePropertyControl ) : float
TextureScaleOffsetProperty ( MaterialProperty property ) : void
UndoRedoPerformed ( ) : void
VectorProperty ( MaterialProperty prop, string label ) : Vector4
VectorProperty ( Rect position, MaterialProperty prop, string label ) : Vector4

Protected Methods

Method Description
OnHeaderGUI ( ) : void

Private Methods

Method Description
CheckSetup ( ) : void
ColorProperty ( string propertyName, string label ) : Color
CreateCustomShaderGUI ( Shader shader, string oldEditorName ) : void
DetectShaderChanged ( ) : void
DoPowerRangeProperty ( Rect position, MaterialProperty prop, string label, float power ) : float
DoRenderPreview ( ) : void
DoesPreviewAllowRotation ( PreviewType type ) : bool
ExtraPropertyAfterTexture ( Rect r, MaterialProperty property ) : void
FloatProperty ( string propertyName, string label ) : float
GetAssociatedRenderFromInspector ( ) : Renderer
GetColor ( string propertyName, bool &hasMixedValue ) : Color
GetControlRectForSingleLine ( ) : Rect
GetFloat ( string propertyName, bool &hasMixedValue ) : float
GetGlobalIlluminationInt ( MaterialGlobalIlluminationFlags flags ) : int
GetPreviewType ( Material mat ) : PreviewType
GetPropertyRect ( MaterialProperty prop, string label, bool ignoreDrawer ) : Rect
GetTexture ( string propertyName, bool &hasMixedValue ) : Texture
GetTextureFieldHeight ( ) : float
GetTextureOffset ( string propertyName, bool &hasMixedValueX, bool &hasMixedValueY ) : Vector2
GetTextureScale ( string propertyName, bool &hasMixedValueX, bool &hasMixedValueY ) : Vector2
GetVector ( string propertyName, bool &hasMixedValue ) : Vector4
HandleRenderer ( Renderer r, int materialIndex, Event evt ) : void
HandleSkybox ( GameObject go, Event evt ) : void
HasMultipleMixedShaderValues ( ) : bool
Init ( ) : void
IsMaterialEditor ( string customEditorName ) : bool
OnAssetStoreInspectorGUI ( ) : void
OnHeaderControlsGUI ( ) : void
OnSceneDrag ( SceneView sceneView ) : void
OnSelectedShaderPopup ( string command, Shader shader ) : void
PreviewSettingsMenuButton ( Rect &buttonRect ) : bool
RangeProperty ( string propertyName, string label, float v2, float v3 ) : float
SetColor ( string propertyName, Color value ) : void
SetFloat ( string propertyName, float value ) : void
SetTexture ( string propertyName, Texture value ) : void
SetTextureOffset ( string propertyName, Vector2 value, int coord ) : void
SetTextureScale ( string propertyName, Vector2 value, int coord ) : void
SetVector ( string propertyName, Vector4 value ) : void
ShaderPopup ( GUIStyle style ) : void
ShaderProperty ( Shader shader, int propertyIndex ) : void
ShaderPropertyInternal ( Rect position, MaterialProperty prop, string label ) : void
TextureProperty ( string propertyName, string label, ShaderUtil texDim ) : Texture
TextureProperty ( string propertyName, string label, ShaderUtil texDim, bool scaleOffset ) : Texture
TexturePropertyBody ( Rect position, MaterialProperty prop ) : Texture
TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset, int mixedValueMask, bool partOfTexturePropertyControl ) : Vector4
TextureValidator ( UnityEngine references, System objType, UnityEditor.SerializedProperty property ) : Object
VectorProperty ( string propertyName, string label ) : Vector4

Method Details

ApplyMaterialPropertyDrawers() public static method

public static ApplyMaterialPropertyDrawers ( Material material ) : void
material UnityEngine.Material
return void

ApplyMaterialPropertyDrawers() public static method

public static ApplyMaterialPropertyDrawers ( UnityEngine targets ) : void
targets UnityEngine
return void

Awake() public method

public Awake ( ) : void
return void

BeginAnimatedCheck() public method

public BeginAnimatedCheck ( MaterialProperty prop ) : void
prop MaterialProperty
return void

ColorProperty() public method

public ColorProperty ( MaterialProperty prop, string label ) : Color
prop MaterialProperty
label string
return Color

ColorProperty() public method

public ColorProperty ( Rect position, MaterialProperty prop, string label ) : Color
position UnityEngine.Rect
prop MaterialProperty
label string
return Color

DefaultPreviewGUI() public method

public DefaultPreviewGUI ( Rect r, GUIStyle background ) : void
r UnityEngine.Rect
background UnityEngine.GUIStyle
return void

DefaultPreviewSettingsGUI() public method

public DefaultPreviewSettingsGUI ( ) : void
return void

DefaultShaderProperty() public method

public DefaultShaderProperty ( MaterialProperty prop, string label ) : void
prop MaterialProperty
label string
return void

DefaultShaderProperty() public method

public DefaultShaderProperty ( Rect position, MaterialProperty prop, string label ) : void
position UnityEngine.Rect
prop MaterialProperty
label string
return void

EndAnimatedCheck() public method

public EndAnimatedCheck ( ) : void
return void

FloatProperty() public method

public FloatProperty ( MaterialProperty prop, string label ) : float
prop MaterialProperty
label string
return float

FloatProperty() public method

public FloatProperty ( Rect position, MaterialProperty prop, string label ) : float
position UnityEngine.Rect
prop MaterialProperty
label string
return float

GetDefaultPropertyHeight() public static method

public static GetDefaultPropertyHeight ( MaterialProperty prop ) : float
prop MaterialProperty
return float

GetFlexibleRectBetweenFieldAndRightEdge() public static method

public static GetFlexibleRectBetweenFieldAndRightEdge ( Rect r ) : Rect
r UnityEngine.Rect
return UnityEngine.Rect

GetFlexibleRectBetweenLabelAndField() public static method

public static GetFlexibleRectBetweenLabelAndField ( Rect r ) : Rect
r UnityEngine.Rect
return UnityEngine.Rect

GetLeftAlignedFieldRect() public static method

public static GetLeftAlignedFieldRect ( Rect r ) : Rect
r UnityEngine.Rect
return UnityEngine.Rect

GetMaterialProperties() public static method

public static GetMaterialProperties ( UnityEngine mats ) : UnityEditor.MaterialProperty[]
mats UnityEngine
return UnityEditor.MaterialProperty[]

GetMaterialProperty() public static method

public static GetMaterialProperty ( UnityEngine mats, int propertyIndex ) : MaterialProperty
mats UnityEngine
propertyIndex int
return MaterialProperty

GetMaterialProperty() public static method

public static GetMaterialProperty ( UnityEngine mats, string name ) : MaterialProperty
mats UnityEngine
name string
return MaterialProperty

GetPropertyHeight() public method

public GetPropertyHeight ( MaterialProperty prop ) : float
prop MaterialProperty
return float

GetPropertyHeight() public method

public GetPropertyHeight ( MaterialProperty prop, string label ) : float
prop MaterialProperty
label string
return float

GetRectAfterLabelWidth() public static method

public static GetRectAfterLabelWidth ( Rect r ) : Rect
r UnityEngine.Rect
return UnityEngine.Rect

GetRightAlignedFieldRect() public static method

public static GetRightAlignedFieldRect ( Rect r ) : Rect
r UnityEngine.Rect
return UnityEngine.Rect

GetTexturePropertyCustomArea() public method

public GetTexturePropertyCustomArea ( Rect position ) : Rect
position UnityEngine.Rect
return UnityEngine.Rect

HasPreviewGUI() public final method

public final HasPreviewGUI ( ) : bool
return bool

HelpBoxWithButton() public method

public HelpBoxWithButton ( GUIContent messageContent, GUIContent buttonContent ) : bool
messageContent UnityEngine.GUIContent
buttonContent UnityEngine.GUIContent
return bool

LightmapEmissionProperty() public method

public LightmapEmissionProperty ( ) : void
return void

LightmapEmissionProperty() public method

public LightmapEmissionProperty ( Rect position, int labelIndent ) : void
position UnityEngine.Rect
labelIndent int
return void

LightmapEmissionProperty() public method

public LightmapEmissionProperty ( int labelIndent ) : void
labelIndent int
return void

OnDisable() public method

public OnDisable ( ) : void
return void

OnEnable() public method

public OnEnable ( ) : void
return void

OnHeaderGUI() protected method

protected OnHeaderGUI ( ) : void
return void

OnInspectorGUI() public method

public OnInspectorGUI ( ) : void
return void

OnInteractivePreviewGUI() public method

public OnInteractivePreviewGUI ( Rect r, GUIStyle background ) : void
r UnityEngine.Rect
background UnityEngine.GUIStyle
return void

OnPreviewGUI() public method

public OnPreviewGUI ( Rect r, GUIStyle background ) : void
r UnityEngine.Rect
background UnityEngine.GUIStyle
return void

OnPreviewSettings() public method

public OnPreviewSettings ( ) : void
return void

PrepareMaterialPropertiesForAnimationMode() public static method

public static PrepareMaterialPropertiesForAnimationMode ( MaterialProperty properties, bool isMaterialEditable ) : Renderer
properties MaterialProperty
isMaterialEditable bool
return UnityEngine.Renderer

PropertiesChanged() public method

public PropertiesChanged ( ) : void
return void

PropertiesDefaultGUI() public method

public PropertiesDefaultGUI ( MaterialProperty props ) : void
props MaterialProperty
return void

PropertiesGUI() public method

public PropertiesGUI ( ) : bool
return bool

RangeProperty() public method

public RangeProperty ( MaterialProperty prop, string label ) : float
prop MaterialProperty
label string
return float

RangeProperty() public method

public RangeProperty ( Rect position, MaterialProperty prop, string label ) : float
position UnityEngine.Rect
prop MaterialProperty
label string
return float

RegisterPropertyChangeUndo() public method

public RegisterPropertyChangeUndo ( string label ) : void
label string
return void

RenderStaticPreview() public final method

public final RenderStaticPreview ( string assetPath, UnityEngine subAssets, int width, int height ) : Texture2D
assetPath string
subAssets UnityEngine
width int
height int
return UnityEngine.Texture2D

RequiresConstantRepaint() public method

public RequiresConstantRepaint ( ) : bool
return bool

SetDefaultGUIWidths() public method

public SetDefaultGUIWidths ( ) : void
return void

SetShader() public method

public SetShader ( Shader shader ) : void
shader UnityEngine.Shader
return void

SetShader() public method

public SetShader ( Shader newShader, bool registerUndo ) : void
newShader UnityEngine.Shader
registerUndo bool
return void

ShaderProperty() public method

public ShaderProperty ( MaterialProperty prop, string label ) : void
prop MaterialProperty
label string
return void

ShaderProperty() public method

public ShaderProperty ( MaterialProperty prop, string label, int labelIndent ) : void
prop MaterialProperty
label string
labelIndent int
return void

ShaderProperty() public method

public ShaderProperty ( Rect position, MaterialProperty prop, string label ) : void
position UnityEngine.Rect
prop MaterialProperty
label string
return void

ShaderProperty() public method

public ShaderProperty ( Rect position, MaterialProperty prop, string label, int labelIndent ) : void
position UnityEngine.Rect
prop MaterialProperty
label string
labelIndent int
return void

TextureCompatibilityWarning() public method

public TextureCompatibilityWarning ( MaterialProperty prop ) : void
prop MaterialProperty
return void

TextureProperty() public method

public TextureProperty ( MaterialProperty prop, string label ) : Texture
prop MaterialProperty
label string
return UnityEngine.Texture

TextureProperty() public method

public TextureProperty ( MaterialProperty prop, string label, bool scaleOffset ) : Texture
prop MaterialProperty
label string
scaleOffset bool
return UnityEngine.Texture

TextureProperty() public method

public TextureProperty ( Rect position, MaterialProperty prop, string label ) : Texture
position UnityEngine.Rect
prop MaterialProperty
label string
return UnityEngine.Texture

TextureProperty() public method

public TextureProperty ( Rect position, MaterialProperty prop, string label, bool scaleOffset ) : Texture
position UnityEngine.Rect
prop MaterialProperty
label string
scaleOffset bool
return UnityEngine.Texture

TextureProperty() public method

public TextureProperty ( Rect position, MaterialProperty prop, string label, string tooltip, bool scaleOffset ) : Texture
position UnityEngine.Rect
prop MaterialProperty
label string
tooltip string
scaleOffset bool
return UnityEngine.Texture

TexturePropertyMiniThumbnail() public method

public TexturePropertyMiniThumbnail ( Rect position, MaterialProperty prop, string label, string tooltip ) : Texture
position UnityEngine.Rect
prop MaterialProperty
label string
tooltip string
return UnityEngine.Texture

TexturePropertySingleLine() public method

public TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
return UnityEngine.Rect

TexturePropertySingleLine() public method

public TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1 ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
extraProperty1 MaterialProperty
return UnityEngine.Rect

TexturePropertySingleLine() public method

public TexturePropertySingleLine ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, MaterialProperty extraProperty2 ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
extraProperty1 MaterialProperty
extraProperty2 MaterialProperty
return UnityEngine.Rect

TexturePropertyTwoLines() public method

public TexturePropertyTwoLines ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, GUIContent label2, MaterialProperty extraProperty2 ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
extraProperty1 MaterialProperty
label2 UnityEngine.GUIContent
extraProperty2 MaterialProperty
return UnityEngine.Rect

TexturePropertyWithHDRColor() public method

public TexturePropertyWithHDRColor ( GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, ColorPickerHDRConfig hdrConfig, bool showAlpha ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
colorProperty MaterialProperty
hdrConfig ColorPickerHDRConfig
showAlpha bool
return UnityEngine.Rect

TextureScaleOffsetProperty() public static method

public static TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset ) : Vector4
position UnityEngine.Rect
scaleOffset Vector4
return Vector4

TextureScaleOffsetProperty() public static method

public static TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl ) : Vector4
position UnityEngine.Rect
scaleOffset Vector4
partOfTexturePropertyControl bool
return Vector4

TextureScaleOffsetProperty() public method

public TextureScaleOffsetProperty ( Rect position, MaterialProperty property ) : float
position UnityEngine.Rect
property MaterialProperty
return float

TextureScaleOffsetProperty() public method

public TextureScaleOffsetProperty ( Rect position, MaterialProperty property, bool partOfTexturePropertyControl ) : float
position UnityEngine.Rect
property MaterialProperty
partOfTexturePropertyControl bool
return float

TextureScaleOffsetProperty() public method

public TextureScaleOffsetProperty ( MaterialProperty property ) : void
property MaterialProperty
return void

UndoRedoPerformed() public method

public UndoRedoPerformed ( ) : void
return void

VectorProperty() public method

public VectorProperty ( MaterialProperty prop, string label ) : Vector4
prop MaterialProperty
label string
return Vector4

VectorProperty() public method

public VectorProperty ( Rect position, MaterialProperty prop, string label ) : Vector4
position UnityEngine.Rect
prop MaterialProperty
label string
return Vector4