코드 샘플
IsUserFeatureEnabled 샘플
if UserSettings():IsUserFeatureEnabled("UserNoCameraClickToMove") then
print("'ClickToMove'는 더 이상 CameraScript에서 로드되지 않아야 합니다!")
else
print("'ClickToMove'는 여전히 CameraScript에서 로드됩니다!")
end전체 화면 모드 감지
local gameSettings = UserSettings().GameSettings
local function checkFullScreenMode()
local inFullscreen = gameSettings:InFullScreen()
if inFullscreen then
print("전체 화면 모드가 활성화되었습니다!")
else
print("전체 화면 모드가 비활성화되었습니다!")
end
end
checkFullScreenMode()
gameSettings.FullscreenChanged:Connect(checkFullScreenMode)사용자 게임 설정 리스너
local gameSettings = UserSettings().GameSettings
local function onGameSettingChanged(nameOfSetting)
-- 이 설정의 값을 가져오려면 pcall을 통해 확인하여 가져올 수 있는지 확인합니다.
-- 때때로 이벤트는 LocalScripts가 액세스할 수 없는 속성과 함께 발생합니다.
local canGetSetting, setting = pcall(function()
return gameSettings[nameOfSetting]
end)
if canGetSetting then
print("당신의 " .. nameOfSetting .. "이 변경되었습니다: " .. tostring(setting))
end
end
gameSettings.Changed:Connect(onGameSettingChanged)API 참조
메서드
IsUserFeatureEnabled
Reset
UserSettings:Reset():()
반환
()