This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine.Sprites; | |
namespace UnityEngine.UI { | |
public class PreserveAspectEnvelopImage : Image { | |
protected override void OnPopulateMesh(VertexHelper toFill) { | |
if (type == Type.Simple && !useSpriteMesh && preserveAspect) { | |
GenerateSimpleSprite(toFill); | |
} else { | |
base.OnPopulateMesh(toFill); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine.Sprites; | |
namespace UnityEngine.UI { | |
public class InversedSlicedImage : Image { | |
private static readonly Vector2[] s_VertCache = new Vector2[4]; | |
private static readonly Vector2[] s_UVCache = new Vector2[4]; | |
protected override void OnPopulateMesh(VertexHelper toFill) { | |
if (type == Type.Sliced && hasBorder) { | |
GenerateInversedSlicedSprite(toFill); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER | |
using UnityEngine.U2D; | |
#endif | |
using Sprites = UnityEngine.Sprites; | |
#if UNITY_EDITOR |