This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Test() | |
{ | |
SugoiLogger.Log("Battle", "ゲーム開始"); | |
// -> Battle | ゲーム開始 | |
var hp = 20; | |
var mp = 10; | |
SugoiLogger.Log("Battle/Status", "今のステータス", (nameof(hp), hp), (nameof(mp), mp)); | |
// -> Battle/Status | 今のステータス | hp = 20, mp = 10 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Cysharp.Threading.Tasks; | |
using Extensions; | |
using UnityEngine; | |
public class MessageTest : MonoBehaviour | |
{ | |
public void Start() => Test().Forget(); | |
private async UniTask Test() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hoge = new[] { 1, 2, 3 }; | |
hoge.ToUniTaskAsyncEnumerable().ForEachAwaitAsync(async x => | |
{ | |
Debug.Log($"Start hoge = {x}"); | |
await UniTask.Delay(TimeSpan.FromSeconds(1)); | |
Debug.Log($"Finish hoge = {x}"); | |
}).Forget(); | |
// Output | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hoge = new[] { 1, 2, 3 }; | |
Debug.Log($"hoge = {string.Join(", ", hoge)}"); | |
await hoge.ToUniTaskAsyncEnumerable().SelectAwait(async x => | |
{ | |
var delay = Random.Range(0.0f, 1.0f); | |
Debug.Log($"x = {x}, Delay = {delay}"); | |
await UniTask.Delay(TimeSpan.FromSeconds(delay)); | |
return new { Before = x, After = x + 1 }; | |
}).ForEachAwaitAsync(async x => | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hp = new AsyncReactiveProperty<int>(0); | |
await hp.ForEachAwaitAsync(async x => | |
{ | |
Debug.Log($"{Time.frameCount} {Time.time:0.00} DiaplyHP Start hp = {x}"); | |
await UniTask.Delay(TimeSpan.FromSeconds(1)); | |
Debug.Log($"{Time.frameCount} {Time.time:0.00} DiaplyHP Finish hp = {x}"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Sample | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Hello World | |
Console.WriteLine("Hello World!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code, | |
code[class*='language-'], | |
pre[class*='language-'] { | |
color: #24292e; | |
text-align: left; | |
white-space: pre; | |
word-spacing: normal; | |
tab-size: 4; | |
hyphens: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Dummy | |
{ | |
public static void Run() | |
{ | |
Debug.Log("Run!"); | |
Observable.Timer(TimeSpan.FromSeconds(1)) | |
.Subscribe(x => | |
{ | |
if (Random.Range(0, 2) == 0) Success?.Invoke(); | |
else Failed?.Invoke("エラーメッセージ"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@:generic | |
class ArrayWrapper<T> | |
{ | |
public function new() {} | |
public var value: Array<T> = []; | |
#if cs | |
public function toTyped(): List_1<T> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArrayTest | |
{ | |
public var hoges: Array<Hoge>; | |
} | |
class Hoge | |
{ | |
public var x: Int; | |
public var y: Int; | |
public var z: Int; |