意见反馈 修改细节
This commit is contained in:
1 parent
1c712ff7d5
commit
dd08f916eb
41 files changed
+7043
-1134
No files matched your search
@@ -31,6 +31,19 @@ public class ImageWithRoundedCorners : MonoBehaviour {
|
||||
var rect = ((RectTransform)transform).rect;
|
||||
material.SetVector(Props, new Vector4(rect.width, rect.height, radius * 2, 0));
|
||||
if (gameObject.GetComponent<Image>() != null)
|
||||
{
|
||||
gameObject.GetComponent<Image>().material = material;
|
||||
//gameObject.GetComponent<Image>().sprite = null;
|
||||
}
|
||||
else if (gameObject.GetComponent<RawImage>() != null)
|
||||
{
|
||||
gameObject.GetComponent<RawImage>().material = material;
|
||||
}
|
||||
}
|
||||
public void Refresh(Vector2 r)
|
||||
{
|
||||
material.SetVector(Props, new Vector4(r.x, r.y, radius * 2, 0));
|
||||
if (gameObject.GetComponent<Image>() != null)
|
||||
{
|
||||
gameObject.GetComponent<Image>().material = material;
|
||||
gameObject.GetComponent<Image>().sprite = null;
|
||||
|
||||
Reference in new issue
Block a user