요약
메서드
GetClass(className: string,filter: Dictionary):ReflectedClass? |
GetClasses(filter: Dictionary):{ReflectedClass} |
GetEventsOfClass(className: string,filter: Dictionary):{ReflectedEvent} |
GetMethodsOfClass(className: string,filter: Dictionary):{ReflectedMethod} |
GetPropertiesOfClass(className: string,filter: Dictionary):{ReflectedProperty} |
상속된 멤버
코드 샘플
ReflectionService 개요
local ReflectionService = game:GetService("ReflectionService")
-- 모든 기능을 가진 SecurityCapabilities 객체 생성
local allCapabilities = SecurityCapabilities.new(table.unpack(Enum.SecurityCapability:GetEnumItems()))
-- 모든 기능으로 접근 가능한 모든 클래스 가져오기
local allClasses = ReflectionService:GetClasses({ Security = allCapabilities })
print("총 클래스 수:", #allClasses)
-- 특정 클래스 가져오기
local partClass = ReflectionService:GetClass("Part")
if partClass then
print("\nPart 클래스:")
print(" 이름:", partClass.Name)
print(" 슈퍼클래스:", partClass.Superclass and tostring(partClass.Superclass) or "없음")
end
-- 클래스의 처음 5개 속성 가져오기
local properties = ReflectionService:GetPropertiesOfClass("Part", { Security = allCapabilities })
print("\nPart 속성 수:", #properties)
for i = 1, math.min(5, #properties) do
print(" -", properties[i].Name)
endAPI 참조
메서드
GetClass
매개 변수
| 기본값: "nil" |
반환
ReflectedClass?
GetClasses
매개 변수
| 기본값: "nil" |
반환
{ReflectedClass}
GetEventsOfClass
매개 변수
| 기본값: "nil" |
반환
{ReflectedEvent}
GetMethodsOfClass
매개 변수
| 기본값: "nil" |
반환
{ReflectedMethod}
GetPropertiesOfClass
매개 변수
| 기본값: "nil" |
반환
{ReflectedProperty}