UGUI—CanvasRenderer

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

示例

2222.png
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{
    public CanvasRenderer canvasRenderer;
    public Color color;
    public Rect clipRect;

    void OnGUI()
    {
        //设置颜色
        canvasRenderer.SetColor(color);
        //设置裁剪区域
        canvasRenderer.EnableRectClipping(clipRect);
    }
}

运行测试
111111.gif

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号