---
title: シミュレートされたクラス
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/ja-jp/engine/6000.0/manual/platform-specific/cross-platform-features/device-simulator/simulated-classes
latest_url: https://docs.unity.com/ja-jp/engine/7000.0/manual/platform-specific/cross-platform-features/device-simulator/simulated-classes.md
last_updated: 2026-10-30
generated_at: 2026-12-02T17:37:06.766Z
locale: ja-jp
---

# シミュレートされたクラス

> デバイス固有の動作に応答するコードをテストできるように、デバイスシミュレーターが提供するクラスに関する情報が含まれています。

デバイスシミュレーターにはシミュレートされたクラスが用意されており、デバイスシミュレーターでデバイス固有の動作に応答するコードをテストするために使用できます。

以下のクラスは UnityEngine.デバイス 名前空間空間にあります。

* アプリケーション: [](/engine/6000.0/script-reference/unityengine/device/application.md)
* [画面](/engine/6000.0/script-reference/unityengine/device/screen.md)
* [SystemInfo](/engine/6000.0/script-reference/unityengine/device/systeminfo.md)

これらのシミュレートされたクラスは、通常の UnityEngine 名前空間と同じメンバーを持ちます。通常、通常のクラスを使用するコードベースのどこにでも使用できます。パフォーマンスへの影響はなく、リリースビルドで使用できます。

エディターでデバイスシミュレーターが[アクティブ](/engine/6000.0/manual/platform-specific/cross-platform-features/device-simulator/introduction.md#limitations)の場合、シミュレートされたクラスは、シミュレートされたデバイスのプラットフォーム固有の動作を模倣します。例えば、 [device.SystemInfo.operatingSystem](/engine/6000.0/script-reference/unityengine/device/systeminfo/operatingsystem.md) は、シミュレートされたデバイスの Android または iOS バージョンを返します。

ビルドされたアプリケーション、またはデバイスシミュレーターがアクティブでない場合、シミュレートされたクラスの動作は、UnityEngine 名前空間の対応クラスと同じです。

シミュレートされたクラスは通常のクラスと同じメンバーを持ちますが、デバイスシミュレーターはすべての動作のシミュレーションを行うわけではありません。UnityEditor では、デバイスシミュレーターがシミュレーションを行わないメンバーは、UnityEngine と同等の動作 (プラットフォームに依存しない) を行います。例えば、デバイスシミュレーターは [device.screen.明度](/engine/6000.0/script-reference/unityengine/device/screen/brightness.md)のシミュレーションを行いません。つまり、このメンバーは、常に`1`を返す [UnityEngine.screen.明度](/engine/6000.0/script-reference/unityengine/screen/brightness.md) と同じエディター内動作を持ちます。デバイス シミュレーターがシミュレートするメンバーについては、次の API ドキュメントを参照してください。

* [デバイス.アプリケーション](/engine/6000.0/script-reference/unityengine/device/application.md)
* [Device.Screen](/engine/6000.0/script-reference/unityengine/device/screen.md)
* [Device.SystemInfo](/engine/6000.0/script-reference/unityengine/device/systeminfo.md)

## シミュレーションされたクラスを使用するためのスクリプトの更新##updating-your-scripts-to-use-simulated-classes

既存のコードを変換して UnityEngine.デバイス名前空間のクラスを使用する場合は、[エイリアスディレクティブ](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive)を使用するのが効率的です。例を次に示します。

```lang-cs
using Screen = UnityEngine.Device.Screen;
using Application = UnityEngine.Device.Application;
using SystemInfo = UnityEngine.Device.SystemInfo;
```

こうすることで、ファイル全体で使用するクラスを変更でき、API コールごとに変更する必要はありません。
