2023-06-22から1日間の記事一覧
ソースコード 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…