ScaleMeshEffect Class

Definition

On Unity UI components the unity_ObjectToWorld matrix is not the transformation matrix of the local transform the Graphic component lives on, but that of its parent Canvas. Many MRTK/Standard shader effects require object scale to be known. To solve this issue the ScaleMeshEffect will store scaling information into UV channel attributes during UI mesh construction. Ideally we would store the scale in one attribute but UGUI only supports two scalers per attribute (even in the tangent attribute).

C++
public ref class ScaleMeshEffect : UnityEngine::UI::BaseMeshEffect
Inheritance
UnityEngine.UI.BaseMeshEffect
ScaleMeshEffect
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.HelpURLAttribute UnityEngine.RequireComponentAttribute

Constructors

Methods

Awake()

Enforces the parent canvas uses UV channel attributes.

ModifyMesh(VertexHelper)

Stores scaling information into UV channel attributes during UI mesh construction.

Applies to

Produit Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0