# SPlayableDirector

**成员** 9

|      |                             |                                                                               |
| ---- | --------------------------- | ----------------------------------------------------------------------------- |
| 函数 | [Play](#play)               | Instantiates a Playable using the provided PlayableAsset and starts playback. |
| 函数 | [Stop](#stop)               | Stop playback of the current Playable and destroys the corresponding graph.   |
| 函数 | [Pause](#pause)             | Pause playback of the currently running playable.                             |
| 函数 | [Resume](#resume)           | Resume playing a paused playable.                                             |
| 属性 | [State](#state)             | The current playing state of the component.                                   |
| 属性 | [Time](#time)               | The component's current time.                                                 |
| 属性 | [InitialTime](#initialtime) | The time at which the Playable should start when first played.                |
| 属性 | [Duration](#duration)       | The duration of the Playable in seconds.                                      |
| 属性 | [GameObject](#gameobject)   | –                                                                             |

## 函数

### Play

void Play()

Instantiates a Playable using the provided PlayableAsset and starts playback.

返回值

`void`

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Play()

```

### Stop

void Stop()

Stop playback of the current Playable and destroys the corresponding graph.

返回值

`void`

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Stop()

```

### Pause

void Pause()

Pause playback of the currently running playable.

返回值

`void`

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Pause()

```

### Resume

void Resume()

Resume playing a paused playable.

返回值

`void`

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Resume()

```

## 属性

### State

int State {get; }

The current playing state of the component.

示例

**Lua**

```lua
intState = Space.Host.ExecutingObject.Director.State

```

### Time

double Time {get; set; }

The component's current time. This value is incremented according to the PlayableDirector.timeUpdateMode when it is playing. You can also change this value manually.

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Time = 10

```

### InitialTime

double InitialTime {get; set; }

The time at which the Playable should start when first played.

示例

**Lua**

```lua
Space.Host.ExecutingObject.Director.Time = 2

```

### Duration

double Duration {get; }

The duration of the Playable in seconds.

示例

**Lua**

```lua
duration = Space.Host.ExecutingObject.Director.Duration

```

### GameObject

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

示例

**Lua**

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

```
