# UIScene

## UIScene

ScreenUI 와 SurfaceUI 의 부모 객체입니다.

### **이벤트**

<br>

| **OnVisibleEvent** |
| ------------------ |

UI가 보여질 때 호출되는 이벤트에요.\
연결함수 형식은 function(UIScene), UIScene 는 보여지는 UIScene 객체 입니다.

\-- 샘플 --

```lua
local someUI = Workspace.ScreenUI

local function VisibleEvent(self)
    print(self.Name, " Visible!")
end
someUI.OnVisibleEvent:Connect(VisibleEvent)

someUI.Visible = true
```

<br>

| **OnUpdateEvent** |
| ----------------- |

UI가 보여지는 동안 매 프레임마다 호출되는 이벤트에요.\
연결함수 형식은 function(UIScene, updateTime), UIScene 은 매 프레임마다 호출되는 UIScene 객체 , updateTime 은 number 입니다.

\-- 샘플 --

```lua
local someUI = Workspace.ScreenUI

local function UpdateEvent(self)
    print(self.Name, " Update!")
end
someUI.OnUpdateEvent:Connect(UpdateEvent)
```

<br>

| **OnInVisibleEvent** |
| -------------------- |

UI가 안 보여질 때 호출되는 이벤트에요.\
연결함수 형식은 function(UIScene), UIScene 는 안 보여지는 은 UIScene 객체 입니다.

\-- 샘플 --

```lua
local someUI = Workspace.ScreenUI

local function InVisibleEvent(self)
    print(self.Name, " InVisible!")
end
someUI.OnInVisibleEvent:Connect(InVisibleEvent)

someUI.Visible = false
```

### **함수**

<br>

| **void AddChildUIScene(string ChildUISceneName, UIScene ObjectUIScene)** |
| ------------------------------------------------------------------------ |

(deprecate) AddChildUIWidget 함수로 이용하세요.

<br>

| **void AddChildWidget(UIWidget ObjectWidget)** |
| ---------------------------------------------- |

자식 UI 위젯을 추가할 수 있어요. (자식으로 추가할 UI 위젯)

\-- 샘플 --

```lua
local ScreenUI = Workspace.ScreenUI

ScreenUI.Image:AddChildUIWidget(Button)
```

<br>

| **void AddUIMove(string WidgetName, string TrackName, Vector Pos, number Time)** |
| -------------------------------------------------------------------------------- |

해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 이동 변화를 추가할 수 있어요. (이동 변화를 줄 위젯 이름, 트랙 이름, 이동 Vector, 변화 완료까지의 시간)

<br>

| **void AddUIRot(string WidgetName, string TrackName, float Rot, number Time)** |
| ------------------------------------------------------------------------------ |

해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 회전 변화를 추가할 수 있어요. (회전 변화를 줄 위젯 이름, 트랙 이름, 회전 float, 변화 완료까지의 시간)

<br>

| **void AddUIScale(string WidgetName, string TrackName, float scale, number Time)** |
| ---------------------------------------------------------------------------------- |

(deprecated)해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 크기 변화를 추가할 수 있어요. (스케일 변화를 줄 위젯 이름, 트랙 이름, 스케일 float, 변화 완료까지의 시간)

<br>

| **void AddUISize(string WidgetName, string TrackName, Vector Size, number Time)** |
| --------------------------------------------------------------------------------- |

해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 크기 변화를 추가할 수 있어요. (크기 변화를 줄 위젯 이름, 트랙 이름, 크기 Vector, 변화 완료까지의 시간)

<br>

| **void AddUIOpacity(string WidgetName, string TrackName, float float, number Time)** |
| ------------------------------------------------------------------------------------ |

해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 투명도 변화를 추가할 수 있어요. (투명도 변화를 줄 위젯 이름, 트랙 이름, 투명도 값, 변화 완료까지의 시간)

<br>

| **void AddUIEmpty(stirng WidgetName, string TrackName, number Time)** |
| --------------------------------------------------------------------- |

해당 Scene안에 있는 WidgetName의 이름을 가진 위젯의 변환 대기 시간을 추가할 수 있어요. (트랙 이름, 변환 대기 시간)

<br>

| **void PlayUIActionTrack(string TrackName, TransformPlayType Type, number PlayCount)** |
| -------------------------------------------------------------------------------------- |

설정된 변환 컨트롤러 실행해요. (트랙 이름, [Enum.TransformPlayType.타입](https://ditoland-utplus.gitbook.io/ditoland/api-reference/enums/transformplaytype) , 실행 횟수)

<br>

| **void StopUIActionTrack(string TrackName)** |
| -------------------------------------------- |

변환 컨트롤러를 정지시켜요. (정지 할 트랙 이름)

<br>

| **void PauseUIActionTrack(string TrackName)** |
| --------------------------------------------- |

변환 컨트롤러를 일시 정지시켜요. (일시 정지 할 트랙 이름)

<br>

| **void ResumeUIActionTrack(string TrackName)** |
| ---------------------------------------------- |

변환 컨트롤러를 다시 플레이해요. (다시 플레이 할 트랙 이름)

<br>

| **bool IsPlayingUIActionTrack(string TrackName)** |
| ------------------------------------------------- |

해당 TransformTrack이 플레이 중인지 확인할 수 있어요. (확인 할 트랙 이름)

<br>

| **void ResetUIActionTrack(string TrackName)** |
| --------------------------------------------- |

해당 TransformTrack를 적용되기 전의 Transform으로 리셋시켜요. (리셋 할 트랙 이름)

<br>

| **void RemoveUIActionTrack(String TrackName)** |
| ---------------------------------------------- |

해당 Track을 제거해요. (제거 할 트랙 이름)

<br>

| **WidgetList FindWidgets(WidgetType Type)** |
| ------------------------------------------- |

하위의 오브젝트들 중 WidgetType 에 해당하는 위젯 리스트를 얻을 수 있어요.

\-- 샘플 --

```lua
local widgetList = Workspace.ScreenUI(Enum.UIWidgetType.Image)

for i = 1, #widgetList do --리스트앞에 #을 붙여 리스트의 길이를 가져올 수 있어요.
    print(widgetList[i].Name)
end
```

\ <br>

## **사용 가능한 부모 오브젝트 기능들**

### **속성**

| **이름**                                                                                             | **설명**                  |
| -------------------------------------------------------------------------------------------------- | ----------------------- |
| [**Enable**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)         | **객체 활성화 여부**           |
| [**Transform**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)      | **객체의 Matrix**          |
| [**LocalTransform**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | **객체의 Local Transform** |
| [**Location**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 위치 Vector**       |
| [**LocalLocation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | **객체의 로컬좌표 Vector**     |
| [**Rotation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 회전 Vector**       |
| [**LocalRotation**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | **객체의 로컬 회전 Vector**    |
| [**Scale**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)          | **객체의 크기 Vector**       |
| [**Visible**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)        | **객체의 가시성**             |

### **이벤트**

| **이름**                                                                                             | **설명**                                                                                                                       |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [**OnUpdateEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | <p><strong>생성 후 매 프레임마다 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function(updateTime), updateTime 은 number 입니다.</strong></p> |
| [**OnDestroyEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | <p><strong>삭제될 때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                       |
| [**OnEnableEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)  | <p><strong>Enable 될때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                   |
| [**OnDisableEvent**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | <p><strong>Disable 될때 호출되는 이벤트에요.</strong><br><strong>연결함수 형식은 function() 입니다.</strong></p>                                  |

### **함수**

| **이름**                                                                                                                  | **설명**                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [**GetKey**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체의 키 값을 얻을 수 있어요.**                                                                        |
| [**SetTransformWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)      | **현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)**          |
| [**SetLocalTransformWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject) | **현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 로컬좌표기준으로 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)** |
| [**Teleport**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                            | **순간이동 하는 매트릭스를 설정할 수 있어요. (Matrix 값)**                                                       |
| [**SetLocationWithCollisionCheck**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)       | **객체의 위치를 설정할 수 있어요. (설정할 위치 Vector 값, 충돌 처리 여부)**                                            |
| [**SetTag**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체의 tag를 설정해요. (설정할 tag)**                                                                  |
| [**GetTag**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **객체에 설정된 tag를 얻을 수 있어요.**                                                                    |
| [**ConnectEventFunction**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                | **유저가 추가한 오브젝트 커스텀 이벤트에 함수를 연결할 수 있어요. (이벤트 이름, 연결 함수)**                                      |
| [**LookAt**](https://ditoland-utplus.gitbook.io/ditoland/api-reference/common/worldobject)                              | **오브젝트가 해당하는 위치를 바라보게 할 수 있어요. (바라볼 위치 Vector)**                                              |
