コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Device Simulator の internal な機能にアクセスできるパッケージ

リポジトリ

使用例

using Kogane;
using UnityEditor;
using UnityEngine;

public static class Example
{
    [MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        // Device Simulator で選択されているデバイスの名前を取得します
        Debug.Log( DeviceSimulatorInternal.GetCurrentDeviceName() );

        // Device Simulator のデバイスを設定します
        DeviceSimulatorInternal.SetDeviceIndexFromDeviceName( "HTC 10" );

        // Device Simulator の表示をリフレッシュします
        DeviceSimulatorInternal.Refresh();
    }
}