// RegisterSerializer(type)を対象になるクラスに走らせる
// (ListとDictは本体も生成したほうがいいので修正@21:14)
var alreadyGenerated = new HashSet<Type>();
var specializedSerializers = new HashSet<string>();
Action<Type> RegisterSerializer = null;
RegisterSerializer = type =>
{
if (type.IsArray) type = type.GetElementType();
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
<?xml version="1.0"?> | |
<!-- OWIN向けウェブコンいんちきテンプレセット --> | |
<configuration> | |
<configSections> | |
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core"/> | |
</configSections> | |
<appSettings> | |
<!-- なんかあれば --> |
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
// 沢山の画像のURLリスト | |
var imageList = Enumerable.Range(1, 490).Select(x => x.ToString()); | |
imageList.ToObservable() | |
.Buffer(4) | |
.Select(xs => xs.Select(x => ObservableWWW.GetWWW(x)).WhenAll()) | |
.Concat() | |
.SelectMany(xs => xs, (_, www) => www.texture) | |
.Subscribe(); |
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 EventSourceConfiguratorExtensions | |
{ | |
public static void UseEventSource(this HostConfigurator configurator) | |
{ | |
HostLogger.UseLogger(new EventSourceHostLoggerConfigurator()); | |
} | |
} | |
[Serializable] | |
public class EventSourceHostLoggerConfigurator : HostLoggerConfigurator |
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
IEnumerator ThreeSeconds() | |
{ | |
var sw = System.Diagnostics.Stopwatch.StartNew(); | |
yield return new WaitForSeconds(3); | |
Debug.Log(sw.Elapsed.TotalMilliseconds + "ms"); | |
} | |
// 3秒でかえってくる | |
Time.timeScale = 1.0f; | |
Observable.FromCoroutine(ThreeSeconds).Subscribe(); |
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
// IL2CPP error for type 'Mono.Security.Protocol.Tls.Handshake.ClientCertificateType' in assembly '..\Temp\StagingArea\Data\Managed\Mono.Security.dll' | |
// Additional information: Build a development build for more information. Exception of type 'System.Exception' was thrown. | |
using System; | |
public interface IMyInterface<T> | |
{ | |
void OnNext(T value); | |
} |
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 DOTweenExtensions | |
{ | |
public static IObservable<Sequence> CompletedAsObservable(this Sequence sequence) | |
{ | |
var subject = new AsyncSubject<Sequence>(); | |
sequence.AppendCallback(() => | |
{ | |
subject.OnNext(sequence); | |
subject.OnCompleted(); |
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
SerializationContext context = new SerializationContext() | |
{ | |
SerializationMethod = SerializationMethod.Array, | |
EnumSerializationMethod = EnumSerializationMethod.ByUnderlyingValue | |
}; | |
var intSerializer = context.GetSerializer<int>(); | |
var result = intSerializer.PackSingleObject(100); | |
var resultV = intSerializer.UnpackSingleObject(result); | |
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 System.Collections; | |
using System.IO; | |
using System.Reflection; | |
using System.Text; | |
// serialize only:) | |
public static class TinyJsonSerializer | |
{ | |
static readonly Encoding bomlessUtf8 = new UTF8Encoding(false); |
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 System.IO; | |
using System.Text; | |
namespace CloudStructures | |
{ | |
public class JsonNetRedisValueConverter : ObjectRedisValueConverterBase | |
{ | |
protected override object DeserializeCore(Type type, byte[] value) | |
{ |