2023-04-25から1日間の記事一覧
概要 Consider updating External Editor in Unity to Rider 2023.1. JetBrains Rider を 2023.1 にアップデートしたら Unity で上記の警告が出力された Package Manager で「JetBrains Rider Editor」をアップデートしたら出力されなくなった
ソースコード using System.IO; using UnityEngine; namespace Kogane { public static class ScreenCapture { public static void CaptureScreenshot ( string path, Camera camera = null, bool isTransparent = true ) { if ( camera == null ) { camera …
概要 var type = typeof( EditorWindow ).Assembly.GetType( "UnityEditor.GameView" ); EditorWindow.FocusWindowIfItsOpen( type );
ソースコード using UnityEditor; using UnityEngine; namespace Kogane.Internal { internal static class CopyBatchModeScriptTemplateMenuItem { [MenuItem( "Kogane/バッチモードでビルドするシェルスクリプトのテンプレートをコピー" )] private static…
検証用スクリプト using System; using System.Diagnostics; using UnityEngine; using Debug = UnityEngine.Debug; public class Example : MonoBehaviour { public int m_count = 1_000_000; private void Start() { const string path = "Assets/Example.…
ソースコード using TMPro; namespace Kogane { // ReSharper disable once InconsistentNaming public static class TMP_TextTextIdExtensionMethods { public static void SetText ( this TMP_Text self, TextId textId ) { self.text = textId.Value; } p…
ソースコード using TMPro; using UnityEngine; using UnityEngine.UI; namespace Kogane { public static class GraphicExtensionMethods { public static void SetColorIfNotNull( this Graphic self, in Color color ) { if ( self == null ) return; sel…
ソースコード using System; using Cysharp.Threading.Tasks; namespace Kogane { public static class FuncUniTaskExtensionMethods { public static async UniTask Call( this Func<UniTask> self ) { if ( self != null ) { await self(); } } } }</unitask>
ソースコード using System.Collections.Generic; using UnityEngine; namespace Kogane { public static class AnimatorExtensionMethods { public static void Play( this Animator self ) { self.Play( 0 ); } public static void Play( this IReadOnlyLi…