# SScriptingData

**الأعضاء** 6

|       |                                 |                                         |
| ----- | ------------------------------- | --------------------------------------- |
| دالة  | [GetVariable](#getvariable)     | Return the object of the variable.      |
| دالة  | [SetVariable](#setvariable)     | Set properties to variable.             |
| خاصية | [Enabled](#enabled)             | Is the ScriptingData component Enabled? |
| خاصية | [Variables](#variables)         | –                                       |
| خاصية | [ComponentName](#componentname) | The name of this component.             |
| خاصية | [GameObject](#gameobject)       | –                                       |

## الدوال

### GetVariable

object GetVariable(string name)

Return the object of the variable.

المعاملات

| الاسم | النوع  | القيمة الافتراضية |
| ----- | ------ | ----------------- |
| name  | string | –                 |

القيم المرجعة

`object`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")

```

### SetVariable

void SetVariable(string name, DynValue property, bool persistent = false)

Set properties to variable.

المعاملات

| الاسم      | النوع    | القيمة الافتراضية |
| ---------- | -------- | ----------------- |
| name       | string   | –                 |
| property   | DynValue | –                 |
| persistent | bool     | false             |

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.SetVariable("variableName",5,true)

```

## الخصائص

### Enabled

bool Enabled {get; set; }

Is the ScriptingData component Enabled?

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Data.Enabled = false

```

**Lua**

```lua
--clicking this object will Enable/Disable it's Scripting Data component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Data

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

```

### Variables

string\[] Variables {get; }

مثال

**Lua**

```lua
variableNames = Space.Host.ExecutingObject.Data.Variables

```

### ComponentName

string ComponentName {get; }

The name of this component.

مثال

**Lua**

```lua
componentName = Space.Host.ExecutingObject.Data.ComponentName

```

### GameObject

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

مثال

**Lua**

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

```
