diff --git a/Assets/Prefabs/UmaContainer.prefab b/Assets/Prefabs/UmaContainer.prefab index 8736e54..18adf69 100644 --- a/Assets/Prefabs/UmaContainer.prefab +++ b/Assets/Prefabs/UmaContainer.prefab @@ -691,7 +691,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 260, y: 260} + m_SizeDelta: {x: 265, y: 265} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5440685832306619784 CanvasRenderer: diff --git a/Assets/Scripts/DynamicBone/Scripts/DynamicBone.cs b/Assets/Scripts/DynamicBone/Scripts/DynamicBone.cs index 45a9d1d..7961901 100644 --- a/Assets/Scripts/DynamicBone/Scripts/DynamicBone.cs +++ b/Assets/Scripts/DynamicBone/Scripts/DynamicBone.cs @@ -82,11 +82,13 @@ public class DynamicBone : MonoBehaviour [Tooltip("The force apply to bones.")] #endif public Vector3 m_Force = Vector3.zero; - - - #if UNITY_5_3_OR_NEWER - [Tooltip("Bones exclude from physics simulation.")] + [Tooltip("The limit angle to bones.")] +#endif + public Vector3 m_LimitAngel_Min = Vector3.zero; + public Vector3 m_LimitAngel_Max = Vector3.zero; +#if UNITY_5_3_OR_NEWER + [Tooltip("Bones exclude from physics simulation.")] #endif public List m_Exclusions = null; @@ -131,6 +133,9 @@ public class DynamicBone : MonoBehaviour public float m_BoneLength = 0; public bool m_isCollide = false; + + public Vector3 m_LimitAngel_Min = Vector3.zero; + public Vector3 m_LimitAngel_Max = Vector3.zero; public Vector3 m_Position = Vector3.zero; public Vector3 m_PrevPosition = Vector3.zero; public Vector3 m_EndOffset = Vector3.zero; @@ -417,6 +422,8 @@ public class DynamicBone : MonoBehaviour p.m_Inert = m_Inert; p.m_Friction = m_Friction; p.m_Radius = m_Radius; + p.m_LimitAngel_Min = m_LimitAngel_Min; + p.m_LimitAngel_Max = m_LimitAngel_Max; if (m_BoneTotalLength > 0) { @@ -529,7 +536,8 @@ public class DynamicBone : MonoBehaviour // keep shape float stiffness = Mathf.Lerp(1.0f, p.m_Stiffness, m_Weight); - if (stiffness > 0 || p.m_Elasticity > 0) + float elasticity = p.m_Elasticity; + if (stiffness > 0 || elasticity > 0) { Matrix4x4 m0 = p0.m_Transform.localToWorldMatrix; m0.SetColumn(3, p0.m_Position); @@ -540,7 +548,7 @@ public class DynamicBone : MonoBehaviour restPos = m0.MultiplyPoint3x4(p.m_EndOffset); Vector3 d = restPos - p.m_Position; - p.m_Position += d * (p.m_Elasticity * timeVar); + p.m_Position += d * (elasticity * timeVar); if (stiffness > 0) { diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index 26d65ad..d8e8f07 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -167,7 +167,7 @@ public class UmaViewerBuilder : MonoBehaviour //Load Physics foreach (var asset1 in UmaViewerMain.Instance.AbChara.Where(a => a.Name.StartsWith(UmaDatabaseController.BodyPath + $"bdy{id}_{costumeId}/clothes"))) { - if (asset1.Name.Contains("cloth04")) + if (asset1.Name.Contains("cloth00")) RecursiveLoadAsset(asset1); } } diff --git a/Assets/Scripts/UmaViewerDownload.cs b/Assets/Scripts/UmaViewerDownload.cs index 9ab80e1..3d7ee1e 100644 --- a/Assets/Scripts/UmaViewerDownload.cs +++ b/Assets/Scripts/UmaViewerDownload.cs @@ -8,8 +8,9 @@ public class UmaViewerDownload : MonoBehaviour public static IEnumerator DownloadText(string url, System.Action callback) { UnityWebRequest www = UnityWebRequest.Get(url); + www.timeout = 3; yield return www.SendWebRequest(); - + if (www.result != UnityWebRequest.Result.Success) { Debug.Log(www.error); diff --git a/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs b/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs index 2220398..b2e8f45 100644 --- a/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs +++ b/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs @@ -36,6 +36,9 @@ namespace Gallop DynamicBones.Clear(); List gameObjects = new List(); gameObjects.AddRange(transform.parent.transform.parent.GetComponentsInChildren()); + + List colliders = new List(); + foreach (CySpringCollisionData collider in collisionParam) { if (collider._isInner) continue; @@ -61,6 +64,7 @@ namespace Gallop dynamic.m_Height = (collider._offset - collider._offset2).magnitude + collider._radius; dynamic.m_Radius = collider._radius; dynamic.m_Bound = collider._isInner ? DynamicBoneColliderBase.Bound.Inside : DynamicBoneColliderBase.Bound.Outside; + colliders.Add(dynamic); break; case CySpringCollisionData.CollisionType.Sphere: var Spheredynamic = child.AddComponent(); @@ -69,12 +73,14 @@ namespace Gallop Spheredynamic.m_Radius = collider._radius; Spheredynamic.m_Height = collider._distance; Spheredynamic.m_Bound = collider._isInner ? DynamicBoneColliderBase.Bound.Inside : DynamicBoneColliderBase.Bound.Outside; + colliders.Add(Spheredynamic); break; case CySpringCollisionData.CollisionType.Plane: var planedynamic = child.AddComponent(); planedynamic.ColliderName = collider._collisionName; child.transform.localPosition = collider._offset; planedynamic.m_Bound = collider._isInner ? DynamicBoneColliderBase.Bound.Inside : DynamicBoneColliderBase.Bound.Outside; + colliders.Add(planedynamic); break; case CySpringCollisionData.CollisionType.None: break; @@ -82,8 +88,7 @@ namespace Gallop } } - gameObjects.Clear(); - gameObjects.AddRange(transform.parent.transform.parent.GetComponentsInChildren()); + foreach(CySpringParamDataElement spring in springParam) { var bone = gameObjects.Find(a => { return a.name == spring._boneName; }); @@ -94,6 +99,8 @@ namespace Gallop dynamic.m_Root = bone; dynamic.m_UpdateMode = DynamicBone.UpdateMode.Normal; dynamic.m_Gravity = new Vector3(0, Mathf.Clamp01(-30 / spring._gravity), 0); + dynamic.m_LimitAngel_Min = spring._limitAngleMin; + dynamic.m_LimitAngel_Max = spring._limitAngleMax; if (isTail) { dynamic.m_Damping = 0.1f; @@ -108,13 +115,13 @@ namespace Gallop } dynamic.m_Radius = spring._collisionRadius; - + dynamic.m_Friction = 0.5f; dynamic.SetupParticles(); DynamicBones.Add(dynamic); foreach (string collisionName in spring._collisionNameList) { - var tmp = gameObjects.Find(a => { return a.name == collisionName; }); + var tmp = colliders.Find(a => { return a.gameObject.name == collisionName; }); if (tmp) { dynamic.Particles[0].m_Colliders.Add(tmp.GetComponent()); @@ -137,10 +144,13 @@ namespace Gallop tempParticle.m_Stiffness = Mathf.Clamp01(45 / spring._stiffnessForce); tempParticle.m_Elasticity = Mathf.Clamp01(45 / spring._dragForce); } + tempParticle.m_Friction = 0.5f; tempParticle.m_Radius = Childcollision._collisionRadius; + tempParticle.m_LimitAngel_Min = Childcollision._limitAngleMin; + tempParticle.m_LimitAngel_Max = Childcollision._limitAngleMax; foreach (string collisionName in Childcollision._collisionNameList) { - var tmp = gameObjects.Find(a => { return a.name == collisionName; }); + var tmp = colliders.Find(a => { return a.gameObject.name == collisionName; }); if (tmp) { tempParticle.m_Colliders.Add(tmp.GetComponent()); @@ -148,7 +158,6 @@ namespace Gallop } } } - } } }