ScaleMeshEffect Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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).
public ref class ScaleMeshEffect : UnityEngine::UI::BaseMeshEffect
[UnityEngine.AddComponentMenu("Scripts/MRTK/Services/ScaleMeshEffect")]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/rendering/mrtk-standard-shader#ugui-support")]
[UnityEngine.RequireComponent(typeof(UnityEngine.RectTransform), typeof(UnityEngine.UI.Graphic))]
public class ScaleMeshEffect : UnityEngine.UI.BaseMeshEffect
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Services/ScaleMeshEffect")>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/rendering/mrtk-standard-shader#ugui-support")>]
[<UnityEngine.RequireComponent(typeof(UnityEngine.RectTransform), typeof(UnityEngine.UI.Graphic))>]
type ScaleMeshEffect = class
inherit BaseMeshEffect
Public Class ScaleMeshEffect
Inherits BaseMeshEffect
- Inheritance
-
UnityEngine.UI.BaseMeshEffectScaleMeshEffect
- Attributes
-
UnityEngine.AddComponentMenuAttribute UnityEngine.HelpURLAttribute UnityEngine.RequireComponentAttribute
Awake() |
Enforces the parent canvas uses UV channel attributes. |
Modify |
Stores scaling information into UV channel attributes during UI mesh construction. |
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 |