示例#1
0
    public void SetMaskTexture(string maskTex)
    {
        Texture2D maskTexture = null;

        if (!string.IsNullOrEmpty(maskTex))
        {
            maskTexture = IconManager.Instance.GetIcon(maskTex);
        }

        Material mat = ezGuiRoot.renderer.material;

        if (mat.HasProperty("_OccluderTex"))
        {
            mat.SetTexture("_OccluderTex", maskTexture);
            mat.SetFloat("_Occluder", maskTexture == null ? 0.0f : 1.0f);
        }
        ezGuiRoot.SetMaterial(mat);
    }