HideFlags

转载自:http://game.ceeger.com/Script/Enumerations/HideFlags/HideFlags.html

HideFlags 隐藏标识

Enumeration

Bit mask that controls object destruction and visibility in inspectors

控件物体的位蒙版,在检视面板销毁和可见。

Values

  • The object will not appear in the hierarchy and will not show up in the project view if it is stored in an asset
    该物体将不会出现在层级面板(hierarchy)并且如果他保存在一个资源中,不显示在项目视图。 
  • It is not possible to view it in the inspector
    它将无法在检视面板中查看。 
  • The object will not be saved to the scene. It will not be destroyed when a new scene is loaded.
    该物体将不能保存到场景。当一个新的场景被加载,它也不会被销毁。 
  • The object is not be editable in the inspector
    物体在检视面板不可编辑。 
  • A combination of not shown in the hierarchy and not saved to to scenes.
    不能显示在层级面板并且不能保存到场景。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的U3D镜像模糊特效代码,可以将其添加到摄像机上: ```csharp using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class MirrorBlurEffect : MonoBehaviour { public Shader mirrorBlurShader; [Range(0, 10)] public float blurSize = 1.0f; [Range(0, 1)] public float mirrorIntensity = 0.5f; private Material mirrorBlurMaterial; private Camera mirrorCamera; private RenderTexture mirrorTexture; private void Start() { mirrorCamera = new GameObject("Mirror Camera").AddComponent<Camera>(); mirrorCamera.enabled = false; } private void OnRenderImage(RenderTexture source, RenderTexture destination) { if (mirrorBlurMaterial == null) { mirrorBlurMaterial = new Material(mirrorBlurShader); mirrorBlurMaterial.hideFlags = HideFlags.HideAndDontSave; } if (mirrorTexture == null || mirrorTexture.width != source.width || mirrorTexture.height != source.height) { if (mirrorTexture != null) DestroyImmediate(mirrorTexture); mirrorTexture = new RenderTexture(source.width, source.height, 0); mirrorTexture.hideFlags = HideFlags.HideAndDontSave; } mirrorCamera.CopyFrom(GetComponent<Camera>()); mirrorCamera.transform.SetPositionAndRotation(transform.position, transform.rotation * Quaternion.Euler(0, 180, 0)); mirrorCamera.Render(); mirrorBlurMaterial.SetFloat("_BlurSize", blurSize); mirrorBlurMaterial.SetFloat("_MirrorIntensity", mirrorIntensity); mirrorBlurMaterial.SetTexture("_MirrorTex", mirrorTexture); Graphics.Blit(source, destination, mirrorBlurMaterial); } private void OnDisable() { if (mirrorBlurMaterial != null) DestroyImmediate(mirrorBlurMaterial); if (mirrorTexture != null) DestroyImmediate(mirrorTexture); if (mirrorCamera != null) DestroyImmediate(mirrorCamera.gameObject); } } ``` 使用方法: 1. 将脚本添加到摄像机上。 2. 在Inspector窗口中设置Shader和其他参数。 3. 运行游戏,即可看到镜像模糊效果。 注意事项: 1. 该脚本需要在摄像机上执行,否则无法生成镜像。 2. Shader需要支持镜像模糊效果。 3. 在使用该脚本时,建议将Camera的Clear Flags设置为Solid Color,并将背景色设置为黑色,以避免出现不必要的镜像。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值