2018-01-01ãã1å¹´éã®è¨äºä¸è¦§
ååã®è¨äºãC#: çµã¿è¾¼ã¿ã®æ°å¤åãæ±ããã generics ã® å㨠IConvertible ã®èã£ã½ãäºããã㨠object åãæèºãããå¿ è¦æ§ã®ã¡ã¢ã㧠C# ã® generics ã§æ°å¤è¨ç®ãå®è£ ããã¨çµå± object ã®æèºãå¿ è¦ãªã®ã§å®è¡æã³ã¹ããæ°ã«ãªãããã§ãã¾ãå®è¡ã³â¦
// åæ; ãã®è¨äºã® Fail ã¨ã AreEqual ã¨ãã¯ããã¤ã®â using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert; // ä»»æã® IConvertible ãå¥ã® IConvertible ã«æ°å¤ãä¿æãã¦å¤æãããå ´å public static B C<A, B>( A a ) where A : IConverti</a,>â¦
// Example-0; çªç¶ã®ç¿»è¨³æ»ã訪ããã var xs = from v in Enumerable.Range( 0, 4 ) select w => w; ããããäºãããããã©ããããã C# ã³ã³ãã¤ã©ã¼ã¡ãããæ»ãããã error CS1942: An expression type in select' clause is incorrect. Type infereâ¦
// ããã¯ã³ã³ãã¤ã«ã§ããªã(´ã»Ïã»ï½) // object -> T static public T As<T>( object o ) { return o as T; } // as T ã§ããããã«ã¯ T ã« class å¶ç´ãå¿ è¦ãããã¯ã³ã³ãã¤ã«ã§ããããæå¾ åä½ãããããããªãã // object(class=nullããä½ã) -> T st</t>â¦
// åæã C#-7.0 using System.Windows.Controls; var c = new Control(); if ( c is Label l ) Console.WriteLine( $"Label.Content={l.Content}" ); if ( c is TextBlock t ) // <--ããã§ã³ã³ãã¤ã«ã¨ã©ã¼ãçãã¦ãããã Console.WriteLine( $"TextBloâ¦
Visual Studio ã® C# ããã¸ã§ã¯ãã§ã Error ã Warning ã1件ãè¦éããªã綺éºãªãã«ããå¿æãã¦ãã¾ããã Messages ã¯è¦è½ã¨ãã¦ãã¾ãããä½ä»¶ãæ¥ã¦ããã ã¾ããä¸çªä¸ãè¦ãã IDE0018: Variable declaration can be inlined ã¨ããã IDE0018 "Varâ¦
ä»äºã§æ±ã£ã¦ãããã®ã§å½åå°çé¢ã®å°çé¢å°å³ã®ã¿ã¤ã«ç»åãã¼ã¿ã¯ãã使ããã¦é ãã¦ãã¾ãããã¾ããã®ã§ãããããããã¾ã«ã¡ã¿ãã¼ã¿ã ã£ãããã¯ã»ã«ãã©ã¼ãããã ã£ãããå¥å¦ãªç»åãã¡ã¤ã«ã«ééããäºããã³ãã³ããã¾ã ä»åã¯å°çé¢å°å³ã®JPEGâ¦
usagi.cs ; ãããã欲ããã¨æã£ãé©å½ãªæ©è½ãã¡ for C# nuget -> NuGet Gallery | usagi 0.0.0 repos -> GitHub - usagi/usagi.cs: ãããã欲ããã¨æã£ãé©å½ãªæ©è½ãã¡ for C# æ°å¹´ã¶ãã« C# ã®å®è£ ãæ¸ãã¦ãã¦ããã¶ããã¨ããããã¤ããã§æ¸ãã¦ã¿â¦
UE4 ããã¸ã§ã¯ãå ã®ã¢ã»ããåãããããªã«ããã C++ ã³ã¼ãã® ctor ã§æ¾ãããå ´åã«ã¯ä»¥ä¸ã®ããã«ãããããã®ã ãâ¦: #include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h" // ã©ããã® UObject 系㮠ctor ã§ããã¸ã§ã¯ãå ã®ã¢ã»ããâ¦
é ããããã®è¨æ¶ã C# ã¨ããã Visual Studio ã®ããã¸ã§ã¯ã管çã·ã¹ãã ã«ã¯ãã¼ã¸ã§ã³çªå·ã®ä¸é¨ãèªåæ¡çªãã便å©ãªæ©è½ããã£ãããããªæ°ããããå®éã«å·çæç¹ã§ç¾è¡è£½åã® VS2017 ã§ä½ã£ã C# ã®ããã¸ã§ã¯ãã® AssemblyInfo.cs ã«ã次ã®ã³ã¡ã³â¦
ä¾ãã°åãè¦ç´ è»ãé¸æè¢ã¨ãã¦æ示ããè¤æ°ã®ã³ã³ãããã¯ã¹ãé ç½®ãããã¨ãããã以ä¸ã®ã³ã¼ãä¾ã¯ä½ãã <Window> ã®å é¨ã«å®ç¾©ãã¦ããã <ComboBox Name="CB1"> <ComboBoxItem Content="é¸æè¢1"/> <ComboBoxItem Content="é¸æè¢2"/> <ComboBoxItem Content="é¸æè¢3"/> </ComboBox> <ComboBox Name="CB2"> <ComboBoxItem Content="é¸æè¢1"/> </comboboxitem></combobox></window>
C#er ã«ã¯æ¨æºã©ã¤ãã©ãªã¼ã«æºãã¦ã馴æã¿ããã JSON ãæ±ãã©ã¤ãã©ãªã¼ Newtonsoft.Json ãããããã ããããããããã£ã¦ã¯ãªãã ããããªè§£èª¬ãç¡ãï¼å人ã®ææ³ã§ããï¼ã®ã§ç§ã使ãã«ãããæä½é調æ»ããã¡ã¢ãæ®ãã 使ç¨ãã主ãªåå空éã¯2ã¤â¦
Note: ä»åã¯ããã¨ã¨ãã»ã¤çãªãªãã¿ã§ãã ããæ°å¹´ç¨åº¦ã¯å¿ è¦ã®ç¡ãã£ãã®ã§ Windows 10 ã¯ï¼æã«æ¯ã¹ãã°ï¼å®å®åä½ãã¦ããã¦ãã®ç¹ã§ã¯ä½è¨ãªæéãå°ãªããªã£ã¦å¬ãããªãã¨æã£ã¦ããã ã ããä»æ¥ã¯ ã¹ã¿ã¼ããã¿ã³ ãæ»ãã ã¿ã¹ã¯ãã¼ã®ä»ã®æ©è½â¦
XAML 㧠UI ãä½ã£ã¦ãããã ã <CheckBox IsChecked="{Binding Awabi}"/> <CheckBox IsEnabled="{Binding !Awabi}"/> å æ¥ã® ã.net/XAML/C#: XAML ã®ããããã£ã¼ã¯ Visibility åã ãã© Boolean ã® DataContext ã«æç¸ãããå ´åã®æé©è§£ãããã㯠BooleanToVisibilityConverter ã«ã¤ãã¦ã ã®ä¾ãã IValueConverter ãå®è£ ãã Inverse</checkbox></checkbox>â¦
次ã®ã³ã¼ããããã¯ç¸å½ã®BPã¯æå¾ ã¨ã¯ç°ãªãåä½ãæããããããªãã UGameplayStatics::OpenLevel ( GetWorld() , TEXT( "Sushi" ) , true , TEXT( "#Tako" ) ); ããã®ãããªã¬ãã«ã®éãæ¹ãããå ´åãéãããã¬ãã«ã§ã¯ AGameMode::OptionsString ã â¦
katze_7514 ããã® UEDirectInputPadPlugin ã Fork ã㦠ã§ã«ããã«ãããã¾ããã Fork å : usagi/UEDirectInputPadPlugin Fork å : katze7514/UEDirectInputPadPlugin UE4 ã«ã¯ 4.15 以éã¯æ¨æºã§ Windows RawInput Plugin ãå ¥ãã¾ãããã 軸ã®å ¥åå¤ãâ¦
ãBoolean ãªããããã£ã¼ Hoge ã DataContext ã«æç¸ããã Window ã®ã«ããä½ãã®ã³ã³ããã¼ã«ï¼ä¸ã®ä¾ã§ã¯ Button ï¼ã® Visibility ããããã£ã¼ã XAML ã ãã§ç°¡åã« Window ã® DataContext ã® Hoge ã«æç¸ãããï¼ãã¨æã£ããã ã <Window ... ç¥ ...> ... ç¥ ... <Button Visibility="{Binding ð Hoge ? Visible : Hidden ããããã ãã©ï¼ï¼ð}"/> ... </button></window>â¦
âããããã®ãå± ãã¨ããã // UObject æ´¾çã ãã·ã³ã°ã«ãã³ãã¡ã¯ããªã¼ã§çæããããªãã¸ã§ã¯ãããã£ãã¨ãã UA* UA::GetInstance() { if ( ! my_static_instance ) my_static_instance = NewObject< UA >(); return my_static_instance; } ãã®ãããªâ¦
æ®å¿µãªäºã«å¥ããã»ã¹ã®èµ·åæã«ä¸ããããã³ãã³ãã©ã¤ã³æ å ±ã System.Diagnostics.Process ã® StartInfo ããããã£ã¼ã® FileName ã Arguments ããåå¾ã¯ã§ããªãããããã¯ããã»ã¹ã®èµ·åãèªèº«ã®ããã»ã¹ããè¡ãéã«èªèº«ãè¨å®ããå ´åã«ã®ã¿æå³ãâ¦
諸äºæ ã«ãã UE4 ã§ã²ã¼ã ã§ã¯ãªãä½ããéçºãããã¦ã«ã¤ãªãã«ãããã»ã¹ã®ã²ã¼ã ãä½ã£ãããã㨠ããã»ã¹ID ãåå¾ããããªããããããªãããããã¯ãªã£ãã UE4 ã«ã¯ãããªæã«ä¾¿å©ãã㪠FGenericPlatform::GetCurrentProcessId ããã ããã»ã¹IDâ¦
Visual Studio 㧠C# ããã¸ã§ã¯ããã«ããã«ãããã¦ããåææ¥ã ã£ããJSON-RPC-2.0 ã®ã¯ã©ã¤ã¢ã³ããå®è£ ããå¿ è¦ããã£ãã®ã§ NuGet ãè¦ãã¨å°å ¥ãç°¡åãããªã©ã¤ãã©ãªã¼ãå¹¾ã¤ãè¦ã¤ããã NuGet Gallery | Packages matching jsonrpc ãã®ã¸ãã使ãâ¦
// Process using System.Diagnostics; // C# ã¢ããªãã UE4 製ã®ã¢ããªï¼ã«éããï¼ãèµ·åãã¦ããã»ã¹ããã³ãã«ãã var p = Process.Start( "your-executable-path.exe" ); // æ¢ã«åä½ãã¦ãã UE4 製ã®ã¢ããªï¼ã«éããï¼ãæ¢ãã¦ããã»ã¹ããã³ãã«â¦
Note: ä»åã¯æè¡çå 容ã¯ãã¶ãç¡ãããã»ï½ã» ãã¶ããã ã®ã¨ãã»ã¤ã ããã»ï½ã» Visual Studio 㧠C# ãæ¸ãã®ã¯ãæ°æã¡çã«ã¯ãã¶ã10å¹´ã¶ããããï¼å®éã¯ãããªã«é·ããªããï¼ã C# ã§ã¢ããªãæ¸ãã®ã¯5å¹´ã¡ãã£ã¨æ¯ããããï¼ãã¶ãã»ãã¨ï¼ã C# ãâ¦
ãUE4 ã«ã¯ã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ãããããããç¹ã« C++er ã¯æ£ããå®è£ ãéå°ã«æ°ã«æããå¿ è¦ããããã UE4Editor ãã GUI ã§ãè¨å®ã§ãã GameSingletonClass, GameInstance ã使ãå ´åã¯æ°ã«ããå¿ è¦ã¯ç¡ããä»åã¯ãã®ä»çµã¿ã使ããªãå ´åã®è©±ã UObâ¦
ãã®é DDDA ( STEAM ç ) ãéãã§ãã¾ããã²ã¼ã ã¯æ¥½ããã¦ããã®ã§ãããã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦ã®åä½ã«å¹¾ã¤ãæ²ãã¿ã®æåãããæ°ã«ããªãããã¬ã¤ãã¦ãã¾ããã ãã«ãã¢ãã¿ã¼ç°å¢ã§ãã«ã¹ã¯ãªã¼ã³ã ON ã«ã³ã³ãã£ã°ãã㨠Left-Top ã®ã¢ãã¿ã¼ã«â¦
USaveData æ´¾çåã®ã»ã¼ããã¼ã¿ãä½ã UGameplayStatics::SaveGameToSlot, UGameplayStatics::LoadGameFromSlot ãç¨ãã¦ã»ã¼ãã¨ãã¼ããå®è£ ããææ³ãç¨ããã¨ããèªä½ã®å®è£ å´åã¯ç¯ç´ã§ãã¦å¬ããããããããããã® API 㯠UE4 ããã¸ã§ã¯ãã®éçºæâ¦
æ¬ç·¨ã¯ä»¥åæ¸ãã ãUE4/C++ Tick ãæ¥ãªãï¼ãããªã¨ãã®ãã©ãã«ã·ã¥ã¼ãåå¿é²ã ã§ããä»åã¯ãã®ãã¾ãã è¡åãã¿ã¼ã³ã§æ¸ãã¨ãããããªãã ãã¨æ°ã¥ãäºãå¤ãã®ã§ãã⦠Tick ãæ¥ãªãï¼ï¼æ°ã¥ãï¼ PrimaryActorTick.bCanEverTick = true ãã¦ããªãâ¦
次ã®ãããªããç°¡å㪠FHttpModule ã®å®è£ ä¾ãå®è¡ããã¨ã²ã¼ã ã¾ã㯠UE4Editor ãã¨ããã»ã¹ãè½ã¡ã¦ãã¾ãã TSharedRef< IHttpRequest > r = FHttpModule::Get().CreateRequest(); r->OnProcessRequestComplete().BindUObject( this, &UMyHttpTask::Handâ¦
1ã¤åã®è¨äº ãUE4/C++: å®è¡æã«åå¾ããããã¥ã¡ã³ãã SJIS ã ã£ãæã« ICU 㧠UTF8 ã«ããã UTF16 㧠TCHAR ã«ããã¡ã¢ã ã§UE4ã®ã¦ã¼ã¶ã¼ããã¸ã§ã¯ãã¬ãã«ã§ ICU ã©ã¤ãã©ãªã¼ãåãè¾¼ãã§æåã³ã¼ããæä½ããå®è£ ã®ã¡ã¢ãæ¸ãã¾ããããã®è¨äºã®å·â¦
å®è¡æã«ã©ããã®ã¬ã¬ã·ã¼ææ¸ã HTTP ã§æ¾ã£ã¦ãã¦è¡¨ç¤ºãããã¨ããã SJIS ã ã£ãã EUC-JP ã ã£ãããããã¯ã©ããå¥ã®æååã®æåã³ã¼ãã ã£ãã UE4 ã®æååå¦çç³»ã¯å é¨è¡¨ç¾ã® UTF16 ã¾ãã¯å¤æãã¯ããå®ç¾©ããã UTF8 ã ANSI ãããªãã¨æ±ããå°â¦