Unity3D技术之脚本属性 script ponentMenu (“Transform/Follow Transform”) // CSharp [ponentMenu(“Transform/Follow Transform”)] Unity3D 以下是具体说明(部分无关紧要的不翻译): ponentMenu(函数) ponents”菜单途径添加脚本(如果不使用 ponents->Scripts下添加)。注意需restart起效,文章出处【狗刨学习网】。 ContextMenu 允许为脚本增加一组命令,该属性标记在函数上,而且必须是non-static函数。 假设你为一个脚本move增加了一个ContextMenu属性的方法Do somethine,。这个move脚本attach在一个user身上。那么你选中user时,ponent右击,就会发现一组命令,点击打印。 这个属性一个有用之处是自动初始化。 ImageEffectOpaque Any Image Effect with this attribute will be rendered after opaque geometry but before transparent geometry. This allows for effects which extensively use the depth buffer (SSAO ect) to only affect opaque pixels. This Attribute can be used to reduce the amount of visual artifacts in a scene with post processing. ImageEffectTransformsToLDR When using HDR rendering it can sometime be desirable to switch to LDR rendering during ImageEffect rendering. Using this Attribute on an image effect will cause the destination buffer to be an LDR buffer, and switch the rest of the Image Effect pipeline into LDR mode. It is the responsibility of the Image Effect that this Attribute is associated to ensure that the output is in the LDR range. ExecuteInEditMode 默认脚本组件仅在play mode下执行。增加这组属性后,脚本的callback functions在eidtor下亦可执行。注意,调用频率不同