mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-26 00:29:19 -05:00
Merge commit '864b50492044c4799bb800363281a9d7b33aa59f' as 'Assets/VRM.Samples'
Co-authored-by: m2wasabi <m2wasabi@gmail.com> Co-authored-by: ousttrue <ousttrue@gmail.com> Co-authored-by: PoChang-Su <39595967+PoChang-Su@users.noreply.github.com> Co-authored-by: sh_akira <30430584+sh-akira@users.noreply.github.com> Co-authored-by: sh_akira <akira.satoh.sh@gmail.com> Co-authored-by: yutopp <yutopp@gmail.com>
This commit is contained in:
commit
a850c55e54
9
Assets/VRM.Samples/Editor.meta
Normal file
9
Assets/VRM.Samples/Editor.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 91da972a95b58d44e8c74ea97f9bb694
|
||||
folderAsset: yes
|
||||
timeCreated: 1524115554
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
241
Assets/VRM.Samples/Editor/VRMExportUnityPackage.cs
Normal file
241
Assets/VRM.Samples/Editor/VRMExportUnityPackage.cs
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using UnityEditor.Build.Reporting;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public static class VRMExportUnityPackage
|
||||
{
|
||||
static string GetDesktop()
|
||||
{
|
||||
return Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/VRM";
|
||||
}
|
||||
|
||||
const string DATE_FORMAT = "yyyyMMdd";
|
||||
const string PREFIX = "UniVRM";
|
||||
|
||||
static string System(string dir, string fileName, string args)
|
||||
{
|
||||
// Start the child process.
|
||||
var p = new System.Diagnostics.Process();
|
||||
// Redirect the output stream of the child process.
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
p.StartInfo.FileName = fileName;
|
||||
p.StartInfo.Arguments = args;
|
||||
p.StartInfo.WorkingDirectory = dir;
|
||||
if (!p.Start())
|
||||
{
|
||||
return "ERROR";
|
||||
}
|
||||
// Do not wait for the child process to exit before
|
||||
// reading to the end of its redirected stream.
|
||||
// p.WaitForExit();
|
||||
// Read the output stream first and then wait.
|
||||
string output = p.StandardOutput.ReadToEnd();
|
||||
string err = p.StandardError.ReadToEnd();
|
||||
p.WaitForExit();
|
||||
|
||||
if (string.IsNullOrEmpty(output))
|
||||
{
|
||||
return err;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
//const string GIT_PATH = "C:\\Program Files\\Git\\mingw64\\bin\\git.exe";
|
||||
const string GIT_PATH = "C:\\Program Files\\Git\\bin\\git.exe";
|
||||
|
||||
static string GetGitHash(string path)
|
||||
{
|
||||
return System(path, "git.exe", "rev-parse HEAD").Trim();
|
||||
}
|
||||
|
||||
#if false
|
||||
[MenuItem("VRM/git")]
|
||||
static void X()
|
||||
{
|
||||
var path = Application.dataPath;
|
||||
Debug.LogFormat("{0} => '{1}'", path, GetGitHash(path));
|
||||
}
|
||||
#endif
|
||||
|
||||
static string GetPath(string folder, string prefix)
|
||||
{
|
||||
//var date = DateTime.Today.ToString(DATE_FORMAT);
|
||||
|
||||
var path = string.Format("{0}/{1}-{2}_{3}.unitypackage",
|
||||
folder,
|
||||
prefix,
|
||||
VRMVersion.VERSION,
|
||||
GetGitHash(Application.dataPath + "/VRM").Substring(0, 4)
|
||||
).Replace("\\", "/");
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static IEnumerable<string> EnumerateFiles(string path, Func<string, bool> isExclude=null)
|
||||
{
|
||||
path = path.Replace("\\", "/");
|
||||
|
||||
if (Path.GetFileName(path).StartsWith(".git"))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (isExclude != null && isExclude(path))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
foreach (var child in Directory.GetFileSystemEntries(path))
|
||||
{
|
||||
foreach (var x in EnumerateFiles(child, isExclude))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetExtension(path).ToLower() == ".meta")
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
yield return path;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Build(string[] levels)
|
||||
{
|
||||
var buildPath = Path.GetFullPath(Application.dataPath + "/../build/build.exe");
|
||||
Debug.LogFormat("{0}", buildPath);
|
||||
var build = BuildPipeline.BuildPlayer(levels,
|
||||
buildPath,
|
||||
BuildTarget.StandaloneWindows,
|
||||
BuildOptions.None
|
||||
);
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
var iSuccess = build.summary.result != BuildResult.Succeeded;
|
||||
#else
|
||||
var iSuccess = !string.IsNullOrEmpty(build);
|
||||
#endif
|
||||
return iSuccess;
|
||||
}
|
||||
|
||||
public static bool BuildTestScene()
|
||||
{
|
||||
var levels = new string[] { "Assets/VRM.Samples/Scenes/VRMRuntimeLoaderSample.unity" };
|
||||
return Build(levels);
|
||||
}
|
||||
|
||||
#if VRM_DEVELOP
|
||||
[MenuItem(VRMVersion.VRM_VERSION + "/Export unitypackage")]
|
||||
#endif
|
||||
public static void CreateUnityPackageWithBuild()
|
||||
{
|
||||
var folder = GetDesktop();
|
||||
if (!Directory.Exists(folder))
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
}
|
||||
|
||||
CreateUnityPackage(folder, true);
|
||||
}
|
||||
|
||||
public static void CreateUnityPackage()
|
||||
{
|
||||
CreateUnityPackage(Path.GetFullPath(Path.Combine(Application.dataPath, "..")), false);
|
||||
}
|
||||
|
||||
static bool EndsWith(string path, params string[] exts)
|
||||
{
|
||||
foreach(var ext in exts)
|
||||
{
|
||||
if (path.EndsWith(ext))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(path.EndsWith(ext + ".meta"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ExcludeCsProj(string path)
|
||||
{
|
||||
/*
|
||||
if(EndsWith(path, "csproj", "sln", "csproj.user", "psess", "bin", "obj", "vsp", "vspx"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
if (path.EndsWith("/UniJSON/Profiling.meta"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (path.EndsWith("/UniJSON/Profiling"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (path.EndsWith("/UniGLTF/doc"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (path.EndsWith("/UniHumanoid/doc"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void CreateUnityPackage(string folder, bool build)
|
||||
{
|
||||
if (build)
|
||||
{
|
||||
// まずビルドする
|
||||
/*var iSuccess = */BuildTestScene();
|
||||
}
|
||||
|
||||
var path = GetPath(folder, PREFIX);
|
||||
if (File.Exists(path))
|
||||
{
|
||||
Debug.LogErrorFormat("{0} is already exists", path);
|
||||
return;
|
||||
}
|
||||
|
||||
// 本体
|
||||
{
|
||||
var files = EnumerateFiles("Assets/VRM", ExcludeCsProj).ToArray();
|
||||
Debug.LogFormat("{0}", string.Join("", files.Select((x, i) => string.Format("[{0:##0}] {1}\n", i, x)).ToArray()));
|
||||
AssetDatabase.ExportPackage(files
|
||||
, path,
|
||||
ExportPackageOptions.Default);
|
||||
}
|
||||
|
||||
// サンプル
|
||||
{
|
||||
AssetDatabase.ExportPackage(EnumerateFiles("Assets/VRM.Samples").Concat(EnumerateFiles("Assets/StreamingAssets")).ToArray()
|
||||
, GetPath(folder, PREFIX + "-RuntimeLoaderSample"),
|
||||
ExportPackageOptions.Default);
|
||||
}
|
||||
|
||||
Debug.LogFormat("exported: {0}", path);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Editor/VRMExportUnityPackage.cs.meta
Normal file
12
Assets/VRM.Samples/Editor/VRMExportUnityPackage.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6895a43269f0daf4eab06931c9a7724c
|
||||
timeCreated: 1521714822
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
106
Assets/VRM.Samples/Editor/VRMImportExportTests.cs
Normal file
106
Assets/VRM.Samples/Editor/VRMImportExportTests.cs
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
using NUnit.Framework;
|
||||
using System.IO;
|
||||
using UniJSON;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public static class JsonExtensions
|
||||
{
|
||||
public static void SetValue<T>(this ListTreeNode<JsonValue> node, string key, T value)
|
||||
{
|
||||
var f = new JsonFormatter();
|
||||
f.Serialize(value);
|
||||
var p = Utf8String.From(key);
|
||||
var bytes = f.GetStoreBytes();
|
||||
node.SetValue(p, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
public class VRMImportExportTests
|
||||
{
|
||||
[Test]
|
||||
public void ImportExportTest()
|
||||
{
|
||||
var path = UniGLTF.UnityPath.FromUnityPath("Models/Alicia_vrm-0.40/AliciaSolid_vrm-0.40.vrm");
|
||||
var context = new VRMImporterContext();
|
||||
context.ParseGlb(File.ReadAllBytes(path.FullPath));
|
||||
context.Load();
|
||||
context.ShowMeshes();
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
|
||||
using (new ActionDisposer(() => { GameObject.DestroyImmediate(context.Root); }))
|
||||
{
|
||||
var importJson = JsonParser.Parse(context.Json);
|
||||
importJson.SetValue("/extensions/VRM/exporterVersion", VRMVersion.VRM_VERSION);
|
||||
importJson.SetValue("/asset/generator", UniGLTF.UniGLTFVersion.UNIGLTF_VERSION);
|
||||
importJson.SetValue("/scene", 0);
|
||||
importJson.SetValue("/materials/*/doubleSided", false);
|
||||
//importJson.SetValue("/materials/*/pbrMetallicRoughness/roughnessFactor", 0);
|
||||
//importJson.SetValue("/materials/*/pbrMetallicRoughness/baseColorFactor", new float[] { 1, 1, 1, 1 });
|
||||
importJson.SetValue("/accessors/*/normalized", false);
|
||||
importJson.RemoveValue(Utf8String.From("/nodes/*/extras"));
|
||||
/*
|
||||
importJson.SetValue("/bufferViews/12/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/13/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/14/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/15/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/22/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/29/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/45/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/46/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/47/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/201/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/202/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/203/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/204/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/211/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/212/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/213/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/214/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/215/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/243/byteStride", 4);
|
||||
importJson.SetValue("/bufferViews/247/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/248/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/249/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/250/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/251/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/252/byteStride", 64);
|
||||
importJson.SetValue("/bufferViews/253/byteStride", 64);
|
||||
*/
|
||||
importJson.RemoveValue(Utf8String.From("/bufferViews/*/byteStride"));
|
||||
|
||||
var vrm = VRMExporter.Export(context.Root);
|
||||
var exportJson = JsonParser.Parse(vrm.ToJson());
|
||||
|
||||
/*
|
||||
foreach (var kv in importJson.Diff(exportJson))
|
||||
{
|
||||
Debug.Log(kv);
|
||||
}
|
||||
|
||||
Assert.AreEqual(importJson, exportJson);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MeshCoyTest()
|
||||
{
|
||||
var path = UniGLTF.UnityPath.FromUnityPath("Models/Alicia_vrm-0.40/AliciaSolid_vrm-0.40.vrm");
|
||||
var context = new VRMImporterContext();
|
||||
context.ParseGlb(File.ReadAllBytes(path.FullPath));
|
||||
context.Load();
|
||||
context.ShowMeshes();
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
|
||||
foreach (var mesh in context.Meshes)
|
||||
{
|
||||
var src = mesh.Mesh;
|
||||
var dst = src.Copy(true);
|
||||
MeshTests.MeshEquals(src, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Editor/VRMImportExportTests.cs.meta
Normal file
12
Assets/VRM.Samples/Editor/VRMImportExportTests.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 81c157c7c98f02742b7af724527af586
|
||||
timeCreated: 1532003904
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
72
Assets/VRM.Samples/Editor/VRMMaterialTests.cs
Normal file
72
Assets/VRM.Samples/Editor/VRMMaterialTests.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class VRMMaterialTests
|
||||
{
|
||||
/*
|
||||
[Test]
|
||||
public void ExportTest()
|
||||
{
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/vrm_unlit_texture");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("OPAQUE", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/vrm_unlit_transparent");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("BLEND", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/vrm_unlit_cutout");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("MASK", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/vrm_unlit_transparent_zwrite");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("BLEND", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/mtoon_opaque");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("OPAQUE", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/mtoon_transparent");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("BLEND", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/mtoon_cutout");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.AreEqual("MASK", exported.alphaMode);
|
||||
}
|
||||
{
|
||||
var material = Resources.Load<Material>("Materials/mtoon_culloff");
|
||||
var exporter = new VRMMaterialExporter();
|
||||
var exported = exporter.ExportMaterial(material, null);
|
||||
Assert.NotNull(exported.extensions.KHR_materials_unlit);
|
||||
Assert.True(exported.doubleSided);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Editor/VRMMaterialTests.cs.meta
Normal file
12
Assets/VRM.Samples/Editor/VRMMaterialTests.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 642d2c084bb4b914f9c58fddbf3e13fe
|
||||
timeCreated: 1534512276
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/VRM.Samples/Resources.meta
Normal file
9
Assets/VRM.Samples/Resources.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fbd8a7c017a393a44a493bf7ecd2451e
|
||||
folderAsset: yes
|
||||
timeCreated: 1534511944
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/VRM.Samples/Resources/Materials.meta
Normal file
9
Assets/VRM.Samples/Resources/Materials.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26d7ed395c3e16140bf224e5bae928a9
|
||||
folderAsset: yes
|
||||
timeCreated: 1534512466
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/VRM.Samples/Resources/Materials/mtoon_culloff.mat
Normal file
109
Assets/VRM.Samples/Resources/Materials/mtoon_culloff.mat
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: mtoon_culloff
|
||||
m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3}
|
||||
m_ShaderKeywords: _ALPHABLEND_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
RenderType: Transparent
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OutlineWidthTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ReceiveShadowTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ShadeTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SphereAdd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BlendMode: 2
|
||||
- _BumpScale: 1
|
||||
- _CullMode: 0
|
||||
- _Cutoff: 0.5
|
||||
- _DebugMode: 0
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 10
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _IsFirstSetup: 0
|
||||
- _LightColorAttenuation: 0
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OutlineColorMode: 0
|
||||
- _OutlineCullMode: 1
|
||||
- _OutlineLightingMix: 1
|
||||
- _OutlineScaledMaxDistance: 1
|
||||
- _OutlineWidth: 0.5
|
||||
- _OutlineWidthMode: 0
|
||||
- _Parallax: 0.02
|
||||
- _ReceiveShadowRate: 1
|
||||
- _ShadeShift: 0
|
||||
- _ShadeToony: 0.9
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 5
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2f68bfec1d0db5d499ece404719a87b7
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/VRM.Samples/Resources/Materials/mtoon_cutout.mat
Normal file
109
Assets/VRM.Samples/Resources/Materials/mtoon_cutout.mat
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: mtoon_cutout
|
||||
m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3}
|
||||
m_ShaderKeywords: _ALPHATEST_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 2450
|
||||
stringTagMap:
|
||||
RenderType: TransparentCutout
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OutlineWidthTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ReceiveShadowTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ShadeTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SphereAdd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BlendMode: 1
|
||||
- _BumpScale: 1
|
||||
- _CullMode: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DebugMode: 0
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _IsFirstSetup: 0
|
||||
- _LightColorAttenuation: 0
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OutlineColorMode: 0
|
||||
- _OutlineCullMode: 1
|
||||
- _OutlineLightingMix: 1
|
||||
- _OutlineScaledMaxDistance: 1
|
||||
- _OutlineWidth: 0.5
|
||||
- _OutlineWidthMode: 0
|
||||
- _Parallax: 0.02
|
||||
- _ReceiveShadowRate: 1
|
||||
- _ShadeShift: 0
|
||||
- _ShadeToony: 0.9
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 028c73ce97e955844a46f2c31f7a73e6
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/VRM.Samples/Resources/Materials/mtoon_opaque.mat
Normal file
109
Assets/VRM.Samples/Resources/Materials/mtoon_opaque.mat
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: mtoon_opaque
|
||||
m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OutlineWidthTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ReceiveShadowTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ShadeTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SphereAdd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BlendMode: 0
|
||||
- _BumpScale: 1
|
||||
- _CullMode: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DebugMode: 0
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _IsFirstSetup: 0
|
||||
- _LightColorAttenuation: 0
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OutlineColorMode: 0
|
||||
- _OutlineCullMode: 1
|
||||
- _OutlineLightingMix: 1
|
||||
- _OutlineScaledMaxDistance: 1
|
||||
- _OutlineWidth: 0.5
|
||||
- _OutlineWidthMode: 0
|
||||
- _Parallax: 0.02
|
||||
- _ReceiveShadowRate: 1
|
||||
- _ShadeShift: 0
|
||||
- _ShadeToony: 0.9
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f58e604715b8c284c8e0caa2eb5be2db
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/VRM.Samples/Resources/Materials/mtoon_transparent.mat
Normal file
109
Assets/VRM.Samples/Resources/Materials/mtoon_transparent.mat
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: mtoon_transparent
|
||||
m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3}
|
||||
m_ShaderKeywords: _ALPHABLEND_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
RenderType: Transparent
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OutlineWidthTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ReceiveShadowTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ShadeTexture:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SphereAdd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BlendMode: 2
|
||||
- _BumpScale: 1
|
||||
- _CullMode: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DebugMode: 0
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 10
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _IsFirstSetup: 0
|
||||
- _LightColorAttenuation: 0
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OutlineColorMode: 0
|
||||
- _OutlineCullMode: 1
|
||||
- _OutlineLightingMix: 1
|
||||
- _OutlineScaledMaxDistance: 1
|
||||
- _OutlineWidth: 0.5
|
||||
- _OutlineWidthMode: 0
|
||||
- _Parallax: 0.02
|
||||
- _ReceiveShadowRate: 1
|
||||
- _ShadeShift: 0
|
||||
- _ShadeToony: 0.9
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 5
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 91b6f2e3d51d4b5409b7ea64d5dce7d0
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
76
Assets/VRM.Samples/Resources/Materials/vrm_unlit_cutout.mat
Normal file
76
Assets/VRM.Samples/Resources/Materials/vrm_unlit_cutout.mat
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: vrm_unlit_cutout
|
||||
m_Shader: {fileID: 4800000, guid: 4c9ce97af40038f45811fc4b0975a483, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c4f60874fac8a3e4dadb10f4289ecec1
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
76
Assets/VRM.Samples/Resources/Materials/vrm_unlit_texture.mat
Normal file
76
Assets/VRM.Samples/Resources/Materials/vrm_unlit_texture.mat
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: vrm_unlit_texture
|
||||
m_Shader: {fileID: 4800000, guid: 1a70c9898704e1a4691843883f5101af, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: daa70eede7fd91c488c299a4adcd694c
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: vrm_unlit_transparent
|
||||
m_Shader: {fileID: 4800000, guid: df359ad0838642d4fa0339514fcbbb2d, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6c978a2f263013d47be96349c7a4c354
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: vrm_unlit_transparent_zwrite
|
||||
m_Shader: {fileID: 4800000, guid: 429a3203ab2959741aab76fa2856b450, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8203c783e4ba99145b40084a01065cac
|
||||
timeCreated: 1534511968
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/VRM.Samples/Scenes.meta
Normal file
9
Assets/VRM.Samples/Scenes.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c257ce65a5654e44a0603811b3a64f9
|
||||
folderAsset: yes
|
||||
timeCreated: 1524114846
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
5040
Assets/VRM.Samples/Scenes/SimpleViewer.unity
Normal file
5040
Assets/VRM.Samples/Scenes/SimpleViewer.unity
Normal file
File diff suppressed because it is too large
Load Diff
8
Assets/VRM.Samples/Scenes/SimpleViewer.unity.meta
Normal file
8
Assets/VRM.Samples/Scenes/SimpleViewer.unity.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5d0b0ec0bd1cdee4fbd25b64a6d059df
|
||||
timeCreated: 1524033960
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
889
Assets/VRM.Samples/Scenes/VRMRuntimeExporterSample.unity
Normal file
889
Assets/VRM.Samples/Scenes/VRMRuntimeExporterSample.unity
Normal file
|
|
@ -0,0 +1,889 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 8
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 3
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_ShadowMaskMode: 2
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &23707192
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 23707193}
|
||||
- component: {fileID: 23707196}
|
||||
- component: {fileID: 23707195}
|
||||
- component: {fileID: 23707194}
|
||||
m_Layer: 5
|
||||
m_Name: Export
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &23707193
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 23707192}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1219439930}
|
||||
m_Father: {fileID: 92488667}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 80, y: -62}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &23707194
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 23707192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 23707195}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!114 &23707195
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 23707192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!222 &23707196
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 23707192}
|
||||
--- !u!1 &92488662
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 92488667}
|
||||
- component: {fileID: 92488666}
|
||||
- component: {fileID: 92488665}
|
||||
- component: {fileID: 92488664}
|
||||
- component: {fileID: 92488663}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &92488663
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 92488662}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2228c0f2d73b1c54b82488d4f2504222, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_loadButton: {fileID: 1132913042}
|
||||
m_exportButton: {fileID: 23707194}
|
||||
--- !u!114 &92488664
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 92488662}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &92488665
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 92488662}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
--- !u!223 &92488666
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 92488662}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!224 &92488667
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 92488662}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 1132913041}
|
||||
- {fileID: 23707193}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1 &258802523
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 258802527}
|
||||
- component: {fileID: 258802526}
|
||||
- component: {fileID: 258802525}
|
||||
- component: {fileID: 258802524}
|
||||
m_Layer: 0
|
||||
m_Name: Plane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &258802524
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 258802523}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!64 &258802525
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 258802523}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Convex: 0
|
||||
m_InflateMesh: 0
|
||||
m_SkinWidth: 0.01
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &258802526
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 258802523}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &258802527
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 258802523}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1109443755
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1109443760}
|
||||
- component: {fileID: 1109443759}
|
||||
- component: {fileID: 1109443758}
|
||||
- component: {fileID: 1109443757}
|
||||
- component: {fileID: 1109443756}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1109443756
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1109443755}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &1109443757
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1109443755}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &1109443758
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1109443755}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1109443759
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1109443755}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 10
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &1109443760
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1109443755}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -2}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1132913040
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1132913041}
|
||||
- component: {fileID: 1132913044}
|
||||
- component: {fileID: 1132913043}
|
||||
- component: {fileID: 1132913042}
|
||||
m_Layer: 5
|
||||
m_Name: Load
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1132913041
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1132913040}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1543803958}
|
||||
m_Father: {fileID: 92488667}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 80, y: -15}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1132913042
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1132913040}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1132913043}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!114 &1132913043
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1132913040}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!222 &1132913044
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1132913040}
|
||||
--- !u!1 &1207079224
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1207079226}
|
||||
- component: {fileID: 1207079225}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1207079225
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1207079224}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1207079226
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1207079224}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &1219439929
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1219439930}
|
||||
- component: {fileID: 1219439932}
|
||||
- component: {fileID: 1219439931}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1219439930
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1219439929}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 23707193}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1219439931
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1219439929}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Export
|
||||
--- !u!222 &1219439932
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1219439929}
|
||||
--- !u!1 &1474386474
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1474386477}
|
||||
- component: {fileID: 1474386476}
|
||||
- component: {fileID: 1474386475}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1474386475
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1474386474}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
||||
--- !u!114 &1474386476
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1474386474}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 5
|
||||
--- !u!4 &1474386477
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1474386474}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1543803957
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1543803958}
|
||||
- component: {fileID: 1543803960}
|
||||
- component: {fileID: 1543803959}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1543803958
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1543803957}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1132913041}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1543803959
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1543803957}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Load
|
||||
--- !u!222 &1543803960
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1543803957}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e13b17ee8476e1f4ebe216d08cf33a4e
|
||||
timeCreated: 1531915246
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1743
Assets/VRM.Samples/Scenes/VRMRuntimeLoaderSample.Net4.unity
Normal file
1743
Assets/VRM.Samples/Scenes/VRMRuntimeLoaderSample.Net4.unity
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2f563e7bcfaebb74dbf9748df1f4824c
|
||||
timeCreated: 1520832729
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1711
Assets/VRM.Samples/Scenes/VRMRuntimeLoaderSample.unity
Normal file
1711
Assets/VRM.Samples/Scenes/VRMRuntimeLoaderSample.unity
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cb6ff948a1027244a86abf24f3445a87
|
||||
timeCreated: 1520832729
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/VRM.Samples/Scripts.meta
Normal file
9
Assets/VRM.Samples/Scripts.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d97e18dfaff15ed45908b0fca0f661ee
|
||||
folderAsset: yes
|
||||
timeCreated: 1524032882
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
73
Assets/VRM.Samples/Scripts/AIUEO.cs
Normal file
73
Assets/VRM.Samples/Scripts/AIUEO.cs
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class AIUEO : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public VRMBlendShapeProxy BlendShapes;
|
||||
private void Reset()
|
||||
{
|
||||
BlendShapes = GetComponent<VRMBlendShapeProxy>();
|
||||
}
|
||||
|
||||
Coroutine m_coroutine;
|
||||
|
||||
[SerializeField]
|
||||
float m_wait = 0.5f;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (BlendShapes == null)
|
||||
{
|
||||
BlendShapes = GetComponent<VRM.VRMBlendShapeProxy>();
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator RoutineNest(BlendShapePreset preset, float velocity, float wait)
|
||||
{
|
||||
for (var value = 0.0f; value <= 1.0f; value += velocity)
|
||||
{
|
||||
BlendShapes.ImmediatelySetValue(preset, value);
|
||||
yield return null;
|
||||
}
|
||||
BlendShapes.ImmediatelySetValue(preset, 1.0f);
|
||||
yield return new WaitForSeconds(wait);
|
||||
for (var value = 1.0f; value >= 0; value -= velocity)
|
||||
{
|
||||
BlendShapes.ImmediatelySetValue(preset, value);
|
||||
yield return null;
|
||||
}
|
||||
BlendShapes.ImmediatelySetValue(preset, 0);
|
||||
yield return new WaitForSeconds(wait * 2);
|
||||
}
|
||||
|
||||
IEnumerator Routine()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return new WaitForSeconds(1.0f);
|
||||
|
||||
var velocity = 0.1f;
|
||||
|
||||
yield return RoutineNest(BlendShapePreset.A, velocity, m_wait);
|
||||
yield return RoutineNest(BlendShapePreset.I, velocity, m_wait);
|
||||
yield return RoutineNest(BlendShapePreset.U, velocity, m_wait);
|
||||
yield return RoutineNest(BlendShapePreset.E, velocity, m_wait);
|
||||
yield return RoutineNest(BlendShapePreset.O, velocity, m_wait);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
m_coroutine = StartCoroutine(Routine());
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
StopCoroutine(m_coroutine);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/VRM.Samples/Scripts/AIUEO.cs.meta
Normal file
13
Assets/VRM.Samples/Scripts/AIUEO.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b62ca4f3096cada41938f18e4a02d8dc
|
||||
timeCreated: 1517463794
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/VRM.Samples/Scripts/CanvasManager.cs
Normal file
22
Assets/VRM.Samples/Scripts/CanvasManager.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class CanvasManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public Button LoadVRMButton;
|
||||
|
||||
[SerializeField]
|
||||
public Button LoadBVHButton;
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
LoadVRMButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadVRM");
|
||||
LoadBVHButton = GameObject.FindObjectsOfType<Button>().FirstOrDefault(x => x.name == "LoadBVH");
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/CanvasManager.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/CanvasManager.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1ae08a6ba07c0864c9132bc8a004030d
|
||||
timeCreated: 1520834280
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
118
Assets/VRM.Samples/Scripts/FileDialogForWindows.cs
Normal file
118
Assets/VRM.Samples/Scripts/FileDialogForWindows.cs
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
#if UNITY_STANDALONE_WIN
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
#endif
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public static class FileDialogForWindows
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
#region GetOpenFileName
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public class OpenFileName
|
||||
{
|
||||
public int structSize = 0;
|
||||
public IntPtr dlgOwner = IntPtr.Zero;
|
||||
public IntPtr instance = IntPtr.Zero;
|
||||
public String filter = null;
|
||||
public String customFilter = null;
|
||||
public int maxCustFilter = 0;
|
||||
public int filterIndex = 0;
|
||||
public String file = null;
|
||||
public int maxFile = 0;
|
||||
public String fileTitle = null;
|
||||
public int maxFileTitle = 0;
|
||||
public String initialDir = null;
|
||||
public String title = null;
|
||||
public int flags = 0;
|
||||
public short fileOffset = 0;
|
||||
public short fileExtension = 0;
|
||||
public String defExt = null;
|
||||
public IntPtr custData = IntPtr.Zero;
|
||||
public IntPtr hook = IntPtr.Zero;
|
||||
public String templateName = null;
|
||||
public IntPtr reservedPtr = IntPtr.Zero;
|
||||
public int reservedInt = 0;
|
||||
public int flagsEx = 0;
|
||||
}
|
||||
|
||||
[DllImport("Comdlg32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
|
||||
public static extern bool GetOpenFileName([In, Out] OpenFileName ofn);
|
||||
/*
|
||||
public static bool GetOpenFileName1([In, Out] OpenFileName ofn)
|
||||
{
|
||||
return GetOpenFileName(ofn);
|
||||
}
|
||||
*/
|
||||
|
||||
[DllImport("Comdlg32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
private static extern bool GetSaveFileName([In, Out] OpenFileName ofn);
|
||||
|
||||
static string Filter(params string[] filters)
|
||||
{
|
||||
return string.Join("\0", filters) + "\0";
|
||||
}
|
||||
public static string FileDialog(string title, params string[] extensions)
|
||||
{
|
||||
OpenFileName ofn = new OpenFileName();
|
||||
ofn.structSize = Marshal.SizeOf(ofn);
|
||||
|
||||
var filters = new List<string>();
|
||||
filters.Add("All Files"); filters.Add("*.*");
|
||||
foreach(var ext in extensions)
|
||||
{
|
||||
filters.Add(ext); filters.Add("*" + ext);
|
||||
}
|
||||
ofn.filter = Filter(filters.ToArray());
|
||||
ofn.filterIndex = 2;
|
||||
ofn.file = new string(new char[256]);
|
||||
ofn.maxFile = ofn.file.Length;
|
||||
ofn.fileTitle = new string(new char[64]);
|
||||
ofn.maxFileTitle = ofn.fileTitle.Length;
|
||||
ofn.initialDir = UnityEngine.Application.dataPath;
|
||||
ofn.title = title;
|
||||
//ofn.defExt = "PNG";
|
||||
ofn.flags = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008;//OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST| OFN_ALLOWMULTISELECT|OFN_NOCHANGEDIR
|
||||
if (!GetOpenFileName(ofn))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return ofn.file;
|
||||
}
|
||||
public static string SaveDialog(string title, string path)
|
||||
{
|
||||
var extension = Path.GetExtension(path);
|
||||
OpenFileName ofn = new OpenFileName();
|
||||
ofn.structSize = Marshal.SizeOf(ofn);
|
||||
ofn.filter = Filter("All Files", "*.*", extension, "*" + extension);
|
||||
ofn.filterIndex = 2;
|
||||
var chars = new char[256];
|
||||
var it = Path.GetFileName(path).GetEnumerator();
|
||||
for (int i = 0; i < chars.Length && it.MoveNext(); ++i)
|
||||
{
|
||||
chars[i] = it.Current;
|
||||
}
|
||||
ofn.file = new string(chars);
|
||||
ofn.maxFile = ofn.file.Length;
|
||||
ofn.fileTitle = new string(new char[64]);
|
||||
ofn.maxFileTitle = ofn.fileTitle.Length;
|
||||
ofn.initialDir = Path.GetDirectoryName(path);
|
||||
ofn.title = title;
|
||||
//ofn.defExt = "PNG";
|
||||
ofn.flags = 0x00000002 | 0x00000004; // OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
|
||||
if (!GetSaveFileName(ofn))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return ofn.file;
|
||||
}
|
||||
#endregion
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/FileDialogForWindows.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/FileDialogForWindows.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 649d78dc96acf5b4f83d54cd1859e940
|
||||
timeCreated: 1524038001
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
142
Assets/VRM.Samples/Scripts/RokuroCamera.cs
Normal file
142
Assets/VRM.Samples/Scripts/RokuroCamera.cs
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class RokuroCamera : MonoBehaviour
|
||||
{
|
||||
[Range(0.1f, 5.0f)]
|
||||
public float RotateSpeed = 0.7f;
|
||||
|
||||
[Range(0.1f, 5.0f)]
|
||||
public float GrabSpeed = 0.7f;
|
||||
|
||||
[Range(0.1f, 5.0f)]
|
||||
public float DollySpeed = 1.0f;
|
||||
|
||||
struct PosRot
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Quaternion Rotation;
|
||||
}
|
||||
|
||||
class _Rokuro
|
||||
{
|
||||
public float Yaw;
|
||||
public float Pitch;
|
||||
public float ShiftX;
|
||||
public float ShiftY;
|
||||
public float Distance = 2.0f;
|
||||
|
||||
public void Rotate(float x, float y)
|
||||
{
|
||||
Yaw += x;
|
||||
Pitch -= y;
|
||||
Pitch = Mathf.Clamp(Pitch, -90, 90);
|
||||
}
|
||||
|
||||
public void Grab(float x, float y)
|
||||
{
|
||||
ShiftX += x * Distance;
|
||||
ShiftY += y * Distance;
|
||||
}
|
||||
|
||||
public void Dolly(float delta)
|
||||
{
|
||||
if (delta > 0)
|
||||
{
|
||||
Distance *= 0.9f;
|
||||
}
|
||||
else if (delta < 0)
|
||||
{
|
||||
Distance *= 1.1f;
|
||||
}
|
||||
}
|
||||
|
||||
public PosRot Calc()
|
||||
{
|
||||
var r = Quaternion.Euler(Pitch, Yaw, 0);
|
||||
return new PosRot
|
||||
{
|
||||
Position = r * new Vector3(-ShiftX, -ShiftY, -Distance),
|
||||
Rotation = r,
|
||||
};
|
||||
}
|
||||
}
|
||||
private _Rokuro _currentCamera = new _Rokuro();
|
||||
|
||||
private List<Coroutine> _activeCoroutines = new List<Coroutine>();
|
||||
private void OnEnable()
|
||||
{
|
||||
// left mouse drag
|
||||
_activeCoroutines.Add(StartCoroutine(MouseDragOperationCoroutine(0, diff =>
|
||||
{
|
||||
_currentCamera.Rotate(diff.x * RotateSpeed, diff.y * RotateSpeed);
|
||||
})));
|
||||
// right mouse drag
|
||||
_activeCoroutines.Add(StartCoroutine(MouseDragOperationCoroutine(1, diff =>
|
||||
{
|
||||
_currentCamera.Rotate(diff.x * RotateSpeed, diff.y * RotateSpeed);
|
||||
})));
|
||||
// middle mouse drag
|
||||
_activeCoroutines.Add(StartCoroutine(MouseDragOperationCoroutine(2, diff =>
|
||||
{
|
||||
_currentCamera.Grab(
|
||||
diff.x * GrabSpeed / Screen.height,
|
||||
diff.y * GrabSpeed / Screen.height
|
||||
);
|
||||
})));
|
||||
// mouse wheel
|
||||
_activeCoroutines.Add(StartCoroutine(MouseScrollOperationCoroutine(diff =>
|
||||
{
|
||||
_currentCamera.Dolly(diff.y * DollySpeed);
|
||||
})));
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
foreach (var coroutine in _activeCoroutines)
|
||||
{
|
||||
StopCoroutine(coroutine);
|
||||
}
|
||||
_activeCoroutines.Clear();
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
var posRot = _currentCamera.Calc();
|
||||
|
||||
transform.localRotation = posRot.Rotation;
|
||||
transform.localPosition = posRot.Position;
|
||||
}
|
||||
private IEnumerator MouseDragOperationCoroutine(int buttonIndex, Action<Vector2> dragOperation)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
while (!Input.GetMouseButtonDown(buttonIndex))
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
var prevPos = Input.mousePosition;
|
||||
while (Input.GetMouseButton(buttonIndex))
|
||||
{
|
||||
var currPos = Input.mousePosition;
|
||||
var diff = currPos - prevPos;
|
||||
dragOperation(diff);
|
||||
|
||||
prevPos = currPos;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
private IEnumerator MouseScrollOperationCoroutine(Action<Vector2> scrollOperation)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
scrollOperation(Input.mouseScrollDelta);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/VRM.Samples/Scripts/RokuroCamera.cs.meta
Normal file
13
Assets/VRM.Samples/Scripts/RokuroCamera.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 77cf12e6f4085e246b0582a18a957bc1
|
||||
timeCreated: 1523878901
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
40
Assets/VRM.Samples/Scripts/TargetMover.cs
Normal file
40
Assets/VRM.Samples/Scripts/TargetMover.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class TargetMover : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
float m_radius = 5.0f;
|
||||
|
||||
[SerializeField]
|
||||
float m_angluarVelocity = 40.0f;
|
||||
|
||||
[SerializeField]
|
||||
float m_y = 1.5f;
|
||||
|
||||
[SerializeField]
|
||||
float m_height = 3.0f;
|
||||
|
||||
public IEnumerator Start()
|
||||
{
|
||||
var angle = 0.0f;
|
||||
|
||||
while (true)
|
||||
{
|
||||
angle += m_angluarVelocity * Time.deltaTime * Mathf.Deg2Rad;
|
||||
|
||||
var x = Mathf.Cos(angle) * m_radius;
|
||||
var z = Mathf.Sin(angle) * m_radius;
|
||||
var y = m_y + m_height * Mathf.Cos(angle / 3);
|
||||
|
||||
transform.localPosition = new Vector3(x, y, z);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/TargetMover.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/TargetMover.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c04054aea7a18b642b0a4905e808604e
|
||||
timeCreated: 1524045545
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
99
Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs
Normal file
99
Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using VRM;
|
||||
|
||||
|
||||
public class VRMRuntimeExporter : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
Button m_loadButton;
|
||||
|
||||
[SerializeField]
|
||||
Button m_exportButton;
|
||||
|
||||
GameObject m_model;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_loadButton.onClick.AddListener(OnLoadClicked);
|
||||
|
||||
m_exportButton.onClick.AddListener(OnExportClicked);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
m_exportButton.interactable = (m_model != null);
|
||||
}
|
||||
|
||||
#region Load
|
||||
void OnLoadClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
// なんらかの方法でByte列を得た
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// GLB形式でJSONを取得しParseします
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
|
||||
// metaを取得(todo: thumbnailテクスチャのロード)
|
||||
var meta = context.ReadMeta();
|
||||
Debug.LogFormat("meta: title:{0}", meta.Title);
|
||||
|
||||
// ParseしたJSONをシーンオブジェクトに変換していく
|
||||
context.LoadAsync(_ => OnLoaded(context));
|
||||
}
|
||||
|
||||
void OnLoaded(VRMImporterContext context)
|
||||
{
|
||||
if (m_model != null)
|
||||
{
|
||||
GameObject.Destroy(m_model.gameObject);
|
||||
}
|
||||
|
||||
m_model = context.Root;
|
||||
m_model.transform.rotation = Quaternion.Euler(0, 180, 0);
|
||||
|
||||
context.ShowMeshes();
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export
|
||||
void OnExportClicked()
|
||||
{
|
||||
//#if UNITY_STANDALONE_WIN
|
||||
#if false
|
||||
var path = FileDialogForWindows.SaveDialog("save VRM", Application.dataPath + "/export.vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/../export.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var vrm = VRMExporter.Export(m_model);
|
||||
var bytes = vrm.ToGlbBytes();
|
||||
File.WriteAllBytes(path, bytes);
|
||||
Debug.LogFormat("export to {0}", path);
|
||||
}
|
||||
|
||||
void OnExported(UniGLTF.glTF vrm)
|
||||
{
|
||||
Debug.LogFormat("exported");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/VRMRuntimeExporter.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2228c0f2d73b1c54b82488d4f2504222
|
||||
timeCreated: 1531915350
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
226
Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs
Normal file
226
Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
#pragma warning disable 0414
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class VRMRuntimeLoader : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
bool m_loadAsync;
|
||||
|
||||
[SerializeField, Header("GUI")]
|
||||
CanvasManager m_canvas;
|
||||
|
||||
[SerializeField]
|
||||
LookTarget m_faceCamera;
|
||||
|
||||
[SerializeField, Header("loader")]
|
||||
UniHumanoid.HumanPoseTransfer m_source;
|
||||
|
||||
[SerializeField]
|
||||
UniHumanoid.HumanPoseTransfer m_target;
|
||||
|
||||
[SerializeField, Header("runtime")]
|
||||
VRMFirstPerson m_firstPerson;
|
||||
|
||||
VRMBlendShapeProxy m_blendShape;
|
||||
|
||||
void SetupTarget()
|
||||
{
|
||||
if (m_target != null)
|
||||
{
|
||||
m_target.Source = m_source;
|
||||
m_target.SourceType = UniHumanoid.HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;
|
||||
|
||||
m_blendShape = m_target.GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
m_firstPerson = m_target.GetComponent<VRMFirstPerson>();
|
||||
|
||||
var animator = m_target.GetComponent<Animator>();
|
||||
if (animator != null)
|
||||
{
|
||||
m_firstPerson.Setup();
|
||||
|
||||
if (m_faceCamera != null)
|
||||
{
|
||||
m_faceCamera.Target = animator.GetBoneTransform(HumanBodyBones.Head);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SetupTarget();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
m_canvas.LoadVRMButton.onClick.AddListener(LoadVRMClicked);
|
||||
m_canvas.LoadBVHButton.onClick.AddListener(LoadBVHClicked);
|
||||
}
|
||||
|
||||
void LoadVRMClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
// なんらかの方法でByte列を得た
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// GLB形式でJSONを取得しParseします
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
|
||||
// metaを取得(todo: thumbnailテクスチャのロード)
|
||||
var meta = context.ReadMeta();
|
||||
Debug.LogFormat("meta: title:{0}", meta.Title);
|
||||
|
||||
|
||||
// ParseしたJSONをシーンオブジェクトに変換していく
|
||||
if (m_loadAsync)
|
||||
{
|
||||
LoadAsync(context);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Load();
|
||||
OnLoaded(context);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// メタが不要な場合のローダー
|
||||
/// </summary>
|
||||
void LoadVRMClicked_without_meta()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if true
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
// なんらかの方法でByte列を得た
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// GLB形式でJSONを取得しParseします
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
if (m_loadAsync)
|
||||
{
|
||||
// ローカルファイルシステムからロードします
|
||||
LoadAsync(context);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Load();
|
||||
OnLoaded(context);
|
||||
}
|
||||
|
||||
#else
|
||||
// ParseしたJSONをシーンオブジェクトに変換していく
|
||||
if (m_loadAsync)
|
||||
{
|
||||
// ローカルファイルシステムからロードします
|
||||
VRMImporter.LoadVrmAsync(path, OnLoaded);
|
||||
}
|
||||
else
|
||||
{
|
||||
var root=VRMImporter.LoadFromPath(path);
|
||||
OnLoaded(root);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void LoadAsync(VRMImporterContext context)
|
||||
{
|
||||
#if true
|
||||
var now = Time.time;
|
||||
context.LoadAsync(_ =>
|
||||
{
|
||||
var delta = Time.time - now;
|
||||
Debug.LogFormat("LoadAsync {0:0.0} seconds", delta);
|
||||
OnLoaded(context);
|
||||
});
|
||||
#else
|
||||
// ローカルファイルシステムからロードします
|
||||
VRMImporter.LoadVrmAsync(path, OnLoaded);
|
||||
#endif
|
||||
}
|
||||
|
||||
void LoadBVHClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open BVH", ".bvh");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
LoadBvh(path);
|
||||
}
|
||||
#else
|
||||
LoadBvh(Application.dataPath + "/default.bvh");
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnLoaded(VRMImporterContext context)
|
||||
{
|
||||
var root = context.Root;
|
||||
root.transform.SetParent(transform, false);
|
||||
|
||||
//メッシュを表示します
|
||||
context.ShowMeshes();
|
||||
|
||||
// add motion
|
||||
var humanPoseTransfer = root.AddComponent<UniHumanoid.HumanPoseTransfer>();
|
||||
if (m_target != null)
|
||||
{
|
||||
GameObject.Destroy(m_target.gameObject);
|
||||
}
|
||||
m_target = humanPoseTransfer;
|
||||
SetupTarget();
|
||||
}
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
context.Load();
|
||||
|
||||
if (m_source != null)
|
||||
{
|
||||
GameObject.Destroy(m_source.gameObject);
|
||||
}
|
||||
m_source = context.Root.GetComponent<UniHumanoid.HumanPoseTransfer>();
|
||||
|
||||
SetupTarget();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/VRMRuntimeLoader.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 03b059a6d90275246ba8622ac40a63dc
|
||||
timeCreated: 1517899576
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
180
Assets/VRM.Samples/Scripts/VRMRuntimeLoaderNet4.cs
Normal file
180
Assets/VRM.Samples/Scripts/VRMRuntimeLoaderNet4.cs
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
#pragma warning disable 0414
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
#if (NET_4_6 && UNITY_2017_1_OR_NEWER)
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class VRMRuntimeLoaderNet4 : MonoBehaviour
|
||||
{
|
||||
[SerializeField, Header("GUI")]
|
||||
CanvasManager m_canvas;
|
||||
|
||||
[SerializeField]
|
||||
LookTarget m_faceCamera;
|
||||
|
||||
[SerializeField, Header("loader")]
|
||||
UniHumanoid.HumanPoseTransfer m_source;
|
||||
|
||||
[SerializeField]
|
||||
UniHumanoid.HumanPoseTransfer m_target;
|
||||
|
||||
[SerializeField, Header("runtime")]
|
||||
VRMFirstPerson m_firstPerson;
|
||||
|
||||
#if (NET_4_6 && UNITY_2017_1_OR_NEWER)
|
||||
VRMBlendShapeProxy m_blendShape;
|
||||
|
||||
void SetupTarget()
|
||||
{
|
||||
if (m_target != null)
|
||||
{
|
||||
m_target.Source = m_source;
|
||||
m_target.SourceType = UniHumanoid.HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;
|
||||
|
||||
m_blendShape = m_target.GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
m_firstPerson = m_target.GetComponent<VRMFirstPerson>();
|
||||
|
||||
var animator = m_target.GetComponent<Animator>();
|
||||
if (animator != null)
|
||||
{
|
||||
m_firstPerson.Setup();
|
||||
|
||||
if (m_faceCamera != null)
|
||||
{
|
||||
m_faceCamera.Target = animator.GetBoneTransform(HumanBodyBones.Head);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SetupTarget();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (m_canvas == null)
|
||||
{
|
||||
Debug.LogWarning("no canvas");
|
||||
return;
|
||||
}
|
||||
|
||||
m_canvas.LoadVRMButton.onClick.AddListener(LoadVRMClicked);
|
||||
m_canvas.LoadBVHButton.onClick.AddListener(LoadBVHClicked);
|
||||
}
|
||||
|
||||
// Byte列を得る
|
||||
async static Task<Byte[]> ReadBytesAsync(string path)
|
||||
{
|
||||
return File.ReadAllBytes(path);
|
||||
}
|
||||
|
||||
async static Task<VRMImporterContext> LoadAsync(Byte[] bytes)
|
||||
{
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// GLB形式でJSONを取得しParseします
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
// ParseしたJSONをシーンオブジェクトに変換していく
|
||||
await context.LoadAsyncTask();
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Taskで非同期にロードする例
|
||||
/// </summary>
|
||||
async void LoadVRMClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
var bytes = await ReadBytesAsync(path);
|
||||
|
||||
// GLB形式でJSONを取得しParseします
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
// metaを取得(todo: thumbnailテクスチャのロード)
|
||||
var meta = context.ReadMeta();
|
||||
Debug.LogFormat("meta: title:{0}", meta.Title);
|
||||
|
||||
// ParseしたJSONをシーンオブジェクトに変換していく
|
||||
var now = Time.time;
|
||||
await context.LoadAsyncTask();
|
||||
|
||||
var delta = Time.time - now;
|
||||
Debug.LogFormat("LoadVrmAsync {0:0.0} seconds", delta);
|
||||
OnLoaded(context);
|
||||
|
||||
}
|
||||
|
||||
void LoadBVHClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open BVH", ".bvh");
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
LoadBvh(path);
|
||||
}
|
||||
#else
|
||||
LoadBvh(Application.dataPath + "/default.bvh");
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnLoaded(VRMImporterContext context)
|
||||
{
|
||||
var root = context.Root;
|
||||
root.transform.SetParent(transform, false);
|
||||
|
||||
//メッシュを表示します
|
||||
context.ShowMeshes();
|
||||
|
||||
// add motion
|
||||
var humanPoseTransfer = root.AddComponent<UniHumanoid.HumanPoseTransfer>();
|
||||
if (m_target != null)
|
||||
{
|
||||
GameObject.Destroy(m_target.gameObject);
|
||||
}
|
||||
m_target = humanPoseTransfer;
|
||||
SetupTarget();
|
||||
}
|
||||
|
||||
void LoadBvh(string path)
|
||||
{
|
||||
Debug.LogFormat("ImportBvh: {0}", path);
|
||||
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
|
||||
context.Parse(path);
|
||||
|
||||
context.Load();
|
||||
|
||||
if (m_source != null)
|
||||
{
|
||||
GameObject.Destroy(m_source.gameObject);
|
||||
}
|
||||
m_source = context.Root.GetComponent<UniHumanoid.HumanPoseTransfer>();
|
||||
|
||||
SetupTarget();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/VRMRuntimeLoaderNet4.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/VRMRuntimeLoaderNet4.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 649886f2803ade846a93be89f73e35c7
|
||||
timeCreated: 1517899576
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
373
Assets/VRM.Samples/Scripts/ViewerUI.cs
Normal file
373
Assets/VRM.Samples/Scripts/ViewerUI.cs
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UniHumanoid;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
public class ViewerUI : MonoBehaviour
|
||||
{
|
||||
#region UI
|
||||
[SerializeField]
|
||||
Text m_version;
|
||||
|
||||
[SerializeField]
|
||||
Button m_open;
|
||||
|
||||
[SerializeField]
|
||||
Toggle m_enableLipSync;
|
||||
|
||||
[SerializeField]
|
||||
Toggle m_enableAutoBlink;
|
||||
#endregion
|
||||
|
||||
[SerializeField]
|
||||
HumanPoseTransfer m_src;
|
||||
|
||||
[SerializeField]
|
||||
GameObject m_target;
|
||||
|
||||
[SerializeField]
|
||||
GameObject Root;
|
||||
|
||||
[Serializable]
|
||||
struct TextFields
|
||||
{
|
||||
[SerializeField, Header("Info")]
|
||||
Text m_textModelTitle;
|
||||
[SerializeField]
|
||||
Text m_textModelVersion;
|
||||
[SerializeField]
|
||||
Text m_textModelAuthor;
|
||||
[SerializeField]
|
||||
Text m_textModelContact;
|
||||
[SerializeField]
|
||||
Text m_textModelReference;
|
||||
[SerializeField]
|
||||
RawImage m_thumbnail;
|
||||
|
||||
[SerializeField, Header("CharacterPermission")]
|
||||
Text m_textPermissionAllowed;
|
||||
[SerializeField]
|
||||
Text m_textPermissionViolent;
|
||||
[SerializeField]
|
||||
Text m_textPermissionSexual;
|
||||
[SerializeField]
|
||||
Text m_textPermissionCommercial;
|
||||
[SerializeField]
|
||||
Text m_textPermissionOther;
|
||||
|
||||
[SerializeField, Header("DistributionLicense")]
|
||||
Text m_textDistributionLicense;
|
||||
[SerializeField]
|
||||
Text m_textDistributionOther;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
m_textModelTitle.text = "";
|
||||
m_textModelVersion.text = "";
|
||||
m_textModelAuthor.text = "";
|
||||
m_textModelContact.text = "";
|
||||
m_textModelReference.text = "";
|
||||
|
||||
m_textPermissionAllowed.text = "";
|
||||
m_textPermissionViolent.text = "";
|
||||
m_textPermissionSexual.text = "";
|
||||
m_textPermissionCommercial.text = "";
|
||||
m_textPermissionOther.text = "";
|
||||
|
||||
m_textDistributionLicense.text = "";
|
||||
m_textDistributionOther.text = "";
|
||||
}
|
||||
|
||||
public void UpdateMeta(VRMImporterContext context)
|
||||
{
|
||||
var meta = context.ReadMeta(true);
|
||||
|
||||
m_textModelTitle.text = meta.Title;
|
||||
m_textModelVersion.text = meta.Version;
|
||||
m_textModelAuthor.text = meta.Author;
|
||||
m_textModelContact.text = meta.ContactInformation;
|
||||
m_textModelReference.text = meta.Reference;
|
||||
|
||||
m_textPermissionAllowed.text = meta.AllowedUser.ToString();
|
||||
m_textPermissionViolent.text = meta.ViolentUssage.ToString();
|
||||
m_textPermissionSexual.text = meta.SexualUssage.ToString();
|
||||
m_textPermissionCommercial.text = meta.CommercialUssage.ToString();
|
||||
m_textPermissionOther.text = meta.OtherPermissionUrl;
|
||||
|
||||
m_textDistributionLicense.text = meta.LicenseType.ToString();
|
||||
m_textDistributionOther.text = meta.OtherLicenseUrl;
|
||||
|
||||
m_thumbnail.texture = meta.Thumbnail;
|
||||
}
|
||||
}
|
||||
[SerializeField]
|
||||
TextFields m_texts;
|
||||
|
||||
[Serializable]
|
||||
struct UIFields
|
||||
{
|
||||
[SerializeField]
|
||||
Toggle ToggleMotionTPose;
|
||||
|
||||
[SerializeField]
|
||||
Toggle ToggleMotionBVH;
|
||||
|
||||
[SerializeField]
|
||||
ToggleGroup ToggleMotion;
|
||||
|
||||
Toggle m_activeToggleMotion;
|
||||
|
||||
public void UpdateTogle(Action onBvh, Action onTPose)
|
||||
{
|
||||
var value = ToggleMotion.ActiveToggles().FirstOrDefault();
|
||||
if (value == m_activeToggleMotion)
|
||||
return;
|
||||
|
||||
m_activeToggleMotion = value;
|
||||
if (value == ToggleMotionTPose)
|
||||
{
|
||||
onTPose();
|
||||
}
|
||||
else if (value == ToggleMotionBVH)
|
||||
{
|
||||
onBvh();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("motion: no toggle");
|
||||
}
|
||||
}
|
||||
}
|
||||
[SerializeField]
|
||||
UIFields m_ui;
|
||||
|
||||
[SerializeField]
|
||||
HumanPoseClip m_pose;
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
var buttons = GameObject.FindObjectsOfType<Button>();
|
||||
m_open = buttons.First(x => x.name == "Open");
|
||||
|
||||
var toggles = GameObject.FindObjectsOfType<Toggle>();
|
||||
m_enableLipSync = toggles.First(x => x.name == "EnableLipSync");
|
||||
m_enableAutoBlink = toggles.First(x => x.name == "EnableAutoBlink");
|
||||
|
||||
var texts = GameObject.FindObjectsOfType<Text>();
|
||||
m_version = texts.First(x => x.name == "Version");
|
||||
|
||||
m_src = GameObject.FindObjectOfType<HumanPoseTransfer>();
|
||||
|
||||
m_target = GameObject.FindObjectOfType<TargetMover>().gameObject;
|
||||
}
|
||||
|
||||
HumanPoseTransfer m_loaded;
|
||||
|
||||
AIUEO m_lipSync;
|
||||
bool m_enableLipSyncValue;
|
||||
bool EnableLipSyncValue
|
||||
{
|
||||
set
|
||||
{
|
||||
if (m_enableLipSyncValue == value) return;
|
||||
m_enableLipSyncValue = value;
|
||||
if (m_lipSync != null)
|
||||
{
|
||||
m_lipSync.enabled = m_enableLipSyncValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Blinker m_blink;
|
||||
bool m_enableBlinkValue;
|
||||
bool EnableBlinkValue
|
||||
{
|
||||
set
|
||||
{
|
||||
if (m_blink == value) return;
|
||||
m_enableBlinkValue = value;
|
||||
if (m_blink != null)
|
||||
{
|
||||
m_blink.enabled = m_enableBlinkValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_version.text = string.Format("VRMViewer {0}.{1}",
|
||||
VRMVersion.MAJOR, VRMVersion.MINOR);
|
||||
m_open.onClick.AddListener(OnOpenClicked);
|
||||
|
||||
// load initial bvh
|
||||
LoadMotion(Application.streamingAssetsPath + "/test.txt");
|
||||
|
||||
string[] cmds = System.Environment.GetCommandLineArgs();
|
||||
if (cmds.Length > 1)
|
||||
{
|
||||
LoadModel(cmds[1]);
|
||||
}
|
||||
|
||||
m_texts.Start();
|
||||
}
|
||||
|
||||
private void LoadMotion(string path)
|
||||
{
|
||||
var context = new UniHumanoid.BvhImporterContext();
|
||||
context.Parse(path);
|
||||
context.Load();
|
||||
SetMotion(context.Root.GetComponent<HumanPoseTransfer>());
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
EnableLipSyncValue = m_enableLipSync.isOn;
|
||||
EnableBlinkValue = m_enableAutoBlink.isOn;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Tab))
|
||||
{
|
||||
if (Root != null) Root.SetActive(!Root.activeSelf);
|
||||
}
|
||||
|
||||
m_ui.UpdateTogle(EnableBvh, EnableTPose);
|
||||
}
|
||||
|
||||
void EnableBvh()
|
||||
{
|
||||
if (m_loaded != null)
|
||||
{
|
||||
m_loaded.Source = m_src;
|
||||
m_loaded.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;
|
||||
}
|
||||
}
|
||||
|
||||
void EnableTPose()
|
||||
{
|
||||
if (m_loaded != null)
|
||||
{
|
||||
m_loaded.PoseClip = m_pose;
|
||||
m_loaded.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseClip;
|
||||
}
|
||||
}
|
||||
|
||||
void OnOpenClicked()
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", "vrm", "glb", "bvh");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
switch (ext)
|
||||
{
|
||||
case ".gltf":
|
||||
case ".glb":
|
||||
case ".vrm":
|
||||
LoadModel(path);
|
||||
break;
|
||||
|
||||
case ".bvh":
|
||||
LoadMotion(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadModel(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.LogFormat("{0}", path);
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
switch (ext)
|
||||
{
|
||||
case ".vrm":
|
||||
{
|
||||
var context = new VRMImporterContext();
|
||||
var file = File.ReadAllBytes(path);
|
||||
context.ParseGlb(file);
|
||||
m_texts.UpdateMeta(context);
|
||||
context.Load();
|
||||
context.ShowMeshes();
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
context.ShowMeshes();
|
||||
SetModel(context.Root);
|
||||
break;
|
||||
}
|
||||
|
||||
case ".glb":
|
||||
{
|
||||
var context = new UniGLTF.ImporterContext();
|
||||
var file = File.ReadAllBytes(path);
|
||||
context.ParseGlb(file);
|
||||
context.Load();
|
||||
context.ShowMeshes();
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
context.ShowMeshes();
|
||||
SetModel(context.Root);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
Debug.LogWarningFormat("unknown file type: {0}", path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetModel(GameObject go)
|
||||
{
|
||||
// cleanup
|
||||
var loaded = m_loaded;
|
||||
m_loaded = null;
|
||||
|
||||
if (loaded != null)
|
||||
{
|
||||
Debug.LogFormat("destroy {0}", loaded);
|
||||
GameObject.Destroy(loaded.gameObject);
|
||||
}
|
||||
|
||||
if (go != null)
|
||||
{
|
||||
var lookAt = go.GetComponent<VRMLookAtHead>();
|
||||
if (lookAt != null)
|
||||
{
|
||||
m_loaded = go.AddComponent<HumanPoseTransfer>();
|
||||
m_loaded.Source = m_src;
|
||||
m_loaded.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;
|
||||
|
||||
m_lipSync = go.AddComponent<AIUEO>();
|
||||
m_blink = go.AddComponent<Blinker>();
|
||||
|
||||
lookAt.Target = m_target.transform;
|
||||
lookAt.UpdateType = UpdateType.LateUpdate; // after HumanPoseTransfer's setPose
|
||||
}
|
||||
|
||||
var animation = go.GetComponent<Animation>();
|
||||
if (animation && animation.clip != null)
|
||||
{
|
||||
animation.Play(animation.clip.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetMotion(HumanPoseTransfer src)
|
||||
{
|
||||
m_src = src;
|
||||
src.GetComponent<Renderer>().enabled = false;
|
||||
|
||||
EnableBvh();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/VRM.Samples/Scripts/ViewerUI.cs.meta
Normal file
12
Assets/VRM.Samples/Scripts/ViewerUI.cs.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ff4c2e543f3a9143a42e9d01e7d9bc4
|
||||
timeCreated: 1524037800
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue
Block a user