UnityEngine.Material.GetTextureScale C# (CSharp) Method

GetTextureScale() public method

Gets the placement scale of texture propertyName.

public GetTextureScale ( string propertyName ) : Vector2
propertyName string The name of the property.
return Vector2
        public Vector2 GetTextureScale(string propertyName)
        {
            Vector4 vector;
            Internal_GetTextureScaleAndOffset(this, propertyName, out vector);
            return new Vector2(vector.x, vector.y);
        }

Usage Example

コード例 #1
0
        protected override void Init()
        {
            if (null == m_target)
            {
                return;
            }
            // end if
            var renderer = m_target.GetComponent <Renderer>();

            if (null != renderer)
            {
                m_Material = renderer.material;
            }
            // end if
            if (null == m_Material)
            {
                return;
            }
            // end if
            if (!string.IsNullOrEmpty(m_property))
            {
                m_beginTiling = m_Material.GetTextureScale(m_property);
            }
            else if (-1 != m_propertyID)
            {
                m_beginTiling = m_Material.GetTextureScale(m_propertyID);
            } // end if
        }
All Usage Examples Of UnityEngine.Material::GetTextureScale