UGUI—CanvasRenderer

作者:追风剑情 发布于:2019-10-10 11:51 分类:Unity3d

示例

2222.png
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Test : MonoBehaviour
  6. {
  7. public CanvasRenderer canvasRenderer;
  8. public Color color;
  9. public Rect clipRect;
  10.  
  11. void OnGUI()
  12. {
  13. //设置颜色
  14. canvasRenderer.SetColor(color);
  15. //设置裁剪区域
  16. canvasRenderer.EnableRectClipping(clipRect);
  17. }
  18. }

运行测试
111111.gif

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号