diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor.meta new file mode 100644 index 000000000..03d25d893 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 78593d828a6c64142bffa9e5b8e514dc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs new file mode 100644 index 000000000..5f2153c65 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs @@ -0,0 +1,52 @@ +using UnityEditor; +using UnityEngine; +using UniVRM10; + + +namespace RotateParticle.Components +{ + public static class Converter + { + const string FROM_VRM10_MENU = "GameObject/CreateRotateParticleFromVrm10"; + + [MenuItem(FROM_VRM10_MENU, true)] + public static bool IsFromVrm10() + { + var go = Selection.activeGameObject; + if (go == null) + { + return false; + } + return go.GetComponent() != null; + } + + [MenuItem(FROM_VRM10_MENU, false)] + public static void FromVrm10() + { + var go = Selection.activeGameObject; + var instance = go.GetComponent(); + + foreach (var spring in instance.SpringBone.Springs) + { + if (spring.Joints == null || spring.Joints[0] == null) + { + continue; + } + + var root = spring.Joints[0].gameObject; + if (root == null) + { + continue; + } + + if (root.GetComponent() != null) + { + continue; + } + + UnityEditor.Undo.IncrementCurrentGroup(); + UnityEditor.Undo.SetCurrentGroupName("VRM10SpringBoneColliderGroup.Separate"); + } + } + } +} \ No newline at end of file diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs.meta new file mode 100644 index 000000000..ebca8bc25 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/Converter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80a9e5abcd0197a46b50bcd2a1c62561 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef new file mode 100644 index 000000000..c91fbf05f --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "RotateParticle.Editor", + "rootNamespace": "", + "references": [ + "GUID:308b348fb80d89d42a9620951b0f60db", + "GUID:e47c917724578cc43b5506c17a27e9a0" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef.meta new file mode 100644 index 000000000..62edd5f6b --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Editor/RotateParticle.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a3dafcb1fb23ff148bbc17714d01144c +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md b/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md new file mode 100644 index 000000000..f3a7508fb --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md @@ -0,0 +1,8 @@ +# cloth 実装メモ + +## component + +設定置き場。布を構成する縦糸(Warp)と、縦糸を横に連結した四角格子(Cloth)の2段階とする + +### Warp + diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md.meta new file mode 100644 index 000000000..612da64ba --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3c501aa9d3818bf419f0bcb53c59e91d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components.meta new file mode 100644 index 000000000..72a1bab69 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a8d83c5cee1b1349a818b15bfe48c35 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs new file mode 100644 index 000000000..77b9db313 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +namespace RotateParticle.Components +{ + [AddComponentMenu("RotateParticle/Cloth")] + [DisallowMultipleComponent] + public class Cloth : MonoBehaviour + { + [SerializeField] + public bool Loop = false; + + [SerializeField] + public List Warps = new(); + } +} \ No newline at end of file diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs.meta new file mode 100644 index 000000000..595c6ac67 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Cloth.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb08bedf8ccf007488d5907f401f289d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs new file mode 100644 index 000000000..3be388f61 --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + + +namespace RotateParticle.Components +{ + [AddComponentMenu("RotateParticle/Warp")] + [DisallowMultipleComponent] + public class Warp : MonoBehaviour + { + [Serializable] + public class ParticleSettings + { + } + + /// + /// VRM10SpringBoneJoint に相当する + /// + [Serializable] + public class Particle + { + public bool useInheritSettings; + public ParticleSettings OverrideSettings; + } + + [SerializeField] + ParticleSettings BaseSettings; + + /// + /// null のときは world root ではなく model root で処理 + /// + [SerializeField] + Transform Center; + + /// + /// 枝分かれ不可 + /// + [SerializeField] + List Particles = new List(); + + void Reset() + { + Debug.Log("Warp.Reset"); + } + + void OnValidate() + { + // 枝分かれを削除 + Debug.Log("Warp.OnValidate"); + } + } +} diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs.meta new file mode 100644 index 000000000..c52669e6f --- /dev/null +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Components/Warp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d9e9d5010d025b4c9cdfb03eb8b1b0b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/RotateParticle.asmdef b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticle.asmdef similarity index 100% rename from Assets/VRM10_Samples/ClothSample/RotateParticle/RotateParticle.asmdef rename to Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticle.asmdef diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/RotateParticle.asmdef.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticle.asmdef.meta similarity index 100% rename from Assets/VRM10_Samples/ClothSample/RotateParticle/RotateParticle.asmdef.meta rename to Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticle.asmdef.meta diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticleSpringboneRuntime.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticleSpringboneRuntime.cs index 88250ecbe..248c29b81 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticleSpringboneRuntime.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/RotateParticleSpringboneRuntime.cs @@ -274,5 +274,9 @@ namespace RotateParticle public void SetModelLevel(Transform modelRoot, BlittableModelLevel modelSettings) { } + + public void DrawGizmos() + { + } } } \ No newline at end of file diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Scenes.meta b/Assets/VRM10_Samples/ClothSample/RotateParticle/Scenes.meta index 20e52fe13..1f1f7737a 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Scenes.meta +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Scenes.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cfa6b58a8a8571e478cf6bac4a00a23d +guid: d81d1a51508391a468106bec0350d41b folderAsset: yes DefaultImporter: externalObjects: {}