UnityEditor.ProceduralMaterialInspector.OffsetScaleGUI C# (CSharp) Method

OffsetScaleGUI() protected method

protected OffsetScaleGUI ( ProceduralMaterial material ) : void
material UnityEngine.ProceduralMaterial
return void
        protected void OffsetScaleGUI(ProceduralMaterial material)
        {
            if ((m_Importer != null) && (base.targets.Length <= 1))
            {
                Vector2 materialScale = m_Importer.GetMaterialScale(material);
                Vector2 materialOffset = m_Importer.GetMaterialOffset(material);
                Vector4 scaleOffset = new Vector4(materialScale.x, materialScale.y, materialOffset.x, materialOffset.y);
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.Space(10f);
                Rect position = GUILayoutUtility.GetRect(100f, 10000f, (float) 32f, (float) 32f);
                GUILayout.EndHorizontal();
                EditorGUI.BeginChangeCheck();
                scaleOffset = MaterialEditor.TextureScaleOffsetProperty(position, scaleOffset);
                if (EditorGUI.EndChangeCheck())
                {
                    this.RecordForUndo(material, m_Importer, "Modify " + material.name + "'s Tiling/Offset");
                    m_Importer.SetMaterialScale(material, new Vector2(scaleOffset.x, scaleOffset.y));
                    m_Importer.SetMaterialOffset(material, new Vector2(scaleOffset.z, scaleOffset.w));
                }
            }
        }