当前位置: 首页 > news >正文

网站建站什么目录天津站内关键词优化

网站建站什么目录,天津站内关键词优化,注册公司流程流程图,wordpress的php.ini在哪Unity把UGUI再World模式下显示到相机最前方 通过脚本修改Shader 再VR里有时候要把3D的UI显示到相机最前方,加个UI相机会坏事,可以通过修改unity_GUIZTestMode来解决。 测试用例 测试用例如下: 场景包含一个红色的盒子,一个UI…

Unity把UGUI再World模式下显示到相机最前方

通过脚本修改Shader

再VR里有时候要把3D的UI显示到相机最前方,加个UI相机会坏事,可以通过修改unity_GUIZTestMode来解决。

测试用例

测试用例如下:
在这里插入图片描述
场景包含一个红色的盒子,一个UI里含有这些元素
在这里插入图片描述

在这里插入图片描述
我们在UI根挂上运行脚本WorldSpaceOverlayUI.cs

脚本如下:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;[ExecuteInEditMode] //Disable if you don't care about previewing outside of play mode
public class WorldSpaceOverlayUI : MonoBehaviour
{private const string shaderTestMode = "unity_GUIZTestMode"; //The magic property we need to set[SerializeField] UnityEngine.Rendering.CompareFunction desiredUIComparison = UnityEngine.Rendering.CompareFunction.Always; //If you want to try out other effects[Tooltip("Set to blank to automatically populate from the child UI elements")][SerializeField] Graphic[] uiGraphicsToApplyTo;[Tooltip("Set to blank to automatically populate from the child UI elements")][SerializeField] TextMeshProUGUI[] uiTextsToApplyTo;//Allows us to reuse materialsprivate Dictionary<Material, Material> materialMappings = new Dictionary<Material, Material>();protected virtual void Start(){if (uiGraphicsToApplyTo.Length == 0){uiGraphicsToApplyTo = gameObject.GetComponentsInChildren<Graphic>();}if (uiTextsToApplyTo.Length == 0){uiTextsToApplyTo = gameObject.GetComponentsInChildren<TextMeshProUGUI>();}foreach (var graphic in uiGraphicsToApplyTo){Material material = graphic.materialForRendering;if (material == null){Debug.LogError($"{nameof(WorldSpaceOverlayUI)}: skipping target without material {graphic.name}.{graphic.GetType().Name}");continue;}if (!materialMappings.TryGetValue(material, out Material materialCopy)){materialCopy = new Material(material);materialMappings.Add(material, materialCopy);}materialCopy.SetInt(shaderTestMode, (int)desiredUIComparison);graphic.material = materialCopy;}foreach (var text in uiTextsToApplyTo){Material material = text.fontMaterial;if (material == null){Debug.LogError($"{nameof(WorldSpaceOverlayUI)}: skipping target without material {text.name}.{text.GetType().Name}");continue;}if (!materialMappings.TryGetValue(material, out Material materialCopy)){materialCopy = new Material(material);materialMappings.Add(material, materialCopy);}materialCopy.SetInt(shaderTestMode, (int)desiredUIComparison);text.fontMaterial = materialCopy;}}
}

在这里插入图片描述

引用
https://discussions.unity.com/t/world-space-canvas-on-top-of-everything/128165/14

http://www.yidumall.com/news/82575.html

相关文章:

  • bbs网站设计模板网络营销服务工具
  • 为什么做这个网站项目指数型基金
  • 上海营销型网站建设公司企业网页设计制作
  • 哈尔滨建设银行招聘信息网网站优化哪家好
  • wordpress无法安装500文明seo
  • 做企业网站有什么用济南网站运营公司
  • 政府网站模板修改搜索引擎大全网址
  • 常用网站域名郑州网站建设最便宜
  • 中国核工业第五建设有限公司招聘seo诊断分析报告
  • 网站建设云服务器与虚拟主机网络服务包括哪些内容
  • 做外贸网站放在中国好还是美国好seo推广教程视频
  • 一个服务器可以放多少网站网络营销手段
  • 手机网站导航页金戈西地那非片
  • 广西短视频运营是aso优化平台有哪些
  • dnf做代练哪个网站好点seo对网络推广的作用是什么?
  • html5网站制作培训小熊猫seo博客
  • 网页设计有啥教程聊城网站seo
  • 珠海建站网站微信视频号可以推广吗
  • 做微商在哪个网站打广告好宁波网站推广运营公司
  • 怎么修改网站上传附件大小今天发生的重大新闻内容
  • wordpress文章出问题宁波优化推广选哪家
  • 苗木企业网站建设源代码 园林网站源码程序 苗圃花卉网站制作源码广州seo营销培训
  • 政府网站策划书免费的关键词优化工具
  • 网站搬家怎么做谷歌seo网络公司
  • 做的网站手机打不开怎么回事培训机构还能开吗
  • 沈阳开发网站的地方南京谷歌推广
  • 所有网站302跳转百度广州网站排名专业乐云seo
  • 中国十大公司排行榜江北关键词优化排名seo
  • asp作业做购物网站代码企业网站设计方案
  • 老网站做成适合手机端的网站怎么做最好看免费观看高清大全