ContextActionService
ContextActionService : Instance
Overview
ํน์ ์กฐ๊ฑด์์๋ง ํ์ฑํ๋๋ ๋์์ ์ฌ์ฉ์ ์ ๋ ฅ๊ณผ ์ฐ๊ฒฐํด์ฃผ๋ ์์คํ ์ผ๋ก, ํ๋ ์ด์ด๊ฐ ํน์ ๋๊ตฌ๋ฅผ ์ฅ์ฐฉํ์ ๋๋, ์ด๋ค ์์น์ ์์ ๋๋ง ๋ฒํผ ์ ๋ ฅ์ด ์๋ํ๋๋ก ์ค์ ํ ์ ์์ต๋๋ค.
๊ฐ ์ ๋ ฅ ๋์์ ๋ฌธ์์ด๋ก ์ ์๋๋ฉฐ, ์ด๋ฅผ ํตํด ์ด๋ค ์ ๋ ฅ ๊ธฐ๋ฅ์ธ์ง ๊ตฌ๋ถํ ์ ์์ต๋๋ค. ๋์ผํ ์ด๋ฆ์ ์ฌ๋ฌ ๋์์ด ์ฐ๊ฒฐ๋ ๊ฒฝ์ฐ, ๊ฐ์ฅ ์ต๊ทผ์ ๋ฐ์ธ๋ฉ๋ ๋์์ด ์ฐ์ ์ ์ฉ๋๋ฉฐ, ํด์ ๋๋ฉด ์ด์ ์ ์ฐ๊ฒฐ๋ ๋์์ด ๋ค์ ํ์ฑํ๋ฉ๋๋ค.
์ด ์์คํ ์ ํด๋ผ์ด์ธํธ ํ๊ฒฝ์์๋ง ์ฌ์ฉ๋๋ฉฐ, ์ปจํ ์คํธ ๊ธฐ๋ฐ์ผ๋ก ์ ๋ ฅ์ ๊ด๋ฆฌํ ์ ์์ด, ๋ณต์กํ ์ํ ํ์ธ ์์ด๋ ์ํฉ์ ๋ฐ๋ผ ์ ์ ํ ๋์์ ์ ์ฉํ ์ ์์ต๋๋ค.
๋ํ, ํค๋ณด๋๋ ํฐ์น ์ ๋ ฅ์ด ํจ๊ป ์ฐ๋๋์ด ๋ค์ํ ํ๋ซํผ์์ ์ผ๊ด๋ ์ฌ์ฉ์ ๊ฒฝํ์ ์ ๊ณตํ ์ ์์ต๋๋ค.
Properties
Methods
BindAction
ํน์ ๋ฌธ์์ด์ ์ ๋ ฅ ๋์์ ์ ์ํ๊ณ , ํด๋น ์ ๋ ฅ์ด ๋ฐ์ํ์ ๋ ์ฐ๊ฒฐ๋ ํจ์๊ฐ ํธ์ถ๋๋๋ก ์ค์ ํ ์ ์์ต๋๋ค.
์ง์ ํ ํค๋ณด๋ ํค๋ ํฐ์น ๋ฒํผ์ด ๋๋ฆด ๊ฒฝ์ฐ, ์ ๋ ฅ ์ ๋ณด์ ์ ๋ ฅ ์ํ๊ฐ ์ฐ๊ฒฐ๋ ํจ์์ ์ธ์๋ก ์ ๋ฌ๋ฉ๋๋ค.
Parameters
string ActionName
๋์์ ์๋ณํ๊ธฐ ์ํ ์ด๋ฆ์ ๋๋ค.
Value FunctionToBind
์ ๋ ฅ์ด ๊ฐ์ง๋์์ ๋ ์คํ๋๋ ํจ์๋ก, ์ฐ๊ฒฐ๋ ํจ์์๋ ๋ค์๊ณผ ๊ฐ์ ์ธ์๋ค์ด ์ ๋ฌ๋ฉ๋๋ค:
stringActionName: BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆEnum.UserInputState: ์ ๋ ฅ ์ํInputObjectInputObject: ์ ๋ ฅ๊ณผ ๊ด๋ จ๋ ์ธ๋ถ ์ ๋ณด๋ฅผ ํฌํจํ๋ ๊ฐ์ฒด์ ๋๋ค.
boolean CreateTouchButton
๋์์ ์คํํ ๋ฒํผ์ ํ๋ฉด์ ํ์ํ ์ง ์ฌ๋ถ์ ๋๋ค.
Tuple InputType
Enum.KeyCode๋ฅผ ์ฌ์ฉํ์ฌ ๋์์ ์คํํ ํค๋ฅผ ์ง์ ํ ์ ์์ผ๋ฉฐ, ์ฌ๋ฌ ๊ฐ์ ํค๋ฅผ ์ค์ ํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค.
Return
void
Code Samples
GetAllBoundActionInfo
๋ฐ์ธ๋ฉ๋ ๋ชจ๋ ์ก์ ์ ๋ณด๋ฅผ ํ ์ด๋ธ ํํ๋ก ๋ฐํํฉ๋๋ค.
๋ฐํ๋ ํ ์ด๋ธ์ ๊ฐ ์ก์ ์ ์ด๋ฆ์ ํค๋ก ํ๋ฉฐ, ํด๋น ์ด๋ฆ์ GetBoundActionInfo()์ ์ ๋ฌํ์ ๋ ์ป์ ์ ์๋ ์์ธ ์ ๋ณด๊ฐ ๊ฐ์ผ๋ก ํฌํจ๋ฉ๋๋ค.
์ฌ๋ฌ ์ก์ ์ด ๋์์ ๋ฐ์ธ๋ฉ๋์ด ์์ ๋ ์ฐ์ ์์๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ ์ฉ๋๊ณ ์๋์ง, ๋๋ ์ด๋ค ์ก์ ์ด ๋ฎ์ด์ฐ๊ธฐ ๋์๋์ง๋ฅผ ํ์ธํ ๋ ์ ์ฉํ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค.
Parameters
Return
Value
๋ฐ์ธ๋ฉ๋ ๋ชจ๋ ์ก์ ์ ๋ณด๊ฐ ๊ตฌ์ฑ๋ ๋์ ๋๋ฆฌ์ ๋๋ค.
Code Samples
GetBoundActionInfo
ํน์ ์ก์ ์ด๋ฆ์ ๊ธฐ์ค์ผ๋ก, ๊ทธ ์ก์ ์ ๋ฐ์ธ๋ฉ๋ ์ ๋ ฅ ์ ๋ณด์ ์์ฑ๋ค์ ๋ฐํํฉ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
Return
Value
์ก์ ์ ๋ณด๊ฐ ๊ตฌ์ฑ๋ ๋์ ๋๋ฆฌ์ ๋๋ค.
Code Samples
GetButton
BindAction()์ ํตํด ์์ฑ๋ ํฐ์น ๋ฒํผ์ ImageButton ๊ฐ์ฒด๋ก ๋ฐํํฉ๋๋ค.
ํฐ์น ๋ฒํผ์ ์ฌ์ฉํ์ง ์๋ ์ก์ ์ธ ๊ฒฝ์ฐ, nil์ ๋ฐํํฉ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
Return
Value
์์ฑ๋ ํฐ์น ๋ฒํผ์ ๋๋ค.
Code Samples
SetDescription
BindAction()์ ํตํด ์ ์๋ ์ก์ ์ ์ค๋ช ํ ์คํธ๋ฅผ ์ค์ ํ๋ ๊ธฐ๋ฅ์ ๋๋ค.
์ค์ ํ ํ ์คํธ๋ UI์ง์ ํ์๋์ง๋ ์์ผ๋ฉฐ, ์ก์ ์ ๋ํ ์ ๋ณด๋ฅผ ์ค๋ช ํ๊ฑฐ๋ ๊ตฌ๋ถํ๊ธฐ ์ํ ์ฉ๋๋ก๋ง ์ฌ์ฉ๋ฉ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
string InDescription
์ค์ ํ ์ค๋ช ์ ๋๋ค.
Return
void
Code Samples
SetImage
BindAction()์ ํตํด ์์ฑ๋ ํฐ์น ๋ฒํผ์ ์ด๋ฏธ์ง๋ฅผ ์ค์ ํ๋ ๊ธฐ๋ฅ์ ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
string ImageId
ํฐ์น ๋ฒํผ์ ํ์ํ ์ด๋ฏธ์ง์ AssetId์ ๋๋ค.
Return
void
Code Samples
SetPosition
BindAction()์ ํตํด ์์ฑ๋ ํฐ์น ๋ฒํผ์ ํ๋ฉด ๋ด ์์น๋ฅผ ์ค์ ํ๋ ๊ธฐ๋ฅ์ ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
UDim2 InPosition
์ค์ ํ ์์น์ ๋๋ค.
Return
void
Code Samples
SetTitle
BindAction()์ ํตํด ์์ฑ๋ ํฐ์น ๋ฒํผ์ ํ์๋๋ ๊ธ์๋ฅผ ์ค์ ํ๋ ๊ธฐ๋ฅ์ ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
string InTitle
์ค์ ํ ๋ด์ฉ์ ๋๋ค.
Return
void
Code Samples
UnbindAction
ํน์ ๋ฌธ์์ด์ ์ ์๋ ์ ๋ ฅ ๋์์ ํด์ ํฉ๋๋ค.
Parameters
string ActionName
BindAction()์ ์ํด ์ ์๋ ๋์์ ์ด๋ฆ
Return
void
Code Samples
Events
LocalToolEquipped
ํ๋ ์ด์ด๊ฐ ๋๊ตฌ๋ฅผ ์ฅ์ฐฉํ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
Parameters
Tool Tool
์ฅ์ฐฉํ ๋๊ตฌ์ ๋๋ค.
Code Samples
LocalToolUnequipped
ํ๋ ์ด์ด๊ฐ ์ฅ์ฐฉํ ๋๊ตฌ๋ฅผ ํด์ ํ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
Parameters
Tool Tool
์ฅ์ฐฉ ํด์ ํ ๋๊ตฌ์ ๋๋ค.
Code Samples
See also
๋ชจ๋ฐ์ผ ์กฐ์ ์ฒ๋ฆฌLast updated