Move Assets/* (expect Plugins) to Assets/VRM/*

This commit is contained in:
yutopp
2018-12-29 13:21:42 +09:00
parent 9102ed5566
commit 7938679772
762 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,85 @@
using System;
using System.Linq;
using System.Collections.Generic;
namespace UniJSON
{
public static class ArraySegmentExtensions
{
public static T[] ArrayOrCopy<T>(this ArraySegment<T> self)
{
if (self.Array == null || self.Count==0)
{
return new T[] { };
}
else if(self.Offset==0 && self.Count==self.Array.Length)
{
return self.Array;
}
else
{
var array = new T[self.Count];
Array.Copy(self.Array, self.Offset, array, 0, self.Count);
return array;
}
}
public static IEnumerable<T> ToEnumerable<T>(this ArraySegment<T> self)
{
return self.Array.Skip(self.Offset).Take(self.Count);
}
public static void Set<T>(this ArraySegment<T> self, int index, T value)
{
if (index < 0 || index >= self.Count)
{
throw new ArgumentOutOfRangeException();
}
self.Array[self.Offset + index] = value;
}
public static T Get<T>(this ArraySegment<T> self, int index)
{
if (index < 0 || index >= self.Count)
{
throw new ArgumentOutOfRangeException();
}
return self.Array[self.Offset + index];
}
public static ArraySegment<T> Advance<T>(this ArraySegment<T> self, Int32 n)
{
return new ArraySegment<T>(self.Array, self.Offset + n, self.Count - n);
}
public static ArraySegment<T> Take<T>(this ArraySegment<T> self, Int32 n)
{
return new ArraySegment<T>(self.Array, self.Offset, n);
}
public static T[] TakeReversedArray<T>(this ArraySegment<T> self, Int32 n)
{
var array = new T[n];
var x = n - 1;
for (int i = 0; i < n; ++i, --x)
{
array[i] = self.Get(x);
}
return array;
}
public static byte[] Concat(this byte[] lhs, ArraySegment<byte> rhs)
{
return new ArraySegment<byte>(lhs).Concat(rhs);
}
public static byte[] Concat(this ArraySegment<byte> lhs, ArraySegment<byte> rhs)
{
var bytes = new byte[lhs.Count + rhs.Count];
Buffer.BlockCopy(lhs.Array, lhs.Offset, bytes, 0, lhs.Count);
Buffer.BlockCopy(rhs.Array, rhs.Offset, bytes, lhs.Count, rhs.Count);
return bytes;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 12d3e22e2e62d4948a5aff4bc42208e9
timeCreated: 1495517072
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,60 @@
using System;
using System.IO;
namespace UniJSON
{
public static class ByteExtensions
{
public static Byte GetHexDigit(this UInt16 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static Byte GetHexDigit(this UInt32 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static Byte GetHexDigit(this UInt64 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static Byte GetHexDigit(this Int16 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static Byte GetHexDigit(this Int32 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static Byte GetHexDigit(this Int64 n, int index)
{
return (Byte)(n >> 8 * index & 0xff);
}
public static UInt32 ToUint32(this Single n, Byte[] buffer)
{
if (buffer.Length < 4)
{
throw new ArgumentException();
}
using (var ms = new MemoryStream(buffer))
using (var w = new BinaryWriter(ms))
{
w.Write(n);
}
return BitConverter.ToUInt32(buffer, 0);
}
public static UInt64 ToUint64(this Double n, Byte[] buffer)
{
if (buffer.Length < 8)
{
throw new ArgumentException();
}
using (var ms = new MemoryStream(buffer))
using (var w = new BinaryWriter(ms))
{
w.Write(n);
}
return BitConverter.ToUInt64(buffer, 0);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: aa32ad3ea4c1ec540a03225c0d520af9
timeCreated: 1495517078
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,21 @@
using System;
namespace UniJSON
{
public static class DateTimeOffsetExtensions
{
public const long TicksPerSecond = 10000000;
public readonly static DateTimeOffset EpocTime = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
#if !NET_4_6 && !NET_STANDARD_2_0
public static long ToUnixTimeSeconds(this DateTimeOffset now)
{
if (now < EpocTime)
{
throw new ArgumentOutOfRangeException();
}
return (now - EpocTime).Ticks / TicksPerSecond;
}
#endif
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d2fd687914fcde848ab36867817cb873
timeCreated: 1544155597
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using System;
namespace UniJSON
{
public static class EnumExtensions
{
public static bool HasFlag(this Enum keys, Enum flag)
{
if (keys.GetType() != flag.GetType())
throw new ArgumentException("Type Mismatch");
return (Convert.ToUInt64(keys) & Convert.ToUInt64(flag)) != 0;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d8691eccccb3e214db8bc5b86179f428
timeCreated: 1526057070
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
using System;
namespace UniJSON
{
public static class StringExtensions
{
public static ListTreeNode<JsonValue> ParseAsJson(this string json)
{
return JsonParser.Parse(json);
}
public static ListTreeNode<JsonValue> ParseAsJson(this Utf8String json)
{
return JsonParser.Parse(json);
}
public static ListTreeNode<JsonValue> ParseAsJson(this byte[] bytes)
{
return JsonParser.Parse(new Utf8String(bytes));
}
public static ListTreeNode<JsonValue> ParseAsJson(this ArraySegment<byte> bytes)
{
return JsonParser.Parse(new Utf8String(bytes));
}
public static ListTreeNode<MsgPackValue> ParseAsMsgPack(this byte[] bytes)
{
return MsgPackParser.Parse(bytes);
}
public static ListTreeNode<MsgPackValue> ParseAsMsgPack(this ArraySegment<byte> bytes)
{
return MsgPackParser.Parse(bytes);
}
public static ListTreeNode<TomlValue> ParseAsToml(this string toml)
{
return TomlParser.Parse(toml);
}
public static ListTreeNode<TomlValue> ParseAsToml(this Utf8String toml)
{
return TomlParser.Parse(toml);
}
public static ListTreeNode<TomlValue> ParseAsToml(this byte[] bytes)
{
return TomlParser.Parse(new Utf8String(bytes));
}
public static ListTreeNode<TomlValue> ParseAsToml(this ArraySegment<byte> bytes)
{
return TomlParser.Parse(new Utf8String(bytes));
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c25e655e5dc993145a70d9ddde6a6034
timeCreated: 1545735557
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
using System;
using System.Linq;
using System.Collections.Generic;
namespace UniJSON
{
public static class TypeExtensions
{
public static bool GetIsGenericList(this Type t)
{
if (t == null) return false;
return t.IsGenericType
&& (t.GetGenericTypeDefinition() == typeof(List<>));
}
public static bool GetIsGenericDictionary(this Type t)
{
if (t == null) return false;
return t.IsGenericType
&& (t.GetGenericTypeDefinition() == typeof(Dictionary<,>)
&& t.GetGenericArguments().FirstOrDefault() == typeof(string)
);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2fb728ca27f90c947890313df5f94d4d
timeCreated: 1531634657
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: