MeshUtility.Humanoid を UniHumanoid.Humanoid に移動

This commit is contained in:
ousttrue
2021-06-01 18:24:07 +09:00
parent 56db0e2e54
commit 2d53b15559
9 changed files with 13 additions and 23 deletions

View File

@@ -6,7 +6,7 @@ using UnityEditor;
using UnityEngine;
using System;
namespace UniGLTF.MeshUtility
namespace UniHumanoid
{
[CustomEditor(typeof(Humanoid))]
public class HumanoidEditor : Editor

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 57cc7b16eb4146c4ab5631f538e2489f
guid: ee7ea50401b78f64a950f59564838270
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UniGLTF.MeshUtility
namespace UniHumanoid
{
/// <summary>
/// Bone割り当てを保持する。

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 889d98e41c0e8ff48bae50d1a729c2df
guid: 97a39af5b64ede64e86b92b5bf94a0e7
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UniGLTF.MeshUtility
namespace UniHumanoid
{
public static class HumanoidLoader
{
@@ -37,16 +37,6 @@ namespace UniGLTF.MeshUtility
return AvatarBuilder.BuildHumanAvatar(root.gameObject, description);
}
static SkeletonBone ToSkeletonBone(this Transform t)
{
var sb = new SkeletonBone();
sb.name = t.name;
sb.position = t.localPosition;
sb.rotation = t.localRotation;
sb.scale = t.localScale;
return sb;
}
static HumanBodyBones TraitToHumanBone(string x)
{
return (HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), x.Replace(" ", ""), true);

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 12453a111483e4145852e3b057e065d9
guid: 7b88d4c3436f9894ebc69f162d804cd4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -30,10 +30,10 @@ namespace UniVRM10
// humanoid
{
var humanoid = root.GetComponent<UniGLTF.MeshUtility.Humanoid>();
var humanoid = root.GetComponent<UniHumanoid.Humanoid>();
if (humanoid is null)
{
humanoid = root.AddComponent<UniGLTF.MeshUtility.Humanoid>();
humanoid = root.AddComponent<UniHumanoid.Humanoid>();
humanoid.AssignBonesFromAnimator();
}

View File

@@ -215,7 +215,7 @@ namespace UniVRM10
Root.name = "VRM1";
// humanoid
var humanoid = Root.AddComponent<UniGLTF.MeshUtility.Humanoid>();
var humanoid = Root.AddComponent<UniHumanoid.Humanoid>();
humanoid.AssignBones(m_map.Nodes.Select(x => (ToUnity(x.Key.HumanoidBone.GetValueOrDefault()), x.Value.transform)));
m_humanoid = humanoid.CreateAvatar();
m_humanoid.name = "humanoid";

View File

@@ -5,15 +5,15 @@
"MToon",
"UniGLTF",
"VRMShaders.GLTF.IO.Runtime",
"VRMShaders.VRM10.Format.Runtime"
"VRMShaders.VRM10.Format.Runtime",
"UniHumanoid"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
"defineConstraints": []
}