Memory Management of C# with Unity Native CollectionsYoshifumi Kawai
This document discusses C# and memory management in Unity. It begins by introducing the author and some of their open-source projects related to C# and Unity, including libraries for serialization and reactive programming. It then discusses using async/await with Unity through the UniTask library. The document also covers differences in memory management between .NET Core and Unity due to using different runtimes (CoreCLR vs Unity runtime) and virtual machines. It presents examples of using unsafe code and pointers to directly manage memory in C# for cases like native collections. It concludes that while C# aims for a safe managed world, optimizations require bypassing the runtime through unsafe code, and being aware of memory can help better understand behavior and use APIs more
This document discusses the concept of "simple" and "easy" as it relates to programming languages and Clojure in particular. It explores the differences between concepts that are simple versus complex, and easy versus hard. It provides examples of how Clojure aims to make programming simple by avoiding unnecessary complexity through choices like immutable data and avoiding side effects.
Memory Management of C# with Unity Native CollectionsYoshifumi Kawai
This document discusses C# and memory management in Unity. It begins by introducing the author and some of their open-source projects related to C# and Unity, including libraries for serialization and reactive programming. It then discusses using async/await with Unity through the UniTask library. The document also covers differences in memory management between .NET Core and Unity due to using different runtimes (CoreCLR vs Unity runtime) and virtual machines. It presents examples of using unsafe code and pointers to directly manage memory in C# for cases like native collections. It concludes that while C# aims for a safe managed world, optimizations require bypassing the runtime through unsafe code, and being aware of memory can help better understand behavior and use APIs more
This document discusses the concept of "simple" and "easy" as it relates to programming languages and Clojure in particular. It explores the differences between concepts that are simple versus complex, and easy versus hard. It provides examples of how Clojure aims to make programming simple by avoiding unnecessary complexity through choices like immutable data and avoiding side effects.
40. わんくま同盟 東京勉強会 #119
Page1Presenter
public class Page1Presenter : PagePresenterBase<Views.Page1, Page1ViewModel>
{
public override void Initialize()
{
base.Initialize();
ViewModel.ClickEvent += Click;
this.ViewModel.Text = "Page1";
}
public void Click(object sender, RoutedEventArgs args)
{ this.Parent.Navigate(typeof(Page2), null); }
public override void Cleanup()
{
ViewModel.ClickEvent -= Click;
base.Cleanup();
}
x:bindで呼び出すイベント
41. わんくま同盟 東京勉強会 #119
PagePresenterBase
public abstract class PagePresenterBase<TView, TViewModel> : ChildPagePresent
erBaseCore
where TView : Page, new()
where TViewModel : ViewModelBase, new()
{
public PagePresenterBase()
{ ViewModel = new TViewModel(); }
public TView View
{ get { return this.ViewBase as TView; } set { this.ViewBase = value; } }
public TViewModel ViewModel
{
get { return this.ViewModelBase as TViewModel; }
set { this.ViewModelBase = value; }
}