根据官方文档翻译
Canvas Group可用于从一个地方控制整个UI元素组的某些方面,而无需分别处理它们。 Canvas组的属性会影响它所在的GameObject以及所有子对象。
Alpha:该组中UI元素的不透明度。值介于0和1之间,其中0完全透明,1完全不透明。 请注意,元素也保留其自己的透明度,所以Canvas Group Alpha和各个UI元素的Alpha值相互成倍增加。
Interactable:确定该组件是否能接收输入
Block Raycasts:Will this component act as a collider for Raycasts? You will need to call the RayCast function on the graphic raycaster attached to the Canvas. This does not apply to Physics.Raycast.
Ignore Parent Groups:Will this group also be affected by the settings in Canvas Group components further up in the Game Object hierarchy, or will it ignore those and hence override them?
应用:
通过在Window的GameObject上添加一个Canvas Group并控制其Alpha属性来淡入或淡出整个窗口。
通过将Canvas组添加到父GameObject并将其Interactable属性设置为false,从而使一组控件不可交互(“变灰”)。
通过将Canvas Group组件放置在元素或其父项之一上并将其Block Blockcast属性设置为false,使一个或多个UI元素不会阻止鼠标事件。