コガネブログ

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

2025-02-10から1日間の記事一覧

【Unity】スクリプトから Game ビューの Scale を変更する方法

概要 using System; using System.Reflection; using UnityEditor; using UnityEngine; internal static class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { const BindingFlags bindingAttrs = BindingFlags.Instance | BindingFlags…

【Unity】スクリプトから Game ビューを最大化する方法

概要 using System; using UnityEditor; internal static class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { var type = Type.GetType( "UnityEditor.GameView,UnityEditor" ); var editorWindow = EditorWindow.GetWindow( type ); …

【Unity】PlayModeWindow.SetCustomRenderingResolution で Game ビューの解像度を指定する方法

概要 using UnityEditor; internal static class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { PlayModeWindow.SetCustomRenderingResolution ( width: 480, height: 270, baseName: "480x270" ); } }