This file contains 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 fontAsset = AssetDatabase.LoadAssetAtPath<Font>(fontPath); | |
var settings = new TextGenerationSettings | |
{ | |
generationExtents = Vector2.zero, | |
textAnchor = TextAnchor.MiddleCenter, | |
alignByGeometry = false, | |
scaleFactor = 1.0f, | |
color = Color.white, | |
font = fontAsset, |
This file contains 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 System.IO; | |
using System.Linq; | |
using System.Xml.Linq; | |
using UnityEditor; | |
using UnityEditor.Compilation; | |
using UnityEditor.Experimental; | |
using UnityEditorInternal; | |
using UnityEngine; |
This file contains 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 System.Linq; | |
using System.Xml.Linq; | |
using UnityEditor; | |
public class EnableNullable : AssetPostprocessor | |
{ | |
private static string OnGeneratedCSProject(string path, string content) | |
{ | |
var document = XDocument.Parse(content); |
This file contains 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 System.Collections.Generic; | |
using System.Linq; | |
using AnimeTask; | |
using UniRx.Triggers; | |
using UniRx; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using Anime = AnimeRx.Anime; | |
using Motion = AnimeRx.Motion; |
This file contains 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 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 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 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 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 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!"); |