new env int
This commit is contained in:
parent
dfc221d77e
commit
36da1f016f
BIN
Assets/GLTFUtility-master/.DS_Store
vendored
BIN
Assets/GLTFUtility-master/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
||||||
root = true
|
|
||||||
|
|
||||||
[*.cs]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = false
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
21
Assets/GLTFUtility-master/.gitignore
vendored
21
Assets/GLTFUtility-master/.gitignore
vendored
|
|
@ -1,21 +0,0 @@
|
||||||
/[Ll]ibrary/
|
|
||||||
/[Tt]emp/
|
|
||||||
/[Oo]bj/
|
|
||||||
/[Bb]uild/
|
|
||||||
|
|
||||||
# Autogenerated VS/MD solution and project files
|
|
||||||
*.csproj
|
|
||||||
*.unityproj
|
|
||||||
*.sln
|
|
||||||
*.suo
|
|
||||||
*.tmp
|
|
||||||
*.user
|
|
||||||
*.userprefs
|
|
||||||
*.pidb
|
|
||||||
*.booproj
|
|
||||||
|
|
||||||
# Unity3D generated meta files
|
|
||||||
*.pidb.meta
|
|
||||||
|
|
||||||
# Unity3D Generated File On Crash Reports
|
|
||||||
sysinfo.txt
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Siccity.GLTFUtility",
|
|
||||||
"references": [
|
|
||||||
"Dracodec"
|
|
||||||
],
|
|
||||||
"optionalUnityReferences": [],
|
|
||||||
"includePlatforms": [],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": false,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018 Thor Brigsted
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: bad78d655a8373f48b9b15f2b3225be4
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
Shader "GLTFUtility/Standard Transparent (Metallic)" {
|
|
||||||
Properties {
|
|
||||||
_Color ("Color", Color) = (1,1,1,1)
|
|
||||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
|
||||||
_MetallicGlossMap ("Metallic (B) Gloss (G)", 2D) = "white" {}
|
|
||||||
_Roughness ("Roughness", Range(0,1)) = 1
|
|
||||||
_Metallic ("Metallic", Range(0,1)) = 1
|
|
||||||
[Normal] _BumpMap ("Normal", 2D) = "bump" {}
|
|
||||||
_BumpScale("NormalScale", Float) = 1.0
|
|
||||||
_OcclusionMap ("Occlusion (R)", 2D) = "white" {}
|
|
||||||
_EmissionMap ("Emission", 2D) = "black" {}
|
|
||||||
_EmissionColor ("Emission Color", Color) = (0,0,0,0)
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
|
|
||||||
LOD 200
|
|
||||||
|
|
||||||
CGPROGRAM
|
|
||||||
// Physically based Standard lighting model, and enable shadows on all light types
|
|
||||||
#pragma surface surf Standard fullforwardshadows alpha:fade
|
|
||||||
// Use shader model 3.0 target, to get nicer looking lighting
|
|
||||||
#pragma target 3.0
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
sampler2D _MetallicGlossMap;
|
|
||||||
sampler2D _BumpMap;
|
|
||||||
sampler2D _OcclusionMap;
|
|
||||||
sampler2D _EmissionMap;
|
|
||||||
|
|
||||||
struct Input {
|
|
||||||
float2 uv_MainTex;
|
|
||||||
float2 uv_BumpMap;
|
|
||||||
float2 uv_MetallicGlossMap;
|
|
||||||
float2 uv_OcclusionMap;
|
|
||||||
float2 uv_EmissionMap;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
half _Roughness;
|
|
||||||
half _Metallic;
|
|
||||||
half _AlphaCutoff;
|
|
||||||
half _BumpScale;
|
|
||||||
fixed4 _Color;
|
|
||||||
fixed4 _EmissionColor;
|
|
||||||
|
|
||||||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
|
|
||||||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
|
|
||||||
// #pragma instancing_options assumeuniformscaling
|
|
||||||
UNITY_INSTANCING_BUFFER_START(Props)
|
|
||||||
// put more per-instance properties here
|
|
||||||
UNITY_INSTANCING_BUFFER_END(Props)
|
|
||||||
|
|
||||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
|
||||||
// Albedo comes from a texture tinted by color
|
|
||||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
||||||
o.Albedo = c.rgb * IN.color;
|
|
||||||
o.Alpha = c.a;
|
|
||||||
// Metallic comes from blue channel tinted by slider variables
|
|
||||||
fixed4 m = tex2D (_MetallicGlossMap, IN.uv_MetallicGlossMap);
|
|
||||||
o.Metallic = m.b * _Metallic;
|
|
||||||
// Smoothness comes from blue channel tinted by slider variables
|
|
||||||
o.Smoothness = 1 - (m.g * _Roughness);
|
|
||||||
// Normal comes from a bump map
|
|
||||||
o.Normal = UnpackScaleNormal(tex2D (_BumpMap, IN.uv_BumpMap), _BumpScale);
|
|
||||||
// Ambient Occlusion comes from red channel
|
|
||||||
o.Occlusion = tex2D (_OcclusionMap, IN.uv_OcclusionMap).r;
|
|
||||||
// Emission comes from a texture tinted by color
|
|
||||||
o.Emission = tex2D (_EmissionMap, IN.uv_EmissionMap) * _EmissionColor;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
FallBack "Diffuse"
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 7258d825fa9aac6439f21eb173b880c6
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
Shader "GLTFUtility/Standard (Metallic)" {
|
|
||||||
Properties {
|
|
||||||
_Color ("Color", Color) = (1,1,1,1)
|
|
||||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
|
||||||
_MetallicGlossMap ("Metallic (B) Gloss (G)", 2D) = "white" {}
|
|
||||||
_Roughness ("Roughness", Range(0,1)) = 1
|
|
||||||
_Metallic ("Metallic", Range(0,1)) = 1
|
|
||||||
[Normal] _BumpMap ("Normal", 2D) = "bump" {}
|
|
||||||
_BumpScale("NormalScale", Float) = 1.0
|
|
||||||
_OcclusionMap ("Occlusion (R)", 2D) = "white" {}
|
|
||||||
_EmissionMap ("Emission", 2D) = "black" {}
|
|
||||||
_EmissionColor ("Emission Color", Color) = (0,0,0,0)
|
|
||||||
_AlphaCutoff ("Alpha Cutoff", Range(0,1)) = 0
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "RenderType"="Opaque" }
|
|
||||||
LOD 200
|
|
||||||
|
|
||||||
CGPROGRAM
|
|
||||||
// Physically based Standard lighting model, and enable shadows on all light types
|
|
||||||
#pragma surface surf Standard fullforwardshadows
|
|
||||||
// Use shader model 3.0 target, to get nicer looking lighting
|
|
||||||
#pragma target 3.0
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
sampler2D _MetallicGlossMap;
|
|
||||||
sampler2D _BumpMap;
|
|
||||||
sampler2D _OcclusionMap;
|
|
||||||
sampler2D _EmissionMap;
|
|
||||||
|
|
||||||
struct Input {
|
|
||||||
float2 uv_MainTex;
|
|
||||||
float2 uv_BumpMap;
|
|
||||||
float2 uv_MetallicGlossMap;
|
|
||||||
float2 uv_OcclusionMap;
|
|
||||||
float2 uv_EmissionMap;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
half _Roughness;
|
|
||||||
half _Metallic;
|
|
||||||
half _AlphaCutoff;
|
|
||||||
half _BumpScale;
|
|
||||||
fixed4 _Color;
|
|
||||||
fixed4 _EmissionColor;
|
|
||||||
|
|
||||||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
|
|
||||||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
|
|
||||||
// #pragma instancing_options assumeuniformscaling
|
|
||||||
UNITY_INSTANCING_BUFFER_START(Props)
|
|
||||||
// put more per-instance properties here
|
|
||||||
UNITY_INSTANCING_BUFFER_END(Props)
|
|
||||||
|
|
||||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
|
||||||
// Albedo comes from a texture tinted by color
|
|
||||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
||||||
o.Albedo = c.rgb * IN.color;
|
|
||||||
clip(c.a - _AlphaCutoff);
|
|
||||||
// Metallic comes from blue channel tinted by slider variables
|
|
||||||
fixed4 m = tex2D (_MetallicGlossMap, IN.uv_MetallicGlossMap);
|
|
||||||
o.Metallic = m.b * _Metallic;
|
|
||||||
// Smoothness comes from blue channel tinted by slider variables
|
|
||||||
o.Smoothness = 1 - (m.g * _Roughness);
|
|
||||||
// Normal comes from a bump map
|
|
||||||
o.Normal = UnpackScaleNormal (tex2D (_BumpMap, IN.uv_BumpMap), _BumpScale);
|
|
||||||
// Ambient Occlusion comes from red channel
|
|
||||||
o.Occlusion = tex2D (_OcclusionMap, IN.uv_OcclusionMap).r;
|
|
||||||
// Emission comes from a texture tinted by color
|
|
||||||
o.Emission = tex2D (_EmissionMap, IN.uv_EmissionMap) * _EmissionColor;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
FallBack "Diffuse"
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 057d08f5d01be134593d0fe0e40c1759
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
Shader "GLTFUtility/Standard Transparent (Specular)" {
|
|
||||||
Properties {
|
|
||||||
_Color ("Color", Color) = (1,1,1,1)
|
|
||||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
|
||||||
_SpecGlossMap ("Specular Map", 2D) = "white" {}
|
|
||||||
_SpecColor ("Specular Color", Color) = (1,1,1,1)
|
|
||||||
_GlossyReflections ("Glossiness", Range(0,1)) = 1
|
|
||||||
[Normal] _BumpMap ("Normal", 2D) = "bump" {}
|
|
||||||
_BumpScale("NormalScale", Float) = 1.0
|
|
||||||
_OcclusionMap ("Occlusion", 2D) = "white" {}
|
|
||||||
_EmissionMap ("Emission", 2D) = "black" {}
|
|
||||||
_EmissionColor ("Emission Color", Color) = (0,0,0,0)
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
|
|
||||||
LOD 200
|
|
||||||
|
|
||||||
CGPROGRAM
|
|
||||||
// Physically based StandardSpecular lighting model, and enable shadows on all light types
|
|
||||||
#pragma surface surf StandardSpecular fullforwardshadows alpha:fade
|
|
||||||
|
|
||||||
// Use shader model 3.0 target, to get nicer looking lighting
|
|
||||||
#pragma target 3.0
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
sampler2D _SpecGlossMap;
|
|
||||||
sampler2D _BumpMap;
|
|
||||||
sampler2D _OcclusionMap;
|
|
||||||
sampler2D _EmissionMap;
|
|
||||||
|
|
||||||
struct Input {
|
|
||||||
float2 uv_MainTex;
|
|
||||||
float2 uv_BumpMap;
|
|
||||||
float2 uv_SpecGlossMap;
|
|
||||||
float2 uv_OcclusionMap;
|
|
||||||
float2 uv_EmissionMap;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
half _GlossyReflections;
|
|
||||||
half _BumpScale;
|
|
||||||
fixed4 _Color;
|
|
||||||
fixed4 _EmissionColor;
|
|
||||||
|
|
||||||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
|
|
||||||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
|
|
||||||
// #pragma instancing_options assumeuniformscaling
|
|
||||||
UNITY_INSTANCING_BUFFER_START(Props)
|
|
||||||
// put more per-instance properties here
|
|
||||||
UNITY_INSTANCING_BUFFER_END(Props)
|
|
||||||
|
|
||||||
void surf (Input IN, inout SurfaceOutputStandardSpecular o) {
|
|
||||||
// Albedo comes from a texture tinted by color
|
|
||||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
||||||
o.Albedo = c.rgb * IN.color;
|
|
||||||
o.Alpha = c.a;
|
|
||||||
// Specular / roughness
|
|
||||||
fixed4 s = tex2D (_SpecGlossMap, IN.uv_SpecGlossMap);
|
|
||||||
o.Specular = s.rgb * _SpecColor;
|
|
||||||
o.Smoothness = s.a * _GlossyReflections;
|
|
||||||
// Normal comes from a bump map
|
|
||||||
o.Normal = UnpackScaleNormal (tex2D (_BumpMap, IN.uv_BumpMap), _BumpScale);
|
|
||||||
// Ambient Occlusion comes from red channel
|
|
||||||
o.Occlusion = tex2D (_OcclusionMap, IN.uv_OcclusionMap).r;
|
|
||||||
// Emission comes from a texture tinted by color
|
|
||||||
o.Emission = tex2D (_EmissionMap, IN.uv_EmissionMap) * _EmissionColor;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
FallBack "Diffuse"
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 475158e3052e5c4488fa32f8df9d7be7
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
Shader "GLTFUtility/Standard (Specular)" {
|
|
||||||
Properties {
|
|
||||||
_Color ("Color", Color) = (1,1,1,1)
|
|
||||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
|
||||||
_SpecGlossMap ("Specular Map", 2D) = "white" {}
|
|
||||||
_SpecColor ("Specular Color", Color) = (1,1,1,1)
|
|
||||||
_GlossyReflections ("Glossiness", Range(0,1)) = 1
|
|
||||||
[Normal] _BumpMap ("Normal", 2D) = "bump" {}
|
|
||||||
_BumpScale("NormalScale", Float) = 1.0
|
|
||||||
_OcclusionMap ("Occlusion", 2D) = "white" {}
|
|
||||||
_EmissionMap ("Emission", 2D) = "black" {}
|
|
||||||
_EmissionColor ("Emission Color", Color) = (0,0,0,0)
|
|
||||||
_AlphaCutoff ("Alpha Cutoff", Range(0,1)) = 0
|
|
||||||
}
|
|
||||||
SubShader {
|
|
||||||
Tags { "RenderType"="Opaque" }
|
|
||||||
LOD 200
|
|
||||||
|
|
||||||
CGPROGRAM
|
|
||||||
// Physically based StandardSpecular lighting model, and enable shadows on all light types
|
|
||||||
#pragma surface surf StandardSpecular fullforwardshadows
|
|
||||||
|
|
||||||
// Use shader model 3.0 target, to get nicer looking lighting
|
|
||||||
#pragma target 3.0
|
|
||||||
|
|
||||||
sampler2D _MainTex;
|
|
||||||
sampler2D _SpecGlossMap;
|
|
||||||
sampler2D _BumpMap;
|
|
||||||
sampler2D _OcclusionMap;
|
|
||||||
sampler2D _EmissionMap;
|
|
||||||
|
|
||||||
struct Input {
|
|
||||||
float2 uv_MainTex;
|
|
||||||
float2 uv_BumpMap;
|
|
||||||
float2 uv_SpecGlossMap;
|
|
||||||
float2 uv_OcclusionMap;
|
|
||||||
float2 uv_EmissionMap;
|
|
||||||
float4 color : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
half _GlossyReflections;
|
|
||||||
half _AlphaCutoff;
|
|
||||||
half _BumpScale;
|
|
||||||
fixed4 _Color;
|
|
||||||
fixed4 _EmissionColor;
|
|
||||||
|
|
||||||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
|
|
||||||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
|
|
||||||
// #pragma instancing_options assumeuniformscaling
|
|
||||||
UNITY_INSTANCING_BUFFER_START(Props)
|
|
||||||
// put more per-instance properties here
|
|
||||||
UNITY_INSTANCING_BUFFER_END(Props)
|
|
||||||
|
|
||||||
void surf (Input IN, inout SurfaceOutputStandardSpecular o) {
|
|
||||||
// Albedo comes from a texture tinted by color
|
|
||||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
||||||
o.Albedo = c.rgb * IN.color;
|
|
||||||
clip(c.a - _AlphaCutoff);
|
|
||||||
// Specular / roughness
|
|
||||||
fixed4 s = tex2D (_SpecGlossMap, IN.uv_SpecGlossMap);
|
|
||||||
o.Specular = s.rgb * _SpecColor;
|
|
||||||
o.Smoothness = s.a * _GlossyReflections;
|
|
||||||
// Normal comes from a bump map
|
|
||||||
o.Normal = UnpackScaleNormal (tex2D (_BumpMap, IN.uv_BumpMap), _BumpScale);
|
|
||||||
// Ambient Occlusion comes from red channel
|
|
||||||
o.Occlusion = tex2D (_OcclusionMap, IN.uv_OcclusionMap).r;
|
|
||||||
// Emission comes from a texture tinted by color
|
|
||||||
o.Emission = tex2D (_EmissionMap, IN.uv_EmissionMap) * _EmissionColor;
|
|
||||||
}
|
|
||||||
ENDCG
|
|
||||||
}
|
|
||||||
FallBack "Diffuse"
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: d28fc76bfd3057e4c8f1c6f0b91590c8
|
|
||||||
ShaderImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
defaultTextures: []
|
|
||||||
nonModifiableTextures: []
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: dea3ffaa18a0d8b479eadad139464d2d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: a08f3a1c845d57c4293a42c3202574a1
|
|
||||||
ScriptedImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: e6061ad897a8bd843b501d409aff8a22
|
|
||||||
ScriptedImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: bb6606ffd3868dd46a773758ff6901fc
|
|
||||||
ScriptedImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 09512c1ba26fe804283ec6e09112e53c
|
|
||||||
ScriptedImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f283c8997fa8bd642a4f133b1578d516
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
BIN
Assets/GLTFUtility-master/Plugins/.DS_Store
vendored
BIN
Assets/GLTFUtility-master/Plugins/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 55f8c6e6fe55f5a49b1e3137330944e8
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
BIN
Assets/GLTFUtility-master/Plugins/draco/.DS_Store
vendored
BIN
Assets/GLTFUtility-master/Plugins/draco/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,377 +0,0 @@
|
||||||
// Copyright 2017 The Draco Authors.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Unity.Collections.LowLevel.Unsafe;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public unsafe class DracoMeshLoader
|
|
||||||
{
|
|
||||||
// These values must be exactly the same as the values in draco_types.h.
|
|
||||||
// Attribute data type.
|
|
||||||
enum DataType {
|
|
||||||
DT_INVALID = 0,
|
|
||||||
DT_INT8,
|
|
||||||
DT_UINT8,
|
|
||||||
DT_INT16,
|
|
||||||
DT_UINT16,
|
|
||||||
DT_INT32,
|
|
||||||
DT_UINT32,
|
|
||||||
DT_INT64,
|
|
||||||
DT_UINT64,
|
|
||||||
DT_FLOAT32,
|
|
||||||
DT_FLOAT64,
|
|
||||||
DT_BOOL
|
|
||||||
};
|
|
||||||
|
|
||||||
// These values must be exactly the same as the values in
|
|
||||||
// geometry_attribute.h.
|
|
||||||
// Attribute type.
|
|
||||||
enum AttributeType {
|
|
||||||
INVALID = -1,
|
|
||||||
POSITION = 0,
|
|
||||||
NORMAL,
|
|
||||||
COLOR,
|
|
||||||
TEX_COORD,
|
|
||||||
// A special id used to mark attributes that are not assigned to any known
|
|
||||||
// predefined use case. Such attributes are often used for a shader specific
|
|
||||||
// data.
|
|
||||||
GENERIC
|
|
||||||
};
|
|
||||||
|
|
||||||
// The order must be consistent with C++ interface.
|
|
||||||
[StructLayout (LayoutKind.Sequential)] public struct DracoData
|
|
||||||
{
|
|
||||||
public int dataType;
|
|
||||||
public IntPtr data;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)] public struct DracoAttribute
|
|
||||||
{
|
|
||||||
public int attributeType;
|
|
||||||
public int dataType;
|
|
||||||
public int numComponents;
|
|
||||||
public int uniqueId;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)] public struct DracoMesh
|
|
||||||
{
|
|
||||||
public int numFaces;
|
|
||||||
public int numVertices;
|
|
||||||
public int numAttributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release data associated with DracoMesh.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern void ReleaseDracoMesh(
|
|
||||||
DracoMesh**mesh);
|
|
||||||
// Release data associated with DracoAttribute.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern void
|
|
||||||
ReleaseDracoAttribute(DracoAttribute**attr);
|
|
||||||
// Release attribute data.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern void ReleaseDracoData(
|
|
||||||
DracoData**data);
|
|
||||||
|
|
||||||
// Decodes compressed Draco::Mesh in buffer to mesh. On input, mesh
|
|
||||||
// must be null. The returned mesh must released with ReleaseDracoMesh.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern int DecodeDracoMesh(
|
|
||||||
byte[] buffer, int length, DracoMesh**mesh);
|
|
||||||
|
|
||||||
// Returns the DracoAttribute at index in mesh. On input, attribute must be
|
|
||||||
// null. The returned attr must be released with ReleaseDracoAttribute.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern bool GetAttribute(
|
|
||||||
DracoMesh* mesh, int index, DracoAttribute**attr);
|
|
||||||
// Returns the DracoAttribute of type at index in mesh. On input, attribute
|
|
||||||
// must be null. E.g. If the mesh has two texture coordinates then
|
|
||||||
// GetAttributeByType(mesh, AttributeType.TEX_COORD, 1, &attr); will return
|
|
||||||
// the second TEX_COORD attribute. The returned attr must be released with
|
|
||||||
// ReleaseDracoAttribute.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern bool GetAttributeByType(
|
|
||||||
DracoMesh* mesh, AttributeType type, int index, DracoAttribute**attr);
|
|
||||||
// Returns the DracoAttribute with unique_id in mesh. On input, attribute
|
|
||||||
// must be null.The returned attr must be released with
|
|
||||||
// ReleaseDracoAttribute.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern bool
|
|
||||||
GetAttributeByUniqueId(DracoMesh* mesh, int unique_id,
|
|
||||||
DracoAttribute**attr);
|
|
||||||
|
|
||||||
// Returns an array of indices as well as the type of data in data_type. On
|
|
||||||
// input, indices must be null. The returned indices must be released with
|
|
||||||
// ReleaseDracoData.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern bool GetMeshIndices(
|
|
||||||
DracoMesh* mesh, DracoData**indices);
|
|
||||||
// Returns an array of attribute data as well as the type of data in
|
|
||||||
// data_type. On input, data must be null. The returned data must be
|
|
||||||
// released with ReleaseDracoData.
|
|
||||||
[DllImport ("dracodec_unity")] private static extern bool GetAttributeData(
|
|
||||||
DracoMesh* mesh, DracoAttribute* attr, DracoData**data);
|
|
||||||
|
|
||||||
public int LoadMeshFromAsset(string assetName, ref List<Mesh> meshes)
|
|
||||||
{
|
|
||||||
TextAsset asset =
|
|
||||||
Resources.Load(assetName, typeof(TextAsset)) as TextAsset;
|
|
||||||
if (asset == null) {
|
|
||||||
Debug.Log ("Didn't load file!");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
byte[] encodedData = asset.bytes;
|
|
||||||
Debug.Log(encodedData.Length.ToString());
|
|
||||||
if (encodedData.Length == 0) {
|
|
||||||
Debug.Log ("Didn't load encoded data!");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return ConvertDracoMeshToUnity(encodedData, ref meshes);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decodes a Draco mesh, creates a Unity mesh from the decoded data and
|
|
||||||
// adds the Unity mesh to meshes. encodedData is the compressed Draco mesh.
|
|
||||||
public unsafe int ConvertDracoMeshToUnity(byte[] encodedData,
|
|
||||||
ref List<Mesh> meshes)
|
|
||||||
{
|
|
||||||
float startTime = Time.realtimeSinceStartup;
|
|
||||||
DracoMesh *mesh = null;
|
|
||||||
if (DecodeDracoMesh(encodedData, encodedData.Length, &mesh) <= 0) {
|
|
||||||
Debug.Log("Failed: Decoding error.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
float decodeTimeMilli =
|
|
||||||
(Time.realtimeSinceStartup - startTime) * 1000.0f;
|
|
||||||
Debug.Log("decodeTimeMilli: " + decodeTimeMilli.ToString());
|
|
||||||
|
|
||||||
Debug.Log("Num indices: " + mesh->numFaces.ToString());
|
|
||||||
Debug.Log("Num vertices: " + mesh->numVertices.ToString());
|
|
||||||
Debug.Log("Num attributes: " + mesh->numAttributes.ToString());
|
|
||||||
|
|
||||||
Mesh unityMesh = CreateUnityMesh(mesh);
|
|
||||||
UnityMeshToCamera(ref unityMesh);
|
|
||||||
meshes.Add(unityMesh);
|
|
||||||
|
|
||||||
int numFaces = mesh->numFaces;
|
|
||||||
ReleaseDracoMesh(&mesh);
|
|
||||||
return numFaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates a Unity mesh from the decoded Draco mesh.
|
|
||||||
public unsafe Mesh CreateUnityMesh(DracoMesh *dracoMesh)
|
|
||||||
{
|
|
||||||
float startTime = Time.realtimeSinceStartup;
|
|
||||||
int numFaces = dracoMesh->numFaces;
|
|
||||||
int[] newTriangles = new int[dracoMesh->numFaces * 3];
|
|
||||||
Vector3[] newVertices = new Vector3[dracoMesh->numVertices];
|
|
||||||
Vector2[] newUVs = null;
|
|
||||||
Vector3[] newNormals = null;
|
|
||||||
Color[] newColors = null;
|
|
||||||
byte[] newGenerics = null;
|
|
||||||
|
|
||||||
// Copy face indices.
|
|
||||||
DracoData *indicesData;
|
|
||||||
GetMeshIndices(dracoMesh, &indicesData);
|
|
||||||
int elementSize =
|
|
||||||
DataTypeSize((DracoMeshLoader.DataType)indicesData->dataType);
|
|
||||||
int *indices = (int*)(indicesData->data);
|
|
||||||
var indicesPtr = UnsafeUtility.AddressOf(ref newTriangles[0]);
|
|
||||||
UnsafeUtility.MemCpy(indicesPtr, indices,
|
|
||||||
newTriangles.Length * elementSize);
|
|
||||||
ReleaseDracoData(&indicesData);
|
|
||||||
|
|
||||||
// Copy positions.
|
|
||||||
DracoAttribute *attr = null;
|
|
||||||
GetAttributeByType(dracoMesh, AttributeType.POSITION, 0, &attr);
|
|
||||||
DracoData* posData = null;
|
|
||||||
GetAttributeData(dracoMesh, attr, &posData);
|
|
||||||
elementSize = DataTypeSize((DracoMeshLoader.DataType)posData->dataType) *
|
|
||||||
attr->numComponents;
|
|
||||||
var newVerticesPtr = UnsafeUtility.AddressOf(ref newVertices[0]);
|
|
||||||
UnsafeUtility.MemCpy(newVerticesPtr, (void*)posData->data,
|
|
||||||
dracoMesh->numVertices * elementSize);
|
|
||||||
ReleaseDracoData(&posData);
|
|
||||||
ReleaseDracoAttribute(&attr);
|
|
||||||
|
|
||||||
// Copy normals.
|
|
||||||
if (GetAttributeByType(dracoMesh, AttributeType.NORMAL, 0, &attr)) {
|
|
||||||
DracoData* normData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, &normData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((DracoMeshLoader.DataType)normData->dataType) *
|
|
||||||
attr->numComponents;
|
|
||||||
newNormals = new Vector3[dracoMesh->numVertices];
|
|
||||||
var newNormalsPtr = UnsafeUtility.AddressOf(ref newNormals[0]);
|
|
||||||
UnsafeUtility.MemCpy(newNormalsPtr, (void*)normData->data,
|
|
||||||
dracoMesh->numVertices * elementSize);
|
|
||||||
Debug.Log("Decoded mesh normals.");
|
|
||||||
ReleaseDracoData(&normData);
|
|
||||||
ReleaseDracoAttribute(&attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy texture coordinates.
|
|
||||||
if (GetAttributeByType(dracoMesh, AttributeType.TEX_COORD, 0, &attr)) {
|
|
||||||
DracoData* texData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, &texData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((DracoMeshLoader.DataType)texData->dataType) *
|
|
||||||
attr->numComponents;
|
|
||||||
newUVs = new Vector2[dracoMesh->numVertices];
|
|
||||||
var newUVsPtr = UnsafeUtility.AddressOf(ref newUVs[0]);
|
|
||||||
UnsafeUtility.MemCpy(newUVsPtr, (void*)texData->data,
|
|
||||||
dracoMesh->numVertices * elementSize);
|
|
||||||
Debug.Log("Decoded mesh texcoords.");
|
|
||||||
ReleaseDracoData(&texData);
|
|
||||||
ReleaseDracoAttribute(&attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy colors.
|
|
||||||
if (GetAttributeByType(dracoMesh, AttributeType.COLOR, 0, &attr)) {
|
|
||||||
DracoData* colorData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, &colorData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((DracoMeshLoader.DataType)colorData->dataType) *
|
|
||||||
attr->numComponents;
|
|
||||||
newColors = new Color[dracoMesh->numVertices];
|
|
||||||
var newColorsPtr = UnsafeUtility.AddressOf(ref newColors[0]);
|
|
||||||
UnsafeUtility.MemCpy(newColorsPtr, (void*)colorData->data,
|
|
||||||
dracoMesh->numVertices * elementSize);
|
|
||||||
Debug.Log("Decoded mesh colors.");
|
|
||||||
ReleaseDracoData(&colorData);
|
|
||||||
ReleaseDracoAttribute(&attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy generic data. This script does not do anyhting with the generic
|
|
||||||
// data.
|
|
||||||
if (GetAttributeByType(dracoMesh, AttributeType.GENERIC, 0, &attr)) {
|
|
||||||
DracoData* genericData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, &genericData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((DracoMeshLoader.DataType)genericData->dataType) *
|
|
||||||
attr->numComponents;
|
|
||||||
newGenerics = new byte[dracoMesh->numVertices * elementSize];
|
|
||||||
var newGenericPtr = UnsafeUtility.AddressOf(ref newGenerics[0]);
|
|
||||||
UnsafeUtility.MemCpy(newGenericPtr, (void*)genericData->data,
|
|
||||||
dracoMesh->numVertices * elementSize);
|
|
||||||
Debug.Log("Decoded mesh generic data.");
|
|
||||||
ReleaseDracoData(&genericData);
|
|
||||||
ReleaseDracoAttribute(&attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float copyDecodedDataTimeMilli =
|
|
||||||
(Time.realtimeSinceStartup - startTime) * 1000.0f;
|
|
||||||
Debug.Log("copyDecodedDataTimeMilli: " +
|
|
||||||
copyDecodedDataTimeMilli.ToString());
|
|
||||||
|
|
||||||
startTime = Time.realtimeSinceStartup;
|
|
||||||
Mesh mesh = new Mesh();
|
|
||||||
|
|
||||||
#if UNITY_2017_3_OR_NEWER
|
|
||||||
mesh.indexFormat = (newVertices.Length > System.UInt16.MaxValue)
|
|
||||||
? UnityEngine.Rendering.IndexFormat.UInt32
|
|
||||||
: UnityEngine.Rendering.IndexFormat.UInt16;
|
|
||||||
#else
|
|
||||||
if (newVertices.Length > System.UInt16.MaxValue) {
|
|
||||||
throw new System.Exception("Draco meshes with more than 65535 vertices are only supported from Unity 2017.3 onwards.");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mesh.vertices = newVertices;
|
|
||||||
mesh.SetTriangles(newTriangles, 0, true);
|
|
||||||
if (newUVs != null) {
|
|
||||||
mesh.uv = newUVs;
|
|
||||||
}
|
|
||||||
if (newNormals != null) {
|
|
||||||
mesh.normals = newNormals;
|
|
||||||
} else {
|
|
||||||
mesh.RecalculateNormals();
|
|
||||||
Debug.Log("Mesh doesn't have normals, recomputed.");
|
|
||||||
}
|
|
||||||
if (newColors != null) {
|
|
||||||
mesh.colors = newColors;
|
|
||||||
}
|
|
||||||
|
|
||||||
float convertTimeMilli =
|
|
||||||
(Time.realtimeSinceStartup - startTime) * 1000.0f;
|
|
||||||
Debug.Log("convertTimeMilli: " + convertTimeMilli.ToString());
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scale and translate the decoded mesh so it will be visible to
|
|
||||||
// a new camera's default settings.
|
|
||||||
public unsafe void UnityMeshToCamera(ref Mesh mesh)
|
|
||||||
{
|
|
||||||
float startTime = Time.realtimeSinceStartup;
|
|
||||||
mesh.RecalculateBounds();
|
|
||||||
|
|
||||||
float scale = 0.5f / mesh.bounds.extents.x;
|
|
||||||
if (0.5f / mesh.bounds.extents.y < scale) {
|
|
||||||
scale = 0.5f / mesh.bounds.extents.y;
|
|
||||||
}
|
|
||||||
if (0.5f / mesh.bounds.extents.z < scale) {
|
|
||||||
scale = 0.5f / mesh.bounds.extents.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3[] vertices = mesh.vertices;
|
|
||||||
int i = 0;
|
|
||||||
while (i < vertices.Length) {
|
|
||||||
vertices[i] *= scale;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
mesh.vertices = vertices;
|
|
||||||
mesh.RecalculateBounds();
|
|
||||||
|
|
||||||
Vector3 translate = mesh.bounds.center;
|
|
||||||
translate.x = 0 - mesh.bounds.center.x;
|
|
||||||
translate.y = 0 - mesh.bounds.center.y;
|
|
||||||
translate.z = 2 - mesh.bounds.center.z;
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
while (i < vertices.Length) {
|
|
||||||
vertices[i] += translate;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
mesh.vertices = vertices;
|
|
||||||
float transformTimeMilli =
|
|
||||||
(Time.realtimeSinceStartup - startTime) * 1000.0f;
|
|
||||||
Debug.Log("transformTimeMilli: " + transformTimeMilli.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DataTypeSize(DataType dt) {
|
|
||||||
switch (dt) {
|
|
||||||
case DataType.DT_INT8:
|
|
||||||
case DataType.DT_UINT8:
|
|
||||||
return 1;
|
|
||||||
case DataType.DT_INT16:
|
|
||||||
case DataType.DT_UINT16:
|
|
||||||
return 2;
|
|
||||||
case DataType.DT_INT32:
|
|
||||||
case DataType.DT_UINT32:
|
|
||||||
return 4;
|
|
||||||
case DataType.DT_INT64:
|
|
||||||
case DataType.DT_UINT64:
|
|
||||||
return 8;
|
|
||||||
case DataType.DT_FLOAT32:
|
|
||||||
return 4;
|
|
||||||
case DataType.DT_FLOAT64:
|
|
||||||
return 8;
|
|
||||||
case DataType.DT_BOOL:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 40c64bfc72178384f93198e18da730b4
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Dracodec",
|
|
||||||
"references": [],
|
|
||||||
"optionalUnityReferences": [],
|
|
||||||
"includePlatforms": [],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": true,
|
|
||||||
"overrideReferences": false,
|
|
||||||
"precompiledReferences": [],
|
|
||||||
"autoReferenced": true,
|
|
||||||
"defineConstraints": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 2d8d858fc7e3ece4ebe988e4ff712fd5
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,366 +0,0 @@
|
||||||
// Copyright 2017 The Draco Authors.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
//
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Unity.Collections.LowLevel.Unsafe;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public unsafe class GLTFUtilityDracoLoader {
|
|
||||||
// These values must be exactly the same as the values in draco_types.h.
|
|
||||||
// Attribute data type.
|
|
||||||
enum DataType {
|
|
||||||
DT_INVALID = 0,
|
|
||||||
DT_INT8,
|
|
||||||
DT_UINT8,
|
|
||||||
DT_INT16,
|
|
||||||
DT_UINT16,
|
|
||||||
DT_INT32,
|
|
||||||
DT_UINT32,
|
|
||||||
DT_INT64,
|
|
||||||
DT_UINT64,
|
|
||||||
DT_FLOAT32,
|
|
||||||
DT_FLOAT64,
|
|
||||||
DT_BOOL
|
|
||||||
}
|
|
||||||
|
|
||||||
// These values must be exactly the same as the values in
|
|
||||||
// geometry_attribute.h.
|
|
||||||
// Attribute type.
|
|
||||||
enum AttributeType {
|
|
||||||
INVALID = -1,
|
|
||||||
POSITION = 0,
|
|
||||||
NORMAL = 1,
|
|
||||||
COLOR = 2,
|
|
||||||
TEX_COORD = 3,
|
|
||||||
GENERIC = 4
|
|
||||||
}
|
|
||||||
|
|
||||||
// The order must be consistent with C++ interface.
|
|
||||||
[StructLayout(LayoutKind.Sequential)] public struct DracoData {
|
|
||||||
public int dataType;
|
|
||||||
public IntPtr data;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)] public struct DracoAttribute {
|
|
||||||
public int attributeType;
|
|
||||||
public int dataType;
|
|
||||||
public int numComponents;
|
|
||||||
public int uniqueId;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)] public struct DracoMesh {
|
|
||||||
public int numFaces;
|
|
||||||
public int numVertices;
|
|
||||||
public int numAttributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct MeshAttributes {
|
|
||||||
public int pos, norms, uv, joints, weights, col;
|
|
||||||
|
|
||||||
public MeshAttributes(int pos, int norms, int uv, int joints, int weights, int col) {
|
|
||||||
this.pos = pos;
|
|
||||||
this.norms = norms;
|
|
||||||
this.uv = uv;
|
|
||||||
this.joints = joints;
|
|
||||||
this.weights = weights;
|
|
||||||
this.col = col;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)] public struct Vector4<T> where T : struct {
|
|
||||||
public T x;
|
|
||||||
public T y;
|
|
||||||
public T z;
|
|
||||||
public T w;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class AsyncMesh {
|
|
||||||
public int[] tris;
|
|
||||||
public Vector3[] verts;
|
|
||||||
public Vector2[] uv;
|
|
||||||
public Vector3[] norms;
|
|
||||||
public BoneWeight[] boneWeights;
|
|
||||||
public Color[] colors;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !UNITY_EDITOR && (UNITY_WEBGL || UNITY_IOS)
|
|
||||||
const string DRACODEC_UNITY_LIB = "__Internal";
|
|
||||||
#elif UNITY_ANDROID || UNITY_STANDALONE || UNITY_WSA || UNITY_EDITOR || PLATFORM_LUMIN
|
|
||||||
const string DRACODEC_UNITY_LIB = "dracodec_unity";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Release data associated with DracoMesh.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern void ReleaseDracoMesh(
|
|
||||||
DracoMesh * * mesh);
|
|
||||||
// Release data associated with DracoAttribute.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern void
|
|
||||||
ReleaseDracoAttribute(DracoAttribute * * attr);
|
|
||||||
// Release attribute data.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern void ReleaseDracoData(
|
|
||||||
DracoData * * data);
|
|
||||||
|
|
||||||
// Decodes compressed Draco::Mesh in buffer to mesh. On input, mesh
|
|
||||||
// must be null. The returned mesh must released with ReleaseDracoMesh.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern int DecodeDracoMesh(
|
|
||||||
byte[] buffer, int length, DracoMesh * * mesh);
|
|
||||||
|
|
||||||
// Returns the DracoAttribute at index in mesh. On input, attribute must be
|
|
||||||
// null. The returned attr must be released with ReleaseDracoAttribute.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern bool GetAttribute(
|
|
||||||
DracoMesh * mesh, int index, DracoAttribute * * attr);
|
|
||||||
// Returns the DracoAttribute of type at index in mesh. On input, attribute
|
|
||||||
// must be null. E.g. If the mesh has two texture coordinates then
|
|
||||||
// GetAttributeByType(mesh, AttributeType.TEX_COORD, 1, &attr); will return
|
|
||||||
// the second TEX_COORD attribute. The returned attr must be released with
|
|
||||||
// ReleaseDracoAttribute.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern bool GetAttributeByType(
|
|
||||||
DracoMesh * mesh, AttributeType type, int index, DracoAttribute * * attr);
|
|
||||||
// Returns the DracoAttribute with unique_id in mesh. On input, attribute
|
|
||||||
// must be null.The returned attr must be released with
|
|
||||||
// ReleaseDracoAttribute.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern bool
|
|
||||||
GetAttributeByUniqueId(DracoMesh * mesh, int unique_id,
|
|
||||||
DracoAttribute * * attr);
|
|
||||||
|
|
||||||
// Returns an array of indices as well as the type of data in data_type. On
|
|
||||||
// input, indices must be null. The returned indices must be released with
|
|
||||||
// ReleaseDracoData.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern bool GetMeshIndices(
|
|
||||||
DracoMesh * mesh, DracoData * * indices);
|
|
||||||
// Returns an array of attribute data as well as the type of data in
|
|
||||||
// data_type. On input, data must be null. The returned data must be
|
|
||||||
// released with ReleaseDracoData.
|
|
||||||
[DllImport(DRACODEC_UNITY_LIB)] private static extern bool GetAttributeData(
|
|
||||||
DracoMesh * mesh, DracoAttribute * attr, DracoData * * data);
|
|
||||||
|
|
||||||
// Decodes a Draco mesh, creates a Unity mesh from the decoded data and
|
|
||||||
// adds the Unity mesh to meshes. encodedData is the compressed Draco mesh.
|
|
||||||
public unsafe AsyncMesh LoadMesh(byte[] encodedData, MeshAttributes attributes) {
|
|
||||||
DracoMesh * mesh = null;
|
|
||||||
if (DecodeDracoMesh(encodedData, encodedData.Length, & mesh) <= 0) {
|
|
||||||
Debug.Log("Failed: Decoding error.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
AsyncMesh unityMesh = CreateAsyncMesh(mesh, attributes);
|
|
||||||
|
|
||||||
int numFaces = mesh -> numFaces;
|
|
||||||
ReleaseDracoMesh( & mesh);
|
|
||||||
if (numFaces > 0) return unityMesh;
|
|
||||||
else return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates a Unity mesh from the decoded Draco mesh.
|
|
||||||
public unsafe AsyncMesh CreateAsyncMesh(DracoMesh * dracoMesh, MeshAttributes attributes) {
|
|
||||||
int numFaces = dracoMesh -> numFaces;
|
|
||||||
|
|
||||||
AsyncMesh mesh = new AsyncMesh();
|
|
||||||
mesh.tris = new int[dracoMesh -> numFaces * 3];
|
|
||||||
mesh.verts = new Vector3[dracoMesh -> numVertices];
|
|
||||||
|
|
||||||
// Copy face indices.
|
|
||||||
DracoData * indicesData;
|
|
||||||
GetMeshIndices(dracoMesh, & indicesData);
|
|
||||||
int elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) indicesData -> dataType);
|
|
||||||
int * indices = (int * ) (indicesData -> data);
|
|
||||||
var indicesPtr = UnsafeUtility.AddressOf(ref mesh.tris[0]);
|
|
||||||
UnsafeUtility.MemCpy(indicesPtr, indices,
|
|
||||||
mesh.tris.Length * elementSize);
|
|
||||||
ReleaseDracoData( & indicesData);
|
|
||||||
|
|
||||||
DracoAttribute * attr = null;
|
|
||||||
|
|
||||||
// Copy positions.
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.pos, & attr)) {
|
|
||||||
DracoData * posData = null;
|
|
||||||
GetAttributeData(dracoMesh, attr, & posData);
|
|
||||||
elementSize = DataTypeSize((GLTFUtilityDracoLoader.DataType) posData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
var newVerticesPtr = UnsafeUtility.AddressOf(ref mesh.verts[0]);
|
|
||||||
UnsafeUtility.MemCpy(newVerticesPtr, (void * ) posData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
ReleaseDracoData( & posData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy normals.
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.norms, & attr)) {
|
|
||||||
DracoData * normData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, & normData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) normData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
mesh.norms = new Vector3[dracoMesh -> numVertices];
|
|
||||||
var newNormalsPtr = UnsafeUtility.AddressOf(ref mesh.norms[0]);
|
|
||||||
UnsafeUtility.MemCpy(newNormalsPtr, (void * ) normData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
ReleaseDracoData( & normData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy texture coordinates.
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.uv, & attr)) {
|
|
||||||
DracoData * texData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, & texData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) texData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
mesh.uv = new Vector2[dracoMesh -> numVertices];
|
|
||||||
var newUVsPtr = UnsafeUtility.AddressOf(ref mesh.uv[0]);
|
|
||||||
UnsafeUtility.MemCpy(newUVsPtr, (void * ) texData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
ReleaseDracoData( & texData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy colors.
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.col, & attr)) {
|
|
||||||
DracoData * colorData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, & colorData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) colorData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
mesh.colors = new Color[dracoMesh -> numVertices];
|
|
||||||
var newColorsPtr = UnsafeUtility.AddressOf(ref mesh.colors[0]);
|
|
||||||
UnsafeUtility.MemCpy(newColorsPtr, (void * ) colorData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
ReleaseDracoData( & colorData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy weights.
|
|
||||||
Vector4[] weights = null;
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.weights, & attr)) {
|
|
||||||
DracoData * weightData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, & weightData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) weightData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
if (attr -> dataType == 9) {
|
|
||||||
weights = new Vector4[dracoMesh -> numVertices];
|
|
||||||
var newWeightsPtr = UnsafeUtility.AddressOf(ref weights[0]);
|
|
||||||
UnsafeUtility.MemCpy(newWeightsPtr, (void * ) weightData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
} else if (attr -> dataType == 4) {
|
|
||||||
var newWeightsInt = new Vector4<UInt16>[dracoMesh -> numVertices];
|
|
||||||
var newWeightsPtr = UnsafeUtility.AddressOf(ref newWeightsInt[0]);
|
|
||||||
UnsafeUtility.MemCpy(newWeightsPtr, (void * ) weightData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
weights = newWeightsInt.Select(x => new Vector4(x.x, x.y, x.z, x.w)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
ReleaseDracoData( & weightData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy joints.
|
|
||||||
Vector4[] joints = null;
|
|
||||||
if (GetAttributeByUniqueId(dracoMesh, attributes.joints, & attr)) {
|
|
||||||
DracoData * jointData = null;
|
|
||||||
if (GetAttributeData(dracoMesh, attr, & jointData)) {
|
|
||||||
elementSize =
|
|
||||||
DataTypeSize((GLTFUtilityDracoLoader.DataType) jointData -> dataType) *
|
|
||||||
attr -> numComponents;
|
|
||||||
if (attr -> dataType == 9) {
|
|
||||||
joints = new Vector4[dracoMesh -> numVertices];
|
|
||||||
var newJointsPtr = UnsafeUtility.AddressOf(ref joints[0]);
|
|
||||||
UnsafeUtility.MemCpy(newJointsPtr, (void * ) jointData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
} else if (attr -> dataType == 4) {
|
|
||||||
var newJointsInt = new Vector4<UInt16>[dracoMesh -> numVertices];
|
|
||||||
var newJointsPtr = UnsafeUtility.AddressOf(ref newJointsInt[0]);
|
|
||||||
UnsafeUtility.MemCpy(newJointsPtr, (void * ) jointData -> data,
|
|
||||||
dracoMesh -> numVertices * elementSize);
|
|
||||||
joints = newJointsInt.Select(x => new Vector4(x.x, x.y, x.z, x.w)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
ReleaseDracoData( & jointData);
|
|
||||||
ReleaseDracoAttribute( & attr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #if UNITY_2017_3_OR_NEWER
|
|
||||||
mesh.indexFormat = (newVertices.Length > System.UInt16.MaxValue) ?
|
|
||||||
UnityEngine.Rendering.IndexFormat.UInt32 :
|
|
||||||
UnityEngine.Rendering.IndexFormat.UInt16;
|
|
||||||
#else
|
|
||||||
if (newVertices.Length > System.UInt16.MaxValue) {
|
|
||||||
throw new System.Exception("Draco meshes with more than 65535 vertices are only supported from Unity 2017.3 onwards.");
|
|
||||||
}
|
|
||||||
#endif */
|
|
||||||
|
|
||||||
if (joints != null && weights != null) {
|
|
||||||
if (joints.Length == weights.Length) {
|
|
||||||
BoneWeight[] boneWeights = new BoneWeight[weights.Length];
|
|
||||||
for (int k = 0; k < boneWeights.Length; k++) {
|
|
||||||
NormalizeWeights(ref weights[k]);
|
|
||||||
boneWeights[k].weight0 = weights[k].x;
|
|
||||||
boneWeights[k].weight1 = weights[k].y;
|
|
||||||
boneWeights[k].weight2 = weights[k].z;
|
|
||||||
boneWeights[k].weight3 = weights[k].w;
|
|
||||||
boneWeights[k].boneIndex0 = Mathf.RoundToInt(joints[k].x);
|
|
||||||
boneWeights[k].boneIndex1 = Mathf.RoundToInt(joints[k].y);
|
|
||||||
boneWeights[k].boneIndex2 = Mathf.RoundToInt(joints[k].z);
|
|
||||||
boneWeights[k].boneIndex3 = Mathf.RoundToInt(joints[k].w);
|
|
||||||
}
|
|
||||||
mesh.boneWeights = boneWeights;
|
|
||||||
} else Debug.LogWarning("Draco: joints and weights not same length. Skipped");
|
|
||||||
}
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void NormalizeWeights(ref Vector4 weights) {
|
|
||||||
float total = weights.x + weights.y + weights.z + weights.w;
|
|
||||||
if (total == 0) return;
|
|
||||||
float mult = 1f / total;
|
|
||||||
weights.x *= mult;
|
|
||||||
weights.y *= mult;
|
|
||||||
weights.z *= mult;
|
|
||||||
weights.w *= mult;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int DataTypeSize(DataType dt) {
|
|
||||||
switch (dt) {
|
|
||||||
case DataType.DT_INT8:
|
|
||||||
case DataType.DT_UINT8:
|
|
||||||
return 1;
|
|
||||||
case DataType.DT_INT16:
|
|
||||||
case DataType.DT_UINT16:
|
|
||||||
return 2;
|
|
||||||
case DataType.DT_INT32:
|
|
||||||
case DataType.DT_UINT32:
|
|
||||||
return 4;
|
|
||||||
case DataType.DT_INT64:
|
|
||||||
case DataType.DT_UINT64:
|
|
||||||
return 8;
|
|
||||||
case DataType.DT_FLOAT32:
|
|
||||||
return 4;
|
|
||||||
case DataType.DT_FLOAT64:
|
|
||||||
return 8;
|
|
||||||
case DataType.DT_BOOL:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 9ae7413bfd6ce074fb7cba6fd7084137
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 18d11bbffc2932d4ba56893397a010a3
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c3cb3b503c4bf984bbe1663b0b569837
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 1e66ee77f23663146833d91c35f5f447
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,111 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 8f770194101f3c74dbae841e6d035437
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 0
|
|
||||||
Exclude Editor: 0
|
|
||||||
Exclude Linux: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude LinuxUniversal: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude iOS: 1
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: ARM64
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Facebook: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Facebook: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Linux
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: x86
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: LinuxUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
WebGL: WebGL
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
iPhone: iOS
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
AddToEmbeddedBinaries: false
|
|
||||||
CompileFlags:
|
|
||||||
FrameworkDependencies:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: b751ee480d40a07469cc40242758be26
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,106 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 5e308d63e1079dc46aea7da7c38c52d9
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 0
|
|
||||||
Exclude Editor: 0
|
|
||||||
Exclude Linux: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude LinuxUniversal: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude iOS: 1
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Facebook: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Facebook: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Linux
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: x86
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: LinuxUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
- first:
|
|
||||||
iPhone: iOS
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
AddToEmbeddedBinaries: false
|
|
||||||
CompileFlags:
|
|
||||||
FrameworkDependencies:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c95a7c0947cfb4d12827a5ec576ef93d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 247f211ed244a5246bd95eb03ef807bd
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,82 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 25cda0e4b8c73b248a6cc47d8d9a5340
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 1
|
|
||||||
isOverridable: 1
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude WindowsStoreApps: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Windows Store Apps: WindowsStoreApps
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: ARM
|
|
||||||
DontProcess: false
|
|
||||||
PlaceholderPath:
|
|
||||||
SDK: UWP
|
|
||||||
ScriptingBackend: AnyScriptingBackend
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6fd9b1242506f2242b7f0aea747d003a
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,82 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: da68c67391c543b46a4f57aa2829f479
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 1
|
|
||||||
isOverridable: 1
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude WindowsStoreApps: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Windows Store Apps: WindowsStoreApps
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: ARM64
|
|
||||||
DontProcess: false
|
|
||||||
PlaceholderPath:
|
|
||||||
SDK: UWP
|
|
||||||
ScriptingBackend: AnyScriptingBackend
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: adb1df6c7d8b745eeb059f01399eaec2
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,82 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: aa9edc03c58e1498f9df11817c09261d
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 1
|
|
||||||
isOverridable: 1
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude WindowsStoreApps: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Windows Store Apps: WindowsStoreApps
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: X64
|
|
||||||
DontProcess: false
|
|
||||||
PlaceholderPath:
|
|
||||||
SDK: UWP
|
|
||||||
ScriptingBackend: AnyScriptingBackend
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 55a5c1975a4d44616a048ba97f60ea08
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,82 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 22e980b26ccee44528d4c7fe7c6d781c
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 1
|
|
||||||
isOverridable: 1
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 1
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude WebGL: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude WindowsStoreApps: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Windows Store Apps: WindowsStoreApps
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: X86
|
|
||||||
DontProcess: false
|
|
||||||
PlaceholderPath:
|
|
||||||
SDK: UWP
|
|
||||||
ScriptingBackend: AnyScriptingBackend
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 9aeebcdf335a6df429eab3d69d0159ea
|
|
||||||
folderAsset: yes
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: e35a9a45f14c2b24f9c82a36f5799410
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildMachineOSBuild</key>
|
|
||||||
<string>19D76</string>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>dracodec_unity</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleLongVersionString</key>
|
|
||||||
<string></string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
|
||||||
<array>
|
|
||||||
<string>MacOSX</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string></string>
|
|
||||||
<key>CSResourcesFileMapped</key>
|
|
||||||
<true/>
|
|
||||||
<key>DTCompiler</key>
|
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
||||||
<key>DTPlatformBuild</key>
|
|
||||||
<string>11C505</string>
|
|
||||||
<key>DTPlatformVersion</key>
|
|
||||||
<string>GM</string>
|
|
||||||
<key>DTSDKBuild</key>
|
|
||||||
<string>19B90</string>
|
|
||||||
<key>DTSDKName</key>
|
|
||||||
<string>macosx10.15</string>
|
|
||||||
<key>DTXcode</key>
|
|
||||||
<string>1131</string>
|
|
||||||
<key>DTXcodeBuild</key>
|
|
||||||
<string>11C505</string>
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>10.15</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string></string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3e981ecc91dd4264397170fc0e11094a
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: ddc66c343ee12204897fdd1cd124374e
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 0f3e5b8d3810fb1449e0638febb320ff
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,81 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3adca5d522c7e4947b2e025441e049ec
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 0
|
|
||||||
Exclude Linux64: 0
|
|
||||||
Exclude Lumin: 1
|
|
||||||
Exclude OSXUniversal: 0
|
|
||||||
Exclude Win: 0
|
|
||||||
Exclude Win64: 0
|
|
||||||
Exclude iOS: 1
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: x86_64
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: Windows
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: x86
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: x86_64
|
|
||||||
- first:
|
|
||||||
iPhone: iOS
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
AddToEmbeddedBinaries: false
|
|
||||||
CPU: AnyCPU
|
|
||||||
CompileFlags:
|
|
||||||
FrameworkDependencies:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 87b9e1a9162c1494fa72ad3510b7f7db
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,80 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 5f98a4463b98349d3877f4d34436135c
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 0
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude iOS: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
iPhone: iOS
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
AddToEmbeddedBinaries: false
|
|
||||||
CPU: AnyCPU
|
|
||||||
CompileFlags:
|
|
||||||
FrameworkDependencies:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
|
|
@ -1,80 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3d09dcb22c3cf4450815b0e84edd68e3
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
: Any
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
Exclude Android: 1
|
|
||||||
Exclude Editor: 0
|
|
||||||
Exclude Linux64: 1
|
|
||||||
Exclude OSXUniversal: 1
|
|
||||||
Exclude Win: 1
|
|
||||||
Exclude Win64: 1
|
|
||||||
Exclude iOS: 0
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: ARMv7
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
CPU: AnyCPU
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
OS: AnyOS
|
|
||||||
- first:
|
|
||||||
Standalone: Linux64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: OSXUniversal
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
Standalone: Win64
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
CPU: None
|
|
||||||
- first:
|
|
||||||
iPhone: iOS
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings:
|
|
||||||
AddToEmbeddedBinaries: false
|
|
||||||
CPU: AnyCPU
|
|
||||||
CompileFlags:
|
|
||||||
FrameworkDependencies:
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
||||||
Description
|
|
||||||
===========
|
|
||||||
|
|
||||||
This folder contains resources for building a simple demo decompressing and rendering Draco within Unity.
|
|
||||||
|
|
||||||
If you are looking for more information on using Draco within Unity, this site [https://gitlab.com/atteneder/DracoUnity](https://gitlab.com/atteneder/DracoUnity) is a much better resource. There are more samples as well as support for more platforms.
|
|
||||||
|
|
||||||
In this folder we currently support two types of usages:
|
|
||||||
* Import Draco compressed mesh as assets during design time.
|
|
||||||
* Load/decode Draco files in runtime.
|
|
||||||
|
|
||||||
Prerequisite
|
|
||||||
============
|
|
||||||
|
|
||||||
To start, you need to have the Draco unity plugin. You can either use the
|
|
||||||
prebuilt libraries provided in this folder or build from source.
|
|
||||||
Note that the plugin library for different platforms has different file extension.
|
|
||||||
|
|
||||||
| Platform | Library name |
|
|
||||||
| -------- | ------------ |
|
|
||||||
| Mac OS | dracodec_unity.bundle |
|
|
||||||
| Android | libdracodec_unity.so |
|
|
||||||
| Windows | dracodec_unity.dll |
|
|
||||||
|
|
||||||
Prebuilt Library
|
|
||||||
----------------
|
|
||||||
|
|
||||||
We have built library for several platforms:
|
|
||||||
|
|
||||||
| Platform | Tested Environment |
|
|
||||||
| -------- | ------------------ |
|
|
||||||
| .bundle | macOS Sierra + Xcode 8.3.3 |
|
|
||||||
| armeabi-v7a(.so) | Android 8.1.0 |
|
|
||||||
| .dll | Win10 + Visual Studio 2017 |
|
|
||||||
|
|
||||||
Build From Source
|
|
||||||
-----------------
|
|
||||||
See [BUILDING.md](BUILDING.md) for information on building Draco Unity plug-ins from source.
|
|
||||||
|
|
||||||
Create Draco Demo Unity Project
|
|
||||||
===============================
|
|
||||||
|
|
||||||
Create a new 3D project in Unity.
|
|
||||||
|
|
||||||
Copy Library to Your Project
|
|
||||||
----------------------------
|
|
||||||
Copy the plugin library to your Unity project in `Assets/Plugins/`.
|
|
||||||
For Android Arm7:
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp path/to/your/libdracodec_unity.so path/to/your/Unity/Project/Assets/Plugins/Android/libs/armeabi-v7a/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
For Android Arm8:
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp path/to/your/libdracodec_unity.so path/to/your/Unity/Project/Assets/Plugins/Android/libs/arm64-v8a/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
For Mac:
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp path/to/your/dracodec_unity.bundle path/to/your/Unity/Project/Assets/Plugins/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
For Win:
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp path/to/your/dracodec_unity.dll path/to/your/Unity/Project/Assets/Plugins/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
|
|
||||||
Copy Unity Scripts to Your Project
|
|
||||||
----------------------------------
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp unity/DracoDecodingObject.cs path/to/your/Unity/Project/Assets/
|
|
||||||
cp unity/DracoMeshLoader.cs path/to/your/Unity/Project/Assets/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
Player Settings Change
|
|
||||||
-------------------------------
|
|
||||||
Open player settings. Make sure `Allow unsafe code` is checked, so Unity can load our plug-ins.
|
|
||||||
|
|
||||||
Copy Draco Mesh to Your Project
|
|
||||||
-------------------------------
|
|
||||||
Because Unity can only recognize file extensions known to Unity, you need to change your compressed .drc file to .drc.bytes so that Unity will recognize it as a binary file. For example, if you have file `bunny.drc` then change the file name to `bunny.drc.bytes`.
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp path/to/your/bunny.drc path/to/your/Unity/Project/Assets/Resources/bunny.drc.bytes
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Load Draco Assets in Runtime
|
|
||||||
============================
|
|
||||||
For example, please see [DracoDecodingObject.cs](DracoDecodingObject.cs) for usage. To start, you can create an empty GameObject and attach this script to it. [DracoDecodingObject.cs](DracoDecodingObject.cs) will load `bunny.drc.bytes` by default.
|
|
||||||
|
|
||||||
Enable Library in Script Debugging
|
|
||||||
----------------------------------
|
|
||||||
If you have library for the platform you are working on, e.g. `dracodec_unity.bundle` for Mac or `dracodec_unity.dll` for Windows. You should be able to use the plugin in debugging mode.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Import Compressed Draco Assets
|
|
||||||
==============================
|
|
||||||
In this section we will describe how to import Draco files (.drc) to Unity as
|
|
||||||
other 3D formats at design time, e.g. obj, fbx.
|
|
||||||
Note that importing Draco files doesn't mean the Unity project will export models as Draco files.
|
|
||||||
|
|
||||||
Copy [DracoFileImporter.cs](Editor/DracoFileImporter.cs) which enables loading (This file is only used for import Draco files):
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp DracoFileImporter.cs path/to/your/Unity/Project/Assets/Editor/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
If you have followed the previous steps, you just need to copy your asset, e.g. `bunny.drc.bytes`, to `Your/Unity/Project/Assets/Resources`, the project will automatically load the file and add the models to the project.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: bdcb6b59a16a4e74abea0baf0d380da5
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,112 +0,0 @@
|
||||||
[](https://discord.gg/qgPrHv4)
|
|
||||||
[](https://github.com/Siccity/GLTFUtility/issues)
|
|
||||||
[](https://raw.githubusercontent.com/Siccity/GLTFUtility/master/LICENSE.md)
|
|
||||||
|
|
||||||
## GLTFUtility
|
|
||||||
Allows you to import and export glTF files during runtime and in editor.
|
|
||||||
glTF is a new opensource 3d model transmission format which supports everything you'll ever need from a format in Unity.
|
|
||||||
[Read more about glTF here](https://www.khronos.org/gltf/)
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### What makes GLTFUtility different?
|
|
||||||
Focusing on simplicity and ease of use, GLTFUtility aims to be an import-and-forget solution, keeping consistency with built-in functionality.
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
<details><summary>Using Unity Package Manager (<a href="https://docs.unity3d.com/Manual/upm-git.html">Help</a>)</summary>
|
|
||||||
|
|
||||||
1. `"com.siccity.gltfutility": "https://github.com/siccity/gltfutility.git"`
|
|
||||||
</details>
|
|
||||||
<details><summary>Using git</summary>
|
|
||||||
|
|
||||||
1. Get Newtonsoft.JSON from one of these sources
|
|
||||||
* Official upm package: `"com.unity.nuget.newtonsoft-json": "2.0.0-preview"`,
|
|
||||||
* Unofficial git repo: https://github.com/jilleJr/Newtonsoft.Json-for-Unity
|
|
||||||
2. Clone GLTFUtility by itself or as a submodule
|
|
||||||
* Clone into your assets folder `git clone git@github.com:Siccity/GLTFUtility.git`
|
|
||||||
* Add repo as submodule `git submodule add git@github.com:Siccity/GLTFUtility.git Assets/Submodules/GLTFUtility`
|
|
||||||
</details>
|
|
||||||
<details><summary>Manual download</summary>
|
|
||||||
|
|
||||||
1. Get [Newtonsoft.JSON](https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347) from the asset store
|
|
||||||
2. Download [GLTFUtility-master.zip](https://github.com/Siccity/GLTFUtility/archive/master.zip) and extract to your project assets
|
|
||||||
</details>
|
|
||||||
|
|
||||||
[Important notice](https://github.com/Siccity/GLTFUtility#Important-shader-note)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
*System*
|
|
||||||
- [x] Editor import
|
|
||||||
- [ ] Editor export
|
|
||||||
- [x] Runtime import API
|
|
||||||
- [ ] Runtime export API
|
|
||||||
- [x] GLTF format
|
|
||||||
- [x] GLB format
|
|
||||||
- [x] Multithreading
|
|
||||||
- [x] URP [#75](https://github.com/Siccity/GLTFUtility/issues/75)
|
|
||||||
- [ ] HDRP [#73](https://github.com/Siccity/GLTFUtility/issues/73)
|
|
||||||
- [ ] LWRP
|
|
||||||
|
|
||||||
*Spec*
|
|
||||||
- [x] Static mesh (with submeshes)
|
|
||||||
- [x] UVs (up to 8 channels)
|
|
||||||
- [x] Normals
|
|
||||||
- [x] Tangents
|
|
||||||
- [x] Vertex colors
|
|
||||||
- [x] Materials (metallic/specular, opaque/mask/blend)
|
|
||||||
- [x] Textures (embedded/external)
|
|
||||||
- [x] Remote textures (during async only)
|
|
||||||
- [x] Rig
|
|
||||||
- [ ] Avatar/Mask [#70](https://github.com/Siccity/GLTFUtility/issues/70)
|
|
||||||
- [x] Animations (multiple)
|
|
||||||
- [x] Morph targets (with experimental names)
|
|
||||||
- [x] Cameras
|
|
||||||
|
|
||||||
*Extensions*
|
|
||||||
- [x] KHR_texture_transform (partial support)
|
|
||||||
- [x] KHR_materials_pbrSpecularGlossiness
|
|
||||||
- [ ] KHR_lights_punctual [#25](https://github.com/Siccity/GLTFUtility/issues/25)
|
|
||||||
- [x] KHR_draco_mesh_compression [#27](https://github.com/Siccity/GLTFUtility/issues/27) WARNING: Said to cause issues on WebGL.
|
|
||||||
- [x] KHR_mesh_quantization
|
|
||||||
|
|
||||||
### Known issues
|
|
||||||
* `ArgumentNullException: Value cannot be null` in build but not in editor.
|
|
||||||
* This is most likely due to shaders being stripped from the build. To fix this, add the GLTFUtility shaders to the Always Included Shaders list in Graphic Settings.
|
|
||||||
* Draco compression does not work on iOS and UWP
|
|
||||||
* More info on [#133](https://github.com/Siccity/GLTFUtility/issues/133)
|
|
||||||
|
|
||||||
### Runtime import API
|
|
||||||
```cs
|
|
||||||
// Single thread
|
|
||||||
using Siccity.GLTFUtility;
|
|
||||||
|
|
||||||
void ImportGLTF(string filepath) {
|
|
||||||
GameObject result = Importer.LoadFromFile(filepath);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
```cs
|
|
||||||
// Multithreaded
|
|
||||||
using Siccity.GLTFUtility;
|
|
||||||
|
|
||||||
void ImportGLTFAsync(string filepath) {
|
|
||||||
Importer.ImportGLTFAsync(filepath, new ImportSettings(), OnFinishAsync);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnFinishAsync(GameObject result, AnimationClip[] animations) {
|
|
||||||
Debug.Log("Finished importing " + result.name);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Important shader note
|
|
||||||
To ensure that Unity includes the GLTFUtility shaders in builds, you must add these shaders to the 'Always Included Shaders' list.
|
|
||||||
|
|
||||||
1. Open Edit -> Project Settings
|
|
||||||
2. Open Graphics
|
|
||||||
3. Scroll to Always Included Shaders
|
|
||||||
4. Under Size, increase the value by 4 and hit Enter.
|
|
||||||
5. In the Project panel, navigate to Packages/GLTFUtility/Materials/Built-in.
|
|
||||||
6. In this directory are 4 .shader files.
|
|
||||||
7. Drag and drop each of the 4 files into one of the 4 newly created rows in Always Included Shaders.
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: a375268139388f44fa7e4f7cc8f8729d
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 1a53c6d71b38ddd45974d563dc47f847
|
|
||||||
folderAsset: yes
|
|
||||||
timeCreated: 1538919605
|
|
||||||
licenseType: Free
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
BIN
Assets/GLTFUtility-master/Scripts/.DS_Store
vendored
BIN
Assets/GLTFUtility-master/Scripts/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,122 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
// This is a modified version of the script from: https://jacksondunstan.com/articles/3568
|
|
||||||
/// <summary> Much faster than BinaryReader </summary>
|
|
||||||
public class BufferedBinaryReader : IDisposable {
|
|
||||||
private readonly Stream stream;
|
|
||||||
private readonly byte[] buffer;
|
|
||||||
private readonly int bufferSize;
|
|
||||||
private int bufferOffset;
|
|
||||||
private int bufferedBytes;
|
|
||||||
private int byteStride;
|
|
||||||
|
|
||||||
private Bit2Converter bit2Converter;
|
|
||||||
private Bit4Converter bit4Converter;
|
|
||||||
|
|
||||||
public long Position { get { return stream.Position + bufferOffset; } set { stream.Position = value; bufferedBytes = 0; bufferOffset = 0; } }
|
|
||||||
|
|
||||||
public BufferedBinaryReader(Stream stream, int bufferSize) {
|
|
||||||
this.stream = stream;
|
|
||||||
this.bufferSize = bufferSize;
|
|
||||||
buffer = new byte[bufferSize];
|
|
||||||
bufferOffset = 0;
|
|
||||||
bufferedBytes = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FillBuffer(int byteCount) {
|
|
||||||
int unreadBytes = bufferedBytes - bufferOffset;
|
|
||||||
|
|
||||||
if (unreadBytes < byteCount) {
|
|
||||||
// If not enough bytes left in buffer
|
|
||||||
if (unreadBytes != 0) {
|
|
||||||
// If buffer still has unread bytes, move them to start of buffer
|
|
||||||
Buffer.BlockCopy(buffer, bufferOffset, buffer, 0, unreadBytes);
|
|
||||||
}
|
|
||||||
bufferedBytes = stream.Read(buffer, unreadBytes, bufferSize - unreadBytes) + unreadBytes;
|
|
||||||
bufferOffset = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte ReadByte() {
|
|
||||||
FillBuffer(1);
|
|
||||||
return buffer[bufferOffset++];
|
|
||||||
}
|
|
||||||
|
|
||||||
public sbyte ReadSByte() {
|
|
||||||
FillBuffer(1);
|
|
||||||
return (sbyte) buffer[bufferOffset++];
|
|
||||||
}
|
|
||||||
|
|
||||||
public ushort ReadUInt16() {
|
|
||||||
FillBuffer(sizeof(ushort));
|
|
||||||
return bit2Converter.Read(buffer, ref bufferOffset).@ushort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public short ReadInt16() {
|
|
||||||
FillBuffer(sizeof(short));
|
|
||||||
return bit2Converter.Read(buffer, ref bufferOffset).@short;
|
|
||||||
}
|
|
||||||
|
|
||||||
public uint ReadUInt32() {
|
|
||||||
FillBuffer(sizeof(uint));
|
|
||||||
return bit4Converter.Read(buffer, ref bufferOffset).@uint;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ReadInt32() {
|
|
||||||
FillBuffer(sizeof(int));
|
|
||||||
return bit4Converter.Read(buffer, ref bufferOffset).@int;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float ReadSingle() {
|
|
||||||
FillBuffer(sizeof(float));
|
|
||||||
return bit4Converter.Read(buffer, ref bufferOffset).@float;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Skip(int bytes) {
|
|
||||||
FillBuffer(bytes);
|
|
||||||
bufferOffset += bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
|
||||||
public struct Bit2Converter {
|
|
||||||
[FieldOffset(0)] public byte b0;
|
|
||||||
[FieldOffset(1)] public byte b1;
|
|
||||||
[FieldOffset(0)] public short @short;
|
|
||||||
[FieldOffset(0)] public ushort @ushort;
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
public Bit2Converter Read(byte[] buffer, ref int bufferOffset) {
|
|
||||||
b0 = buffer[bufferOffset++];
|
|
||||||
b1 = buffer[bufferOffset++];
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
|
||||||
public struct Bit4Converter {
|
|
||||||
[FieldOffset(0)] public byte b0;
|
|
||||||
[FieldOffset(1)] public byte b1;
|
|
||||||
[FieldOffset(2)] public byte b2;
|
|
||||||
[FieldOffset(3)] public byte b3;
|
|
||||||
[FieldOffset(0)] public float @float;
|
|
||||||
[FieldOffset(0)] public int @int;
|
|
||||||
[FieldOffset(0)] public uint @uint;
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
public Bit4Converter Read(byte[] buffer, ref int bufferOffset) {
|
|
||||||
b0 = buffer[bufferOffset++];
|
|
||||||
b1 = buffer[bufferOffset++];
|
|
||||||
b2 = buffer[bufferOffset++];
|
|
||||||
b3 = buffer[bufferOffset++];
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose() {
|
|
||||||
stream.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3c0ec98d1cbd7324cbe265d9819a7b11
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6f0a1eaa625f4834c98391d4025b2fa2
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary> Converts from float array to Color during deserialization, and back </summary>
|
|
||||||
[Preserve] public class ColorRGBConverter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Color c = (Color) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(c.r);
|
|
||||||
writer.WriteValue(c.g);
|
|
||||||
writer.WriteValue(c.b);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] a = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Color(a[0], a[1], a[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Preserve] public class ColorRGBAConverter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Color c = (Color) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(c.r);
|
|
||||||
writer.WriteValue(c.g);
|
|
||||||
writer.WriteValue(c.b);
|
|
||||||
writer.WriteValue(c.a);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] a = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Color(a[0], a[1], a[2], a[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6532df4837460e147922cbb51088800d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary> Converts from string to enum during deserialization, and back </summary>
|
|
||||||
[Preserve] public class EnumConverter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
writer.WriteValue(value.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
string value = serializer.Deserialize<string>(reader);
|
|
||||||
if (Enum.IsDefined(objectType, value)) return Enum.Parse(objectType, value);
|
|
||||||
else return existingValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return typeof(Enum).IsAssignableFrom(objectType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: e2d1df10b03ea5f43acd4f34d6150bf9
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary> Converts from float array to Matrix4x4 during deserialization, and back </summary>
|
|
||||||
[Preserve] public class Matrix4x4Converter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Matrix4x4 m = (Matrix4x4) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
for (int i = 0; i < 16; i++) {
|
|
||||||
writer.WriteValue(m[i]);
|
|
||||||
}
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] floatArray = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Matrix4x4(
|
|
||||||
new Vector4(floatArray[0], floatArray[1], floatArray[2], floatArray[3]),
|
|
||||||
new Vector4(floatArray[4], floatArray[5], floatArray[6], floatArray[7]),
|
|
||||||
new Vector4(floatArray[8], floatArray[9], floatArray[10], floatArray[11]),
|
|
||||||
new Vector4(floatArray[12], floatArray[13], floatArray[14], floatArray[15])
|
|
||||||
);;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Matrix4x4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 948a6430ddecdb3409e998ba6e9a3704
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary>
|
|
||||||
/// Converts from float array to Quaternion during deserialization, and back.
|
|
||||||
/// Compensates for differing coordinate systems as well.
|
|
||||||
/// </summary>
|
|
||||||
[Preserve] public class QuaternionConverter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Quaternion q = (Quaternion) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(q.x);
|
|
||||||
writer.WriteValue(-q.y);
|
|
||||||
writer.WriteValue(-q.z);
|
|
||||||
writer.WriteValue(q.w);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] floatArray = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Quaternion(floatArray[0], -floatArray[1], -floatArray[2], floatArray[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Quaternion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 2cbe765fb9857a44696eb441e0e0bb25
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary>
|
|
||||||
/// Converts from float array to Vector3 during deserialization, and back.
|
|
||||||
/// Compensates for differing coordinate systems as well.
|
|
||||||
/// </summary>
|
|
||||||
[Preserve] public class TranslationConverter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Vector3 pos = (Vector3) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(-pos.x);
|
|
||||||
writer.WriteValue(pos.y);
|
|
||||||
writer.WriteValue(pos.z);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] floatArray = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Vector3(-floatArray[0], floatArray[1], floatArray[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Vector3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 7c0b75c128b76e2488f9284096ada72d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary> Converts from float array to Vector2 during deserialization, and back </summary>
|
|
||||||
[Preserve] public class Vector2Converter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Vector2 pos = (Vector2) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(pos.x);
|
|
||||||
writer.WriteValue(pos.y);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] floatArray = null;
|
|
||||||
try {
|
|
||||||
floatArray = serializer.Deserialize<float[]>(reader);
|
|
||||||
} catch (System.Exception) {
|
|
||||||
floatArray = new float[] { serializer.Deserialize<float>(reader) };
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (floatArray.Length) {
|
|
||||||
case 1:
|
|
||||||
return new Vector2(floatArray[0], floatArray[0]); // just copy float
|
|
||||||
case 2:
|
|
||||||
return new Vector2(floatArray[0], floatArray[1]);
|
|
||||||
case 3:
|
|
||||||
return new Vector2(floatArray[0], floatArray[1]); // we dont need third float
|
|
||||||
default:
|
|
||||||
return new Vector2(1, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Vector2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3270bccdd3fef254d9cb10fd0fc8bf51
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.Scripting;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility.Converters {
|
|
||||||
/// <summary> Converts from float array to Vector3 during deserialization, and back </summary>
|
|
||||||
[Preserve] public class Vector3Converter : JsonConverter {
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) {
|
|
||||||
Vector3 pos = (Vector3) value;
|
|
||||||
writer.WriteStartArray();
|
|
||||||
writer.WriteValue(pos.x);
|
|
||||||
writer.WriteValue(pos.y);
|
|
||||||
writer.WriteValue(pos.z);
|
|
||||||
writer.WriteEndArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
|
||||||
float[] floatArray = serializer.Deserialize<float[]>(reader);
|
|
||||||
return new Vector3(floatArray[0], floatArray[1], floatArray[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType) {
|
|
||||||
return objectType == typeof(Vector3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 27048007fcb96f94f9c0af0877a49845
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 46478e359a7c2694db7532f3a07945f0
|
|
||||||
folderAsset: yes
|
|
||||||
timeCreated: 1538919615
|
|
||||||
licenseType: Free
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#if HAVE_GLTFAST || HAVE_UNITYGLTF
|
|
||||||
#define ANOTHER_IMPORTER_HAS_HIGHER_PRIORITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !ANOTHER_IMPORTER_HAS_HIGHER_PRIORITY && !GLTFUTILITY_FORCE_DEFAULT_IMPORTER_OFF
|
|
||||||
#define ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
#endif
|
|
||||||
#if GLTFUTILITY_FORCE_DEFAULT_IMPORTER_ON
|
|
||||||
#define ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using UnityEngine;
|
|
||||||
#if !UNITY_2020_2_OR_NEWER
|
|
||||||
using UnityEditor.Experimental.AssetImporters;
|
|
||||||
#else
|
|
||||||
using UnityEditor.AssetImporters;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility {
|
|
||||||
#if ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
[ScriptedImporter(1, "glb")]
|
|
||||||
#else
|
|
||||||
[ScriptedImporter(2, null, overrideExts: new[] { "glb" })]
|
|
||||||
#endif
|
|
||||||
public class GLBImporter : GLTFImporter {
|
|
||||||
|
|
||||||
public override void OnImportAsset(AssetImportContext ctx) {
|
|
||||||
// Load asset
|
|
||||||
AnimationClip[] animations;
|
|
||||||
if (importSettings == null) importSettings = new ImportSettings();
|
|
||||||
GameObject root = Importer.LoadFromFile(ctx.assetPath, importSettings, out animations, Format.GLB);
|
|
||||||
// Save asset
|
|
||||||
GLTFAssetUtility.SaveToAsset(root, animations, ctx, importSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 768a5a18fd6eb914f980bf85dd7b34ec
|
|
||||||
timeCreated: 1538919678
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEditor;
|
|
||||||
#if !UNITY_2020_2_OR_NEWER
|
|
||||||
using UnityEditor.Experimental.AssetImporters;
|
|
||||||
#else
|
|
||||||
using UnityEditor.AssetImporters;
|
|
||||||
#endif
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility {
|
|
||||||
/// <summary> Contains methods for saving a gameobject as an asset </summary>
|
|
||||||
public static class GLTFAssetUtility {
|
|
||||||
public static void SaveToAsset(GameObject root, AnimationClip[] animations, AssetImportContext ctx, ImportSettings settings) {
|
|
||||||
#if UNITY_2018_2_OR_NEWER
|
|
||||||
ctx.AddObjectToAsset("main", root);
|
|
||||||
ctx.SetMainObject(root);
|
|
||||||
#else
|
|
||||||
ctx.SetMainAsset("main obj", root);
|
|
||||||
#endif
|
|
||||||
UnwrapParam? unwrapParams = new UnwrapParam()
|
|
||||||
{
|
|
||||||
angleError = settings.angleError,
|
|
||||||
areaError = settings.areaError,
|
|
||||||
hardAngle = settings.hardAngle,
|
|
||||||
packMargin = settings.packMargin
|
|
||||||
};
|
|
||||||
|
|
||||||
MeshRenderer[] renderers = root.GetComponentsInChildren<MeshRenderer>(true);
|
|
||||||
SkinnedMeshRenderer[] skinnedRenderers = root.GetComponentsInChildren<SkinnedMeshRenderer>(true);
|
|
||||||
MeshFilter[] filters = root.GetComponentsInChildren<MeshFilter>(true);
|
|
||||||
AddMeshes(filters, skinnedRenderers, ctx, settings.generateLightmapUVs ? unwrapParams : null);
|
|
||||||
AddMaterials(renderers, skinnedRenderers, ctx);
|
|
||||||
AddAnimations(animations, ctx, settings.animationSettings);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddMeshes(MeshFilter[] filters, SkinnedMeshRenderer[] skinnedRenderers, AssetImportContext ctx, UnwrapParam? lightmapUnwrapInfo) {
|
|
||||||
HashSet<Mesh> visitedMeshes = new HashSet<Mesh>();
|
|
||||||
for (int i = 0; i < filters.Length; i++) {
|
|
||||||
Mesh mesh = filters[i].sharedMesh;
|
|
||||||
if (lightmapUnwrapInfo.HasValue) Unwrapping.GenerateSecondaryUVSet(mesh, lightmapUnwrapInfo.Value);
|
|
||||||
if (visitedMeshes.Contains(mesh)) continue;
|
|
||||||
ctx.AddAsset(mesh.name, mesh);
|
|
||||||
visitedMeshes.Add(mesh);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < skinnedRenderers.Length; i++) {
|
|
||||||
Mesh mesh = skinnedRenderers[i].sharedMesh;
|
|
||||||
if (visitedMeshes.Contains(mesh)) continue;
|
|
||||||
ctx.AddAsset(mesh.name, mesh);
|
|
||||||
visitedMeshes.Add(mesh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddAnimations(AnimationClip[] animations, AssetImportContext ctx, AnimationSettings settings) {
|
|
||||||
if (animations == null) return;
|
|
||||||
|
|
||||||
// Editor-only animation settings
|
|
||||||
foreach (AnimationClip clip in animations) {
|
|
||||||
AnimationClipSettings clipSettings = AnimationUtility.GetAnimationClipSettings(clip);
|
|
||||||
clipSettings.loopTime = settings.looping;
|
|
||||||
AnimationUtility.SetAnimationClipSettings(clip, clipSettings);
|
|
||||||
}
|
|
||||||
|
|
||||||
HashSet<AnimationClip> visitedAnimations = new HashSet<AnimationClip>();
|
|
||||||
for (int i = 0; i < animations.Length; i++) {
|
|
||||||
AnimationClip clip = animations[i];
|
|
||||||
if (visitedAnimations.Contains(clip)) continue;
|
|
||||||
ctx.AddAsset(clip.name, clip);
|
|
||||||
visitedAnimations.Add(clip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddMaterials(MeshRenderer[] renderers, SkinnedMeshRenderer[] skinnedRenderers, AssetImportContext ctx) {
|
|
||||||
HashSet<Material> visitedMaterials = new HashSet<Material>();
|
|
||||||
HashSet<Texture2D> visitedTextures = new HashSet<Texture2D>();
|
|
||||||
for (int i = 0; i < renderers.Length; i++) {
|
|
||||||
foreach (Material mat in renderers[i].sharedMaterials) {
|
|
||||||
if (mat == GLTFMaterial.defaultMaterial) continue;
|
|
||||||
if (visitedMaterials.Contains(mat)) continue;
|
|
||||||
if (string.IsNullOrEmpty(mat.name)) mat.name = "material" + visitedMaterials.Count;
|
|
||||||
ctx.AddAsset(mat.name, mat);
|
|
||||||
visitedMaterials.Add(mat);
|
|
||||||
|
|
||||||
// Add textures
|
|
||||||
foreach (Texture2D tex in mat.AllTextures()) {
|
|
||||||
// Dont add asset textures
|
|
||||||
//if (images[i].isAsset) continue;
|
|
||||||
if (visitedTextures.Contains(tex)) continue;
|
|
||||||
if (AssetDatabase.Contains(tex)) continue;
|
|
||||||
if (string.IsNullOrEmpty(tex.name)) tex.name = "texture" + visitedTextures.Count;
|
|
||||||
ctx.AddAsset(tex.name, tex);
|
|
||||||
visitedTextures.Add(tex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < skinnedRenderers.Length; i++) {
|
|
||||||
foreach (Material mat in skinnedRenderers[i].sharedMaterials) {
|
|
||||||
if (visitedMaterials.Contains(mat)) continue;
|
|
||||||
if (string.IsNullOrEmpty(mat.name)) mat.name = "material" + visitedMaterials.Count;
|
|
||||||
ctx.AddAsset(mat.name, mat);
|
|
||||||
visitedMaterials.Add(mat);
|
|
||||||
|
|
||||||
// Add textures
|
|
||||||
foreach (Texture2D tex in mat.AllTextures()) {
|
|
||||||
// Dont add asset textures
|
|
||||||
//if (images[i].isAsset) continue;
|
|
||||||
if (visitedTextures.Contains(tex)) continue;
|
|
||||||
if (AssetDatabase.Contains(tex)) continue;
|
|
||||||
if (string.IsNullOrEmpty(tex.name)) tex.name = "texture" + visitedTextures.Count;
|
|
||||||
ctx.AddAsset(tex.name, tex);
|
|
||||||
visitedTextures.Add(tex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void AddAsset(this AssetImportContext ctx, string identifier, Object obj) {
|
|
||||||
#if UNITY_2018_2_OR_NEWER
|
|
||||||
ctx.AddObjectToAsset(identifier, obj);
|
|
||||||
#else
|
|
||||||
ctx.AddSubAsset(identifier, obj);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IEnumerable<Texture2D> AllTextures(this Material mat) {
|
|
||||||
int[] ids = mat.GetTexturePropertyNameIDs();
|
|
||||||
for (int i = 0; i < ids.Length; i++) {
|
|
||||||
Texture2D tex = mat.GetTexture(ids[i]) as Texture2D;
|
|
||||||
if (tex != null) yield return tex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: abda7048a5d68e74281dc3833f5a7a22
|
|
||||||
timeCreated: 1538919678
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
#if HAVE_GLTFAST || HAVE_UNITYGLTF
|
|
||||||
#define ANOTHER_IMPORTER_HAS_HIGHER_PRIORITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !ANOTHER_IMPORTER_HAS_HIGHER_PRIORITY && !GLTFUTILITY_FORCE_DEFAULT_IMPORTER_OFF
|
|
||||||
#define ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
#endif
|
|
||||||
#if GLTFUTILITY_FORCE_DEFAULT_IMPORTER_ON
|
|
||||||
#define ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !UNITY_2020_2_OR_NEWER
|
|
||||||
using UnityEditor.Experimental.AssetImporters;
|
|
||||||
#else
|
|
||||||
using UnityEditor.AssetImporters;
|
|
||||||
#endif
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Siccity.GLTFUtility {
|
|
||||||
#if ENABLE_DEFAULT_GLB_IMPORTER
|
|
||||||
[ScriptedImporter(1, "gltf")]
|
|
||||||
#else
|
|
||||||
[ScriptedImporter(1, null, overrideExts: new[] { "gltf" })]
|
|
||||||
#endif
|
|
||||||
public class GLTFImporter : ScriptedImporter {
|
|
||||||
|
|
||||||
public ImportSettings importSettings;
|
|
||||||
|
|
||||||
public override void OnImportAsset(AssetImportContext ctx) {
|
|
||||||
// Load asset
|
|
||||||
AnimationClip[] animations;
|
|
||||||
if (importSettings == null) importSettings = new ImportSettings();
|
|
||||||
GameObject root = Importer.LoadFromFile(ctx.assetPath, importSettings, out animations, Format.GLTF);
|
|
||||||
|
|
||||||
// Save asset
|
|
||||||
GLTFAssetUtility.SaveToAsset(root, animations, ctx, importSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 1fa4dafe23771ae498589f7f7c22c974
|
|
||||||
timeCreated: 1538919678
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user