エンジンクラス
UserSettings
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
方法
IsUserFeatureEnabled(name: string):boolean |
Reset():() |
コードサンプル
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
パラメータ
戻り値
コードサンプル
IsUserFeatureEnabled サンプル
if UserSettings():IsUserFeatureEnabled("UserNoCameraClickToMove") then
print("'ClickToMove' はもう CameraScript から読み込まれるべきではありません!")
else
print("'ClickToMove' はまだ CameraScript から読み込まれています!")
endReset
UserSettings:Reset():()
戻り値
()