2023-01-01から1年間の記事一覧
ソースコード private static string RotateClockwise( string input, int count ) { for ( var i = 0; i < count; i++ ) { input = RotateClockwise( input ); } return input; } private static string RotateClockwise( string input ) { var lines = inp…
ソースコード using System; using System.Collections.Generic; using System.Linq; using UnityEngine; namespace Kogane { public static class Vector2ExtensionMethods { public static Vector2 Average( this IEnumerable<Vector2> self ) { var enumerable = s</vector2>…
概要 バージョン コンパイル時間 2022.1.23f1 4.25 秒 2022.3.6f1 3.38 秒 Unity 2022.3.6f1 にアップデートしたらコンパイル時間が約 1 秒短くなった
概要 Clibor の「設定 > ツールチップ」から設定できる
概要 Clibor の「設定 > 定型文」から設定できる
概要 // フォーマットの設定 var options = new ExportForScreensOptionsPNG24(); options.scaleType = ExportForScreensScaleType.SCALEBYWIDTH; // 幅 options.scaleTypeValue = 512; // 512 px // アートボードの選択 var itemToExport = new ExportForSc…
概要 ファイル "XXXX.jsx" に含まれているスクリプトを実行しようとしています。 このスクリプトを実行しますか? または、Illustrator におけるスクリプトの使用と、 このメッセージの無効化について、詳しくは、「詳細情報」を選択してください。 スクリプ…
概要 「設定 > ツール > 保存時のアクション」が表示されない現象に遭遇した Rider を再起動したら表示されるようになった
概要 var currentScript = File($.fileName); var absolutePath = currentScript.path;
概要 java.lang.RuntimeException: Internal error in Cloud Firestore (X.X.X) java.lang.RuntimeException: Failed to gain exclusive lock to the Cloud Firestore client's offline persistence. This generally means you are using Cloud Firestore fr…
概要 using var androidJavaClass = new AndroidJavaClass( "android.os.Build" ); return $@"BOARD: {androidJavaClass.GetStatic<string>( "BOARD" )} BOOTLOADER: {androidJavaClass.GetStatic<string>( "BOOTLOADER" )} BRAND: {androidJavaClass.GetStatic<string>( "BRAND" )} </string></string></string>…
ソースコード using System.Linq; using System.Text; using UnityEditor; using UnityEngine; internal sealed class MissingSpriteFinder : EditorWindow { [MenuItem( "Window/Missing Sprite Finder" )] private static void Open() { GetWindow<MissingSpriteFinder>(); } pr</missingspritefinder>…
ソースコード private static bool HasDuplicateCharacters( string self ) { for ( var i = 0; i < self.Length - 1; i++ ) { for ( var j = i + 1; j < self.Length; j++ ) { if ( self[ i ] == self[ j ] ) { return true; } } } return false; } 使用例 …
ソースコード private static bool HasDuplicateElements<T>( this IReadOnlyList<T> self ) { for ( var i = 0; i < self.Count - 1; i++ ) { for ( var j = i + 1; j < self.Count; j++ ) { if ( self[ i ].Equals( self[ j ] ) ) { return true; } } } return f</t></t>…
リポジトリ
概要 ##### ExitCode 134 ##### Output Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionCont…
概要 ArgumentNullException: Value cannot be null. TextMesh Pro の Font Asset を作成する時に上記の例外が発生して Font Asset が正常に作成できない現象に遭遇した Unity メニューの「Window > TextMeshPro > Import TMP Essential Resources」を 実行…
概要 using System; using System.Text; using TMPro; using UnityEditor; internal static class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { const string path = "hoge.asset"; const string text = "あ"; var bytes = Encoding.U…
ソースコード [MenuItem( MENU_ITEM_ROOT + "/アプリ起動" )] private static void LaunchApp() { var adbPath = $"{AndroidExternalToolsSettings.sdkRootPath}/platform-tools/adb"; var packageName = "com.hoge.fuga"; var activityName = "com.google.f…
ソースコード [MenuItem( "Tools/.apk インストール" )] private static void InstallApk() { var adbPath = $"{AndroidExternalToolsSettings.sdkRootPath}/platform-tools/adb"; var apkPath = "hoge.apk"; var startInfo = new ProcessStartInfo { FileNa…
カラーコード #D4D4D4
概要 ffmpeg ^ -i "input.mp3" ^ -af "volume=2.0" ^ -ac 2 ^ "output.ogg" -af "volume=2.0" で音量を 2 倍に -ac 2 でモノラルからステレオに
ソースコード public static bool IsApproximatelyInteger( this float value, float tolerance ) { return Mathf.Abs( Mathf.Round( value ) - value ) <= tolerance; }
ソースコード public static void Remove<T>( this List<T> self, IEnumerable<T> collection ) { foreach ( var item in collection ) { self.Remove( item ); } }</t></t></t>
ソースコード public static T[] FindDuplicatedElements<T>( this IReadOnlyList<T> self ) { return self .GroupBy( x => x ) .Where( x => 2 <= x.Count() ) .Select( x => x.Key ) .ToArray() ; }</t></t>
余りを使用する方法 var number = 3.14f; var decimalPart = number % 1; if (decimalPart != 0) { // 浮動小数点以下が存在する場合の処理 } 文字列変換を使用する方法 var number = 3.14f; var numberString = number.ToString(); if (numberString.Contai…
ソースコード foreach ( var process in Process.GetProcessesByName( "POWERPNT" ) ) { process.Kill(); }
ソースコード using System.Diagnostics; using UnityEditor; using Debug = UnityEngine.Debug; public class Example { [MenuItem( "hoge/hoge" )] private static void Hoge() { var startInfo = new ProcessStartInfo { FileName = @"python", UseShellE…
概要 [MenuItem( "hoge/hoge" )] private static void Hoge() { var number = 9; // 分解したい数値 var array = new int[ 3 ]; var remaining = number; for ( var i = 0; i < array.Length - 1; i++ ) { var maxValue = remaining - ( array.Length - i - …
概要 123 456 789 上記の値を持つ string を 147 258 369 このように変換する関数 private static string TransposeString( string input ) { var lines = input.Split( '\n' ); var rowCount = lines.Length; var columnCount = lines[ 0 ].Length; var mat…