# SCanvasGroup

**成员** 5

|      |                                           |                                                                         |
| ---- | ----------------------------------------- | ----------------------------------------------------------------------- |
| 属性 | [Alpha](#alpha)                           | Set the alpha of the group.                                             |
| 属性 | [BlocksRaycasts](#blocksraycasts)         | Does this group block raycasting (allow collision)?                     |
| 属性 | [IgnoreParentGroups](#ignoreparentgroups) | Should the group ignore parent groups?                                  |
| 属性 | [Interactable](#interactable)             | Is the group interactable (are the elements beneath the group enabled)? |
| 属性 | [GameObject](#gameobject)                 | Returns a reference to the GameObject of this component.                |

## 属性

### Alpha

float Alpha {get; set; }

Set the alpha of the group.

示例

**Lua**

```lua
Space.Host.CanvasGroup.Alpha = 1.0

```

### BlocksRaycasts

bool BlocksRaycasts {get; set; }

Does this group block raycasting (allow collision)?

示例

**Lua**

```lua
Space.Host.CanvasGroup.BlocksRaycasts = true

```

### IgnoreParentGroups

bool IgnoreParentGroups {get; set; }

Should the group ignore parent groups?

示例

**Lua**

```lua
Space.Host.CanvasGroup.IgnoreParentGroups = true

```

### Interactable

bool Interactable {get; set; }

Is the group interactable (are the elements beneath the group enabled)?

示例

**Lua**

```lua
Space.Host.CanvasGroup.Interactable = true

```

### GameObject

[SGameObject](/docs/zh-Hans/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

Returns a reference to the GameObject of this component.

示例

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.CanvasGroup.GameObject

```
