Update
This commit is contained in:
ALEXTANG
2023-03-31 17:35:22 +08:00
parent 36353294d6
commit 717ecfed07
46 changed files with 6753 additions and 0 deletions

8
Assets/AssetRaw.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ff3591c28885e0947b42ef41853b14b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Scenes.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6cb8d6706c0270845b2c2dddd267ba55
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

238
Assets/Scenes/main.unity Normal file
View File

@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &2003211381
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2003211384}
- component: {fileID: 2003211383}
- component: {fileID: 2003211382}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &2003211382
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2003211381}
m_Enabled: 1
--- !u!20 &2003211383
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2003211381}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &2003211384
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2003211381}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2061060681
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2061060682}
m_Layer: 0
m_Name: GameMain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2061060682
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2061060681}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ffce650b4a398384a896297542ef0992
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/TEngine.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9bb955586c17c534a970d37b2279d836
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 40ac6a1c566dd544abadd07fd0e37300
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
{
"name": "TEngine.Editor",
"rootNamespace": "",
"references": [
"TEngine.Runtime"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 266de906ccd7d434ea04dcdb9eb3d7f4
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 66483273e63ae5c449d624d58360138c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: bc9c7e2be608ffb4f900d02be002262e
PluginImporter:
externalObjects: {}
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 1
settings: {}
Editor:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: df9c2517e8a362749a6ff0ec272ad70f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
using Bright.Serialization;
namespace Bright.Config
{
public abstract class BeanBase : ITypeId
{
public abstract int GetTypeId();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9537f3ca9ccccf045973e0d3eb5f4dfa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 28207b76cd2c1f94bb989512c6bdee60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
namespace Bright.Serialization
{
public interface ITypeId
{
int GetTypeId();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eb496f299578d6a429a600f5cce01f2c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
{
"name": "LubanLib",
"rootNamespace": "",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b48be955427611241bcb6f2a07949c5b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 271b7719175d16941ba67aef3e8d58eb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012-2017 Markus Göbel (Bunny83)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a1c67fb7a28f34040b970bf97f982827
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7e1422f3aa49df44599ebc3c951a98f3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 94f6ac1c525fff1408a03b9f299e6252
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,301 @@
//#define USE_SharpZipLib
/* * * * *
* This is an extension of the SimpleJSON framework to provide methods to
* serialize a JSON object tree into a compact binary format. Optionally the
* binary stream can be compressed with the SharpZipLib when using the define
* "USE_SharpZipLib"
*
* Those methods where originally part of the framework but since it's rarely
* used I've extracted this part into this seperate module file.
*
* You can use the define "SimpleJSON_ExcludeBinary" to selectively disable
* this extension without the need to remove the file from the project.
*
* If you want to use compression when saving to file / stream / B64 you have to include
* SharpZipLib ( http://www.icsharpcode.net/opensource/sharpziplib/ ) in your project and
* define "USE_SharpZipLib" at the top of the file
*
*
* The MIT License (MIT)
*
* Copyright (c) 2012-2017 Markus Göbel (Bunny83)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* * * * */
using System;
namespace SimpleJSON
{
#if !SimpleJSON_ExcludeBinary
public abstract partial class JSONNode
{
public abstract void SerializeBinary(System.IO.BinaryWriter aWriter);
public void SaveToBinaryStream(System.IO.Stream aData)
{
var W = new System.IO.BinaryWriter(aData);
SerializeBinary(W);
}
#if USE_SharpZipLib
public void SaveToCompressedStream(System.IO.Stream aData)
{
using (var gzipOut = new ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream(aData))
{
gzipOut.IsStreamOwner = false;
SaveToBinaryStream(gzipOut);
gzipOut.Close();
}
}
public void SaveToCompressedFile(string aFileName)
{
System.IO.Directory.CreateDirectory((new System.IO.FileInfo(aFileName)).Directory.FullName);
using(var F = System.IO.File.OpenWrite(aFileName))
{
SaveToCompressedStream(F);
}
}
public string SaveToCompressedBase64()
{
using (var stream = new System.IO.MemoryStream())
{
SaveToCompressedStream(stream);
stream.Position = 0;
return System.Convert.ToBase64String(stream.ToArray());
}
}
#else
public void SaveToCompressedStream(System.IO.Stream aData)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public void SaveToCompressedFile(string aFileName)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public string SaveToCompressedBase64()
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
#endif
public void SaveToBinaryFile(string aFileName)
{
System.IO.Directory.CreateDirectory((new System.IO.FileInfo(aFileName)).Directory.FullName);
using (var F = System.IO.File.OpenWrite(aFileName))
{
SaveToBinaryStream(F);
}
}
public string SaveToBinaryBase64()
{
using (var stream = new System.IO.MemoryStream())
{
SaveToBinaryStream(stream);
stream.Position = 0;
return System.Convert.ToBase64String(stream.ToArray());
}
}
public static JSONNode DeserializeBinary(System.IO.BinaryReader aReader)
{
JSONNodeType type = (JSONNodeType)aReader.ReadByte();
switch (type)
{
case JSONNodeType.Array:
{
int count = aReader.ReadInt32();
JSONArray tmp = new JSONArray();
for (int i = 0; i < count; i++)
tmp.Add(DeserializeBinary(aReader));
return tmp;
}
case JSONNodeType.Object:
{
int count = aReader.ReadInt32();
JSONObject tmp = new JSONObject();
for (int i = 0; i < count; i++)
{
string key = aReader.ReadString();
var val = DeserializeBinary(aReader);
tmp.Add(key, val);
}
return tmp;
}
case JSONNodeType.String:
{
return new JSONString(aReader.ReadString());
}
case JSONNodeType.Number:
{
return new JSONNumber(aReader.ReadDouble());
}
case JSONNodeType.Boolean:
{
return new JSONBool(aReader.ReadBoolean());
}
case JSONNodeType.NullValue:
{
return JSONNull.CreateOrGet();
}
default:
{
throw new Exception("Error deserializing JSON. Unknown tag: " + type);
}
}
}
#if USE_SharpZipLib
public static JSONNode LoadFromCompressedStream(System.IO.Stream aData)
{
var zin = new ICSharpCode.SharpZipLib.BZip2.BZip2InputStream(aData);
return LoadFromBinaryStream(zin);
}
public static JSONNode LoadFromCompressedFile(string aFileName)
{
using(var F = System.IO.File.OpenRead(aFileName))
{
return LoadFromCompressedStream(F);
}
}
public static JSONNode LoadFromCompressedBase64(string aBase64)
{
var tmp = System.Convert.FromBase64String(aBase64);
var stream = new System.IO.MemoryStream(tmp);
stream.Position = 0;
return LoadFromCompressedStream(stream);
}
#else
public static JSONNode LoadFromCompressedFile(string aFileName)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public static JSONNode LoadFromCompressedStream(System.IO.Stream aData)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
public static JSONNode LoadFromCompressedBase64(string aBase64)
{
throw new Exception("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
}
#endif
public static JSONNode LoadFromBinaryStream(System.IO.Stream aData)
{
using (var R = new System.IO.BinaryReader(aData))
{
return DeserializeBinary(R);
}
}
public static JSONNode LoadFromBinaryFile(string aFileName)
{
using (var F = System.IO.File.OpenRead(aFileName))
{
return LoadFromBinaryStream(F);
}
}
public static JSONNode LoadFromBinaryBase64(string aBase64)
{
var tmp = System.Convert.FromBase64String(aBase64);
var stream = new System.IO.MemoryStream(tmp);
stream.Position = 0;
return LoadFromBinaryStream(stream);
}
}
public partial class JSONArray : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.Array);
aWriter.Write(m_List.Count);
for (int i = 0; i < m_List.Count; i++)
{
m_List[i].SerializeBinary(aWriter);
}
}
}
public partial class JSONObject : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.Object);
aWriter.Write(m_Dict.Count);
foreach (string K in m_Dict.Keys)
{
aWriter.Write(K);
m_Dict[K].SerializeBinary(aWriter);
}
}
}
public partial class JSONString : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.String);
aWriter.Write(m_Data);
}
}
public partial class JSONNumber : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.Number);
aWriter.Write(m_Data);
}
}
public partial class JSONBool : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.Boolean);
aWriter.Write(m_Data);
}
}
public partial class JSONNull : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
aWriter.Write((byte)JSONNodeType.NullValue);
}
}
internal partial class JSONLazyCreator : JSONNode
{
public override void SerializeBinary(System.IO.BinaryWriter aWriter)
{
}
}
#endif
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 527736d8e73a6a044a27a4c3f5a713d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,516 @@
#region License and information
/* * * * *
*
* Extension file for the SimpleJSON framework for better support of some common
* .NET types. It does only work together with the SimpleJSON.cs
* It provides direct conversion support for types like decimal, char, byte,
* sbyte, short, ushort, uint, DateTime, TimeSpan and Guid. In addition there
* are conversion helpers for converting an array of number values into a byte[]
* or a List<byte> as well as converting an array of string values into a string[]
* or List<string>.
* Finally there are some additional type conversion operators for some nullable
* types like short?, int?, float?, double?, long? and bool?. They will actually
* assign a JSONNull value when it's null or a JSONNumber when it's not.
*
* The MIT License (MIT)
*
* Copyright (c) 2020 Markus Göbel (Bunny83)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* * * * */
#endregion License and information
namespace SimpleJSON
{
using System.Globalization;
using System.Collections.Generic;
public partial class JSONNode
{
#region Decimal
public virtual decimal AsDecimal
{
get
{
decimal result;
if (!decimal.TryParse(Value, out result))
result = 0;
return result;
}
set
{
Value = value.ToString();
}
}
public static implicit operator JSONNode(decimal aDecimal)
{
return new JSONString(aDecimal.ToString());
}
public static implicit operator decimal(JSONNode aNode)
{
return aNode.AsDecimal;
}
#endregion Decimal
#region Char
public virtual char AsChar
{
get
{
if (IsString && Value.Length > 0)
return Value[0];
if (IsNumber)
return (char)AsInt;
return '\0';
}
set
{
if (IsString)
Value = value.ToString();
else if (IsNumber)
AsInt = (int)value;
}
}
public static implicit operator JSONNode(char aChar)
{
return new JSONString(aChar.ToString());
}
public static implicit operator char(JSONNode aNode)
{
return aNode.AsChar;
}
#endregion Decimal
#region UInt
public virtual uint AsUInt
{
get
{
return (uint)AsDouble;
}
set
{
AsDouble = value;
}
}
public static implicit operator JSONNode(uint aUInt)
{
return new JSONNumber(aUInt);
}
public static implicit operator uint(JSONNode aNode)
{
return aNode.AsUInt;
}
#endregion UInt
#region Byte
public virtual byte AsByte
{
get
{
return (byte)AsInt;
}
set
{
AsInt = value;
}
}
public static implicit operator JSONNode(byte aByte)
{
return new JSONNumber(aByte);
}
public static implicit operator byte(JSONNode aNode)
{
return aNode.AsByte;
}
#endregion Byte
#region SByte
public virtual sbyte AsSByte
{
get
{
return (sbyte)AsInt;
}
set
{
AsInt = value;
}
}
public static implicit operator JSONNode(sbyte aSByte)
{
return new JSONNumber(aSByte);
}
public static implicit operator sbyte(JSONNode aNode)
{
return aNode.AsSByte;
}
#endregion SByte
#region Short
public virtual short AsShort
{
get
{
return (short)AsInt;
}
set
{
AsInt = value;
}
}
public static implicit operator JSONNode(short aShort)
{
return new JSONNumber(aShort);
}
public static implicit operator short(JSONNode aNode)
{
return aNode.AsShort;
}
#endregion Short
#region UShort
public virtual ushort AsUShort
{
get
{
return (ushort)AsInt;
}
set
{
AsInt = value;
}
}
public static implicit operator JSONNode(ushort aUShort)
{
return new JSONNumber(aUShort);
}
public static implicit operator ushort(JSONNode aNode)
{
return aNode.AsUShort;
}
#endregion UShort
#region DateTime
public virtual System.DateTime AsDateTime
{
get
{
System.DateTime result;
if (!System.DateTime.TryParse(Value, CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
result = new System.DateTime(0);
return result;
}
set
{
Value = value.ToString(CultureInfo.InvariantCulture);
}
}
public static implicit operator JSONNode(System.DateTime aDateTime)
{
return new JSONString(aDateTime.ToString(CultureInfo.InvariantCulture));
}
public static implicit operator System.DateTime(JSONNode aNode)
{
return aNode.AsDateTime;
}
#endregion DateTime
#region TimeSpan
public virtual System.TimeSpan AsTimeSpan
{
get
{
System.TimeSpan result;
if (!System.TimeSpan.TryParse(Value, CultureInfo.InvariantCulture, out result))
result = new System.TimeSpan(0);
return result;
}
set
{
Value = value.ToString();
}
}
public static implicit operator JSONNode(System.TimeSpan aTimeSpan)
{
return new JSONString(aTimeSpan.ToString());
}
public static implicit operator System.TimeSpan(JSONNode aNode)
{
return aNode.AsTimeSpan;
}
#endregion TimeSpan
#region Guid
public virtual System.Guid AsGuid
{
get
{
System.Guid result;
System.Guid.TryParse(Value, out result);
return result;
}
set
{
Value = value.ToString();
}
}
public static implicit operator JSONNode(System.Guid aGuid)
{
return new JSONString(aGuid.ToString());
}
public static implicit operator System.Guid(JSONNode aNode)
{
return aNode.AsGuid;
}
#endregion Guid
#region ByteArray
public virtual byte[] AsByteArray
{
get
{
if (this.IsNull || !this.IsArray)
return null;
int count = Count;
byte[] result = new byte[count];
for (int i = 0; i < count; i++)
result[i] = this[i].AsByte;
return result;
}
set
{
if (!IsArray || value == null)
return;
Clear();
for (int i = 0; i < value.Length; i++)
Add(value[i]);
}
}
public static implicit operator JSONNode(byte[] aByteArray)
{
return new JSONArray { AsByteArray = aByteArray };
}
public static implicit operator byte[](JSONNode aNode)
{
return aNode.AsByteArray;
}
#endregion ByteArray
#region ByteList
public virtual List<byte> AsByteList
{
get
{
if (this.IsNull || !this.IsArray)
return null;
int count = Count;
List<byte> result = new List<byte>(count);
for (int i = 0; i < count; i++)
result.Add(this[i].AsByte);
return result;
}
set
{
if (!IsArray || value == null)
return;
Clear();
for (int i = 0; i < value.Count; i++)
Add(value[i]);
}
}
public static implicit operator JSONNode(List<byte> aByteList)
{
return new JSONArray { AsByteList = aByteList };
}
public static implicit operator List<byte> (JSONNode aNode)
{
return aNode.AsByteList;
}
#endregion ByteList
#region StringArray
public virtual string[] AsStringArray
{
get
{
if (this.IsNull || !this.IsArray)
return null;
int count = Count;
string[] result = new string[count];
for (int i = 0; i < count; i++)
result[i] = this[i].Value;
return result;
}
set
{
if (!IsArray || value == null)
return;
Clear();
for (int i = 0; i < value.Length; i++)
Add(value[i]);
}
}
public static implicit operator JSONNode(string[] aStringArray)
{
return new JSONArray { AsStringArray = aStringArray };
}
public static implicit operator string[] (JSONNode aNode)
{
return aNode.AsStringArray;
}
#endregion StringArray
#region StringList
public virtual List<string> AsStringList
{
get
{
if (this.IsNull || !this.IsArray)
return null;
int count = Count;
List<string> result = new List<string>(count);
for (int i = 0; i < count; i++)
result.Add(this[i].Value);
return result;
}
set
{
if (!IsArray || value == null)
return;
Clear();
for (int i = 0; i < value.Count; i++)
Add(value[i]);
}
}
public static implicit operator JSONNode(List<string> aStringList)
{
return new JSONArray { AsStringList = aStringList };
}
public static implicit operator List<string> (JSONNode aNode)
{
return aNode.AsStringList;
}
#endregion StringList
#region NullableTypes
public static implicit operator JSONNode(int? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONNumber((int)aValue);
}
public static implicit operator int?(JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsInt;
}
public static implicit operator JSONNode(float? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONNumber((float)aValue);
}
public static implicit operator float? (JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsFloat;
}
public static implicit operator JSONNode(double? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONNumber((double)aValue);
}
public static implicit operator double? (JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsDouble;
}
public static implicit operator JSONNode(bool? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONBool((bool)aValue);
}
public static implicit operator bool? (JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsBool;
}
public static implicit operator JSONNode(long? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONNumber((long)aValue);
}
public static implicit operator long? (JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsLong;
}
public static implicit operator JSONNode(short? aValue)
{
if (aValue == null)
return JSONNull.CreateOrGet();
return new JSONNumber((short)aValue);
}
public static implicit operator short? (JSONNode aNode)
{
if (aNode == null || aNode.IsNull)
return null;
return aNode.AsShort;
}
#endregion NullableTypes
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3ed716432925e134a8ab90917c118c9d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,462 @@
#if UNITY_5_3_OR_NEWER
#region License and information
/* * * * *
*
* Unity extension for the SimpleJSON framework. It does only work together with
* the SimpleJSON.cs
* It provides several helpers and conversion operators to serialize/deserialize
* common Unity types such as Vector2/3/4, Rect, RectOffset, Quaternion and
* Matrix4x4 as JSONObject or JSONArray.
* This extension will add 3 static settings to the JSONNode class:
* ( VectorContainerType, QuaternionContainerType, RectContainerType ) which
* control what node type should be used for serializing the given type. So a
* Vector3 as array would look like [12,32,24] and {"x":12, "y":32, "z":24} as
* object.
*
*
* The MIT License (MIT)
*
* Copyright (c) 2012-2017 Markus Göbel (Bunny83)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* * * * */
#endregion License and information
using UnityEngine;
namespace SimpleJSON
{
public enum JSONContainerType { Array, Object }
public partial class JSONNode
{
public static byte Color32DefaultAlpha = 255;
public static float ColorDefaultAlpha = 1f;
public static JSONContainerType VectorContainerType = JSONContainerType.Array;
public static JSONContainerType QuaternionContainerType = JSONContainerType.Array;
public static JSONContainerType RectContainerType = JSONContainerType.Array;
public static JSONContainerType ColorContainerType = JSONContainerType.Array;
private static JSONNode GetContainer(JSONContainerType aType)
{
if (aType == JSONContainerType.Array)
return new JSONArray();
return new JSONObject();
}
#region implicit conversion operators
public static implicit operator JSONNode(Vector2 aVec)
{
JSONNode n = GetContainer(VectorContainerType);
n.WriteVector2(aVec);
return n;
}
public static implicit operator JSONNode(Vector3 aVec)
{
JSONNode n = GetContainer(VectorContainerType);
n.WriteVector3(aVec);
return n;
}
public static implicit operator JSONNode(Vector4 aVec)
{
JSONNode n = GetContainer(VectorContainerType);
n.WriteVector4(aVec);
return n;
}
public static implicit operator JSONNode(Color aCol)
{
JSONNode n = GetContainer(ColorContainerType);
n.WriteColor(aCol);
return n;
}
public static implicit operator JSONNode(Color32 aCol)
{
JSONNode n = GetContainer(ColorContainerType);
n.WriteColor32(aCol);
return n;
}
public static implicit operator JSONNode(Quaternion aRot)
{
JSONNode n = GetContainer(QuaternionContainerType);
n.WriteQuaternion(aRot);
return n;
}
public static implicit operator JSONNode(Rect aRect)
{
JSONNode n = GetContainer(RectContainerType);
n.WriteRect(aRect);
return n;
}
public static implicit operator JSONNode(RectOffset aRect)
{
JSONNode n = GetContainer(RectContainerType);
n.WriteRectOffset(aRect);
return n;
}
public static implicit operator Vector2(JSONNode aNode)
{
return aNode.ReadVector2();
}
public static implicit operator Vector3(JSONNode aNode)
{
return aNode.ReadVector3();
}
public static implicit operator Vector4(JSONNode aNode)
{
return aNode.ReadVector4();
}
public static implicit operator Color(JSONNode aNode)
{
return aNode.ReadColor();
}
public static implicit operator Color32(JSONNode aNode)
{
return aNode.ReadColor32();
}
public static implicit operator Quaternion(JSONNode aNode)
{
return aNode.ReadQuaternion();
}
public static implicit operator Rect(JSONNode aNode)
{
return aNode.ReadRect();
}
public static implicit operator RectOffset(JSONNode aNode)
{
return aNode.ReadRectOffset();
}
#endregion implicit conversion operators
#region Vector2
public Vector2 ReadVector2(Vector2 aDefault)
{
if (IsObject)
return new Vector2(this["x"].AsFloat, this["y"].AsFloat);
if (IsArray)
return new Vector2(this[0].AsFloat, this[1].AsFloat);
return aDefault;
}
public Vector2 ReadVector2(string aXName, string aYName)
{
if (IsObject)
{
return new Vector2(this[aXName].AsFloat, this[aYName].AsFloat);
}
return Vector2.zero;
}
public Vector2 ReadVector2()
{
return ReadVector2(Vector2.zero);
}
public JSONNode WriteVector2(Vector2 aVec, string aXName = "x", string aYName = "y")
{
if (IsObject)
{
Inline = true;
this[aXName].AsFloat = aVec.x;
this[aYName].AsFloat = aVec.y;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
}
return this;
}
#endregion Vector2
#region Vector3
public Vector3 ReadVector3(Vector3 aDefault)
{
if (IsObject)
return new Vector3(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat);
if (IsArray)
return new Vector3(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat);
return aDefault;
}
public Vector3 ReadVector3(string aXName, string aYName, string aZName)
{
if (IsObject)
return new Vector3(this[aXName].AsFloat, this[aYName].AsFloat, this[aZName].AsFloat);
return Vector3.zero;
}
public Vector3 ReadVector3()
{
return ReadVector3(Vector3.zero);
}
public JSONNode WriteVector3(Vector3 aVec, string aXName = "x", string aYName = "y", string aZName = "z")
{
if (IsObject)
{
Inline = true;
this[aXName].AsFloat = aVec.x;
this[aYName].AsFloat = aVec.y;
this[aZName].AsFloat = aVec.z;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
this[2].AsFloat = aVec.z;
}
return this;
}
#endregion Vector3
#region Vector4
public Vector4 ReadVector4(Vector4 aDefault)
{
if (IsObject)
return new Vector4(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat, this["w"].AsFloat);
if (IsArray)
return new Vector4(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
return aDefault;
}
public Vector4 ReadVector4()
{
return ReadVector4(Vector4.zero);
}
public JSONNode WriteVector4(Vector4 aVec)
{
if (IsObject)
{
Inline = true;
this["x"].AsFloat = aVec.x;
this["y"].AsFloat = aVec.y;
this["z"].AsFloat = aVec.z;
this["w"].AsFloat = aVec.w;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aVec.x;
this[1].AsFloat = aVec.y;
this[2].AsFloat = aVec.z;
this[3].AsFloat = aVec.w;
}
return this;
}
#endregion Vector4
#region Color / Color32
public Color ReadColor(Color aDefault)
{
if (IsObject)
return new Color(this["r"].AsFloat, this["g"].AsFloat, this["b"].AsFloat, HasKey("a")?this["a"].AsFloat:ColorDefaultAlpha);
if (IsArray)
return new Color(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, (Count>3)?this[3].AsFloat:ColorDefaultAlpha);
return aDefault;
}
public Color ReadColor()
{
return ReadColor(Color.clear);
}
public JSONNode WriteColor(Color aCol)
{
if (IsObject)
{
Inline = true;
this["r"].AsFloat = aCol.r;
this["g"].AsFloat = aCol.g;
this["b"].AsFloat = aCol.b;
this["a"].AsFloat = aCol.a;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aCol.r;
this[1].AsFloat = aCol.g;
this[2].AsFloat = aCol.b;
this[3].AsFloat = aCol.a;
}
return this;
}
public Color32 ReadColor32(Color32 aDefault)
{
if (IsObject)
return new Color32((byte)this["r"].AsInt, (byte)this["g"].AsInt, (byte)this["b"].AsInt, (byte)(HasKey("a")?this["a"].AsInt:Color32DefaultAlpha));
if (IsArray)
return new Color32((byte)this[0].AsInt, (byte)this[1].AsInt, (byte)this[2].AsInt, (byte)((Count>3)?this[3].AsInt:Color32DefaultAlpha));
return aDefault;
}
public Color32 ReadColor32()
{
return ReadColor32(new Color32());
}
public JSONNode WriteColor32(Color32 aCol)
{
if (IsObject)
{
Inline = true;
this["r"].AsInt = aCol.r;
this["g"].AsInt = aCol.g;
this["b"].AsInt = aCol.b;
this["a"].AsInt = aCol.a;
}
else if (IsArray)
{
Inline = true;
this[0].AsInt = aCol.r;
this[1].AsInt = aCol.g;
this[2].AsInt = aCol.b;
this[3].AsInt = aCol.a;
}
return this;
}
#endregion Color / Color32
#region Quaternion
public Quaternion ReadQuaternion(Quaternion aDefault)
{
if (IsObject)
return new Quaternion(this["x"].AsFloat, this["y"].AsFloat, this["z"].AsFloat, this["w"].AsFloat);
if (IsArray)
return new Quaternion(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
return aDefault;
}
public Quaternion ReadQuaternion()
{
return ReadQuaternion(Quaternion.identity);
}
public JSONNode WriteQuaternion(Quaternion aRot)
{
if (IsObject)
{
Inline = true;
this["x"].AsFloat = aRot.x;
this["y"].AsFloat = aRot.y;
this["z"].AsFloat = aRot.z;
this["w"].AsFloat = aRot.w;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aRot.x;
this[1].AsFloat = aRot.y;
this[2].AsFloat = aRot.z;
this[3].AsFloat = aRot.w;
}
return this;
}
#endregion Quaternion
#region Rect
public Rect ReadRect(Rect aDefault)
{
if (IsObject)
return new Rect(this["x"].AsFloat, this["y"].AsFloat, this["width"].AsFloat, this["height"].AsFloat);
if (IsArray)
return new Rect(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
return aDefault;
}
public Rect ReadRect()
{
return ReadRect(new Rect());
}
public JSONNode WriteRect(Rect aRect)
{
if (IsObject)
{
Inline = true;
this["x"].AsFloat = aRect.x;
this["y"].AsFloat = aRect.y;
this["width"].AsFloat = aRect.width;
this["height"].AsFloat = aRect.height;
}
else if (IsArray)
{
Inline = true;
this[0].AsFloat = aRect.x;
this[1].AsFloat = aRect.y;
this[2].AsFloat = aRect.width;
this[3].AsFloat = aRect.height;
}
return this;
}
#endregion Rect
#region RectOffset
public RectOffset ReadRectOffset(RectOffset aDefault)
{
if (this is JSONObject)
return new RectOffset(this["left"].AsInt, this["right"].AsInt, this["top"].AsInt, this["bottom"].AsInt);
if (this is JSONArray)
return new RectOffset(this[0].AsInt, this[1].AsInt, this[2].AsInt, this[3].AsInt);
return aDefault;
}
public RectOffset ReadRectOffset()
{
return ReadRectOffset(new RectOffset());
}
public JSONNode WriteRectOffset(RectOffset aRect)
{
if (IsObject)
{
Inline = true;
this["left"].AsInt = aRect.left;
this["right"].AsInt = aRect.right;
this["top"].AsInt = aRect.top;
this["bottom"].AsInt = aRect.bottom;
}
else if (IsArray)
{
Inline = true;
this[0].AsInt = aRect.left;
this[1].AsInt = aRect.right;
this[2].AsInt = aRect.top;
this[3].AsInt = aRect.bottom;
}
return this;
}
#endregion RectOffset
#region Matrix4x4
public Matrix4x4 ReadMatrix()
{
Matrix4x4 result = Matrix4x4.identity;
if (IsArray)
{
for (int i = 0; i < 16; i++)
{
result[i] = this[i].AsFloat;
}
}
return result;
}
public JSONNode WriteMatrix(Matrix4x4 aMatrix)
{
if (IsArray)
{
Inline = true;
for (int i = 0; i < 16; i++)
{
this[i].AsFloat = aMatrix[i];
}
}
return this;
}
#endregion Matrix4x4
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03ae607b1bfdb9043ba6bba186e06165
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
using System.Collections.Generic;
using System.Text;
namespace Bright.Common
{
public static class StringUtil
{
public static string ToStr(object o)
{
return ToStr(o, new StringBuilder());
}
public static string ToStr(object o, StringBuilder sb)
{
foreach (var p in o.GetType().GetFields())
{
sb.Append($"{p.Name} = {p.GetValue(o)},");
}
foreach (var p in o.GetType().GetProperties())
{
sb.Append($"{p.Name} = {p.GetValue(o)},");
}
return sb.ToString();
}
public static string ArrayToString<T>(T[] arr)
{
return "[" + string.Join(",", arr) + "]";
}
public static string CollectionToString<T>(IEnumerable<T> arr)
{
return "[" + string.Join(",", arr) + "]";
}
public static string CollectionToString<TK, TV>(IDictionary<TK, TV> dic)
{
var sb = new StringBuilder('{');
foreach (var e in dic)
{
sb.Append(e.Key).Append(':');
sb.Append(e.Value).Append(',');
}
sb.Append('}');
return sb.ToString();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aab76bc328e69914394493ca645f6988
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 261cb86a396ea4e4884d3a8048aceb9e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,415 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!241 &24100000
AudioMixerController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: AudioMixer
m_OutputGroup: {fileID: 0}
m_MasterGroup: {fileID: 24300001}
m_Snapshots:
- {fileID: 24500003}
m_StartSnapshot: {fileID: 24500003}
m_SuspendThreshold: -80
m_EnableSuspend: 1
m_UpdateMode: 0
m_ExposedParameters: []
m_AudioMixerGroupViews:
- guids:
- 8a5e3c3ba4888544fb60c42cf8e09967
- 160fccef83772ba4ba230254a8550a7f
- 867c8e0f47093374ebcaac2c987f793b
- 6d1a380bc9dd3f9419b15e7ebc5c685a
- 1fa2b24e8fa2ab44da6b736c6b69e39d
- 00a460acccbeac742a73e52befc575a7
- 79d2503840615b649bc92fb576713dbd
- 528e752989911d248b7dcbef7f1507ed
- 6fe43d36061d5524ba35671cf9fb0ba8
- d04e746ae07ef14459e5fb5e0dc16c71
- 452a895339109c64396d99ebc8b9be69
- 4eae43e074960204bb5cd44ec6aa8995
name: View
m_CurrentViewIndex: 0
m_TargetSnapshot: {fileID: 24500003}
--- !u!243 &24300001
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Master
m_AudioMixer: {fileID: 24100000}
m_GroupID: 8a5e3c3ba4888544fb60c42cf8e09967
m_Children:
- {fileID: 24379484}
- {fileID: 24302904}
- {fileID: 24387166}
m_Volume: 395141a4fa3844d43889bdb6a8069296
m_Pitch: 11316f08788c67243b0bcb1ffe96b68d
m_Effects:
- {fileID: 24400002}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24302904
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Sound
m_AudioMixer: {fileID: 24100000}
m_GroupID: 867c8e0f47093374ebcaac2c987f793b
m_Children:
- {fileID: 24367036}
- {fileID: 24343976}
- {fileID: 24357292}
- {fileID: 24391798}
m_Volume: c48cf9e85f38efb40b87a6ee32814d12
m_Pitch: cc7d3a20aefbbd34c988ad7abad44062
m_Effects:
- {fileID: 24489248}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24315210
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 1
m_AudioMixer: {fileID: 24100000}
m_GroupID: 6fe43d36061d5524ba35671cf9fb0ba8
m_Children: []
m_Volume: 3a139d66d2f3c784b9d5e753fec00667
m_Pitch: 4e1c6fb713ccfff488fed4d276d843d4
m_Effects:
- {fileID: 24435296}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24343976
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 1
m_AudioMixer: {fileID: 24100000}
m_GroupID: 1fa2b24e8fa2ab44da6b736c6b69e39d
m_Children: []
m_Volume: ed28a7635ab0bb340a5665f156be3ba2
m_Pitch: 93e175d11861ed44693c4de3d1dfd0e5
m_Effects:
- {fileID: 24439702}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24357292
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 2
m_AudioMixer: {fileID: 24100000}
m_GroupID: 00a460acccbeac742a73e52befc575a7
m_Children: []
m_Volume: 1a2c14ec670b45240afe05419dce2f83
m_Pitch: 051a281f9cef07b48b6115f92e7ca07e
m_Effects:
- {fileID: 24473274}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24367036
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 0
m_AudioMixer: {fileID: 24100000}
m_GroupID: 6d1a380bc9dd3f9419b15e7ebc5c685a
m_Children: []
m_Volume: 826a3f833bcd55e4b85f3910ab1fcca2
m_Pitch: 8a1be3b2accbf6046911ccf02317b9d0
m_Effects:
- {fileID: 24409188}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24374858
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 2
m_AudioMixer: {fileID: 24100000}
m_GroupID: d04e746ae07ef14459e5fb5e0dc16c71
m_Children: []
m_Volume: 53955d9c33630ad4bbd584245387610c
m_Pitch: 08bc99fca5e21ad4ca2281a26d22d603
m_Effects:
- {fileID: 24415236}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24375398
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 3
m_AudioMixer: {fileID: 24100000}
m_GroupID: 452a895339109c64396d99ebc8b9be69
m_Children: []
m_Volume: 6d0c2ba3dfe81c64a8168eaf8cb979b8
m_Pitch: 1c3e45e2b43fe894b9416639a2649958
m_Effects:
- {fileID: 24434744}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24377080
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 0
m_AudioMixer: {fileID: 24100000}
m_GroupID: 528e752989911d248b7dcbef7f1507ed
m_Children: []
m_Volume: 123025e4c7c0e554c9f6d6bc1b3fbc77
m_Pitch: e9f9047e46520a2488d63f376e250fd5
m_Effects:
- {fileID: 24467928}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24379484
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Music
m_AudioMixer: {fileID: 24100000}
m_GroupID: 160fccef83772ba4ba230254a8550a7f
m_Children: []
m_Volume: 5c6b3018726f578439e2ffc2a2699659
m_Pitch: 1f9a468138008494e99d93d1492d2d2d
m_Effects:
- {fileID: 24434106}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24387166
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UISound
m_AudioMixer: {fileID: 24100000}
m_GroupID: 4eae43e074960204bb5cd44ec6aa8995
m_Children:
- {fileID: 24377080}
- {fileID: 24315210}
- {fileID: 24374858}
- {fileID: 24375398}
m_Volume: 259c8cab700e5054b90a4c436aa9dbaa
m_Pitch: 62833d02f1ae1004189dafbecb776876
m_Effects:
- {fileID: 24425112}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!243 &24391798
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: 3
m_AudioMixer: {fileID: 24100000}
m_GroupID: 79d2503840615b649bc92fb576713dbd
m_Children: []
m_Volume: 1826ad84da2bc184aa1c1cf638110b2c
m_Pitch: 62f786f4ed7eaeb4eb873e84cd4acef5
m_Effects:
- {fileID: 24425178}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!244 &24400002
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_EffectID: 491cbf7854837e144bc3560590a7d822
m_EffectName: Attenuation
m_MixLevel: 20e1d9c971c4b8b4291f83fd0e476cbc
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24409188
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_EffectID: b77fb195be8459742b29cc98e1f5917d
m_EffectName: Attenuation
m_MixLevel: 667ff9ce44dc1f641985c633b4c61a89
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24415236
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: 686cf9964bf072d489573880e1caacc4
m_EffectName: Attenuation
m_MixLevel: c6e4da47d5135364d856abcdb79c854b
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24425112
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: a484d4fccfe70b0409e1f4dd2c87648b
m_EffectName: Attenuation
m_MixLevel: 7158168627f558543a28925969c2be1a
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24425178
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: c5acd505b4e335e4a93860f18c380916
m_EffectName: Attenuation
m_MixLevel: 9d409a5ff0aacc342965b25006706804
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24434106
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_EffectID: 2cacbff4660331449ad79b3b0a29f114
m_EffectName: Attenuation
m_MixLevel: 8791ffee31c792c40a9d5c2834f893b6
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24434744
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: eb1f3be358602a446881583e889b9dce
m_EffectName: Attenuation
m_MixLevel: 2430ea18a7e6c2543860747f489a6747
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24435296
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: 05bda5e2032dae240a34e252fa629cab
m_EffectName: Attenuation
m_MixLevel: de2a5d58be3b6ea4f99dc5ecaf7b34b3
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24439702
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: e96761f494e22ec4bb95f6c4c69a81e3
m_EffectName: Attenuation
m_MixLevel: 53c7a2925014d7141b81deead5900deb
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24467928
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: 107756d9ceff73c4eb7e24c4015f49af
m_EffectName: Attenuation
m_MixLevel: cbb295bb1f83ee844b5fe421a69a1b86
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24473274
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: 0f20f30c1f379d44f86056174d8a8fe1
m_EffectName: Attenuation
m_MixLevel: 118b9c139b92282439916745f10f6898
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24489248
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Attenuation
m_EffectID: e3266aa86a4cdab48bca8db85ecd6c48
m_EffectName: Attenuation
m_MixLevel: 16c2452fadb847a40a5361ef769ced7a
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!245 &24500003
AudioMixerSnapshotController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Snapshot
m_AudioMixer: {fileID: 24100000}
m_SnapshotID: 94391cc7a50443d40bfb1ee6b9835ebe
m_FloatValues: {}
m_TransitionOverrides: {}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f5b0f1b1b7760c458f2fefab02f273b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a06a4c0455d3ccb45baf4d805cab535a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 738e5140108e4014dad86602ea769469
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bd1afdce9715f84eb4cbc901922afc2, type: 3}
m_Name: YooAssetSettings
m_EditorClassIdentifier:
ManifestFileName: PackageManifest

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 97d55be15f5f159469b387d21bfbf4e3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fe7b97f72e8ba424e8e0ad64e8803222
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
{
"name": "TEngine.Runtime"
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: aa06d4cc755c979489c256c1bcca1dfb
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: