UnityEditor.MaterialEditor.TextureScaleOffsetProperty C# (CSharp) Method

TextureScaleOffsetProperty() public static method

public static TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset ) : Vector4
position UnityEngine.Rect
scaleOffset Vector4
return Vector4
        public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset)
        {
            return TextureScaleOffsetProperty(position, scaleOffset, 0, false);
        }

Same methods

MaterialEditor::TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl ) : Vector4
MaterialEditor::TextureScaleOffsetProperty ( Rect position, Vector4 scaleOffset, int mixedValueMask, bool partOfTexturePropertyControl ) : Vector4
MaterialEditor::TextureScaleOffsetProperty ( Rect position, MaterialProperty property ) : float
MaterialEditor::TextureScaleOffsetProperty ( Rect position, MaterialProperty property, bool partOfTexturePropertyControl ) : float
MaterialEditor::TextureScaleOffsetProperty ( MaterialProperty property ) : void

Usage Example

示例#1
0
    public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
    {
        FindProperties (props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly

        // Use default labelWidth
        EditorGUIUtility.labelWidth = 0f;

        // Detect any changes to the material
        EditorGUI.BeginChangeCheck();
        {
            GUILayout.Label (Styles.material0Header, EditorStyles.boldLabel);

            // Texture
            materialEditor.TexturePropertySingleLine (Styles.albedo, albedoMap);
            materialEditor.TexturePropertySingleLine (Styles.specular, specularMap);
            materialEditor.TexturePropertySingleLine (Styles.normal, bumpMap);
            materialEditor.TextureScaleOffsetProperty (albedoMap);

            GUILayout.Label (Styles.maskHeader, EditorStyles.boldLabel);

            materialEditor.TexturePropertySingleLine (Styles.blendMask, blendMask);
            materialEditor.TextureScaleOffsetProperty (blendMask);

            GUILayout.Label (Styles.material1Header, EditorStyles.boldLabel);

            materialEditor.TexturePropertySingleLine (Styles.albedo, albedoMap2);
            materialEditor.TexturePropertySingleLine (Styles.specular, specularMap2);
            materialEditor.TexturePropertySingleLine (Styles.normal, bumpMap2);
            materialEditor.TextureScaleOffsetProperty (albedoMap2);
        }
    }
All Usage Examples Of UnityEditor.MaterialEditor::TextureScaleOffsetProperty
MaterialEditor