From ac63cfe83e5ae3809552bfae38d6d7b90509df0e Mon Sep 17 00:00:00 2001 From: CroakFang <1605296300@qq.com> Date: Mon, 11 Dec 2023 21:36:43 +0800 Subject: [PATCH] Improving physics and code --- .../New Render Texture.renderTexture | 38 ------------------- .../New Render Texture.renderTexture.meta | 8 ---- Assets/Scripts/Manifest/ManifestDB.cs | 5 ++- Assets/Scripts/UmaContainerCharacter.cs | 10 +++++ .../umamusume/Gallop/CySpringDataContainer.cs | 8 ++++ .../umamusume/Gallop/FaceDrivenKeyTarget.cs | 3 +- .../Gallop/Live/Cutt/LiveTimelineWorkSheet.cs | 12 +++++- 7 files changed, 33 insertions(+), 51 deletions(-) delete mode 100644 Assets/Resources/RenderPipeline/New Render Texture.renderTexture delete mode 100644 Assets/Resources/RenderPipeline/New Render Texture.renderTexture.meta diff --git a/Assets/Resources/RenderPipeline/New Render Texture.renderTexture b/Assets/Resources/RenderPipeline/New Render Texture.renderTexture deleted file mode 100644 index 923f7d0..0000000 --- a/Assets/Resources/RenderPipeline/New Render Texture.renderTexture +++ /dev/null @@ -1,38 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!84 &8400000 -RenderTexture: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: New Render Texture - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_ForcedFallbackFormat: 4 - m_DownscaleFallback: 0 - m_IsAlphaChannelOptional: 0 - serializedVersion: 3 - m_Width: 256 - m_Height: 256 - m_AntiAliasing: 1 - m_MipCount: -1 - m_DepthFormat: 2 - m_ColorFormat: 8 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_UseDynamicScale: 0 - m_BindMS: 0 - m_EnableCompatibleFormat: 1 - m_TextureSettings: - serializedVersion: 2 - m_FilterMode: 1 - m_Aniso: 0 - m_MipBias: 0 - m_WrapU: 1 - m_WrapV: 1 - m_WrapW: 1 - m_Dimension: 2 - m_VolumeDepth: 1 diff --git a/Assets/Resources/RenderPipeline/New Render Texture.renderTexture.meta b/Assets/Resources/RenderPipeline/New Render Texture.renderTexture.meta deleted file mode 100644 index 7db29f1..0000000 --- a/Assets/Resources/RenderPipeline/New Render Texture.renderTexture.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b477824ce76ecac4ba9da6034f4994e0 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 8400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Manifest/ManifestDB.cs b/Assets/Scripts/Manifest/ManifestDB.cs index ab748a9..d9ecc92 100644 --- a/Assets/Scripts/Manifest/ManifestDB.cs +++ b/Assets/Scripts/Manifest/ManifestDB.cs @@ -304,7 +304,8 @@ public class ManifestDB public IEnumerator DownloadManifest(string hash) { - UnityWebRequest www = UnityWebRequest.Get(UmaViewerDownload.GetManifestRequestUrl(hash)); + var url = UmaViewerDownload.GetManifestRequestUrl(hash); + UnityWebRequest www = UnityWebRequest.Get(url); www.timeout = 15; yield return www.SendWebRequest(); if (www.result == UnityWebRequest.Result.Success) @@ -313,7 +314,7 @@ public class ManifestDB } else { - Debug.LogError("Download Manifest Failed :" + www.error); + Debug.LogError($"Download Manifest Failed :{url} {www.error}"); callback?.Invoke($"Download Manifest Failed :{www.error}", UIMessageType.Error); isError = true; yield break; diff --git a/Assets/Scripts/UmaContainerCharacter.cs b/Assets/Scripts/UmaContainerCharacter.cs index 4238046..62e4ca9 100644 --- a/Assets/Scripts/UmaContainerCharacter.cs +++ b/Assets/Scripts/UmaContainerCharacter.cs @@ -291,6 +291,15 @@ public class UmaContainerCharacter : UmaContainer } } + public void ResetDynamicBone() + { + if (IsMini) return; + foreach (CySpringDataContainer cySpring in cySpringDataContainers) + { + cySpring.ResetPhysics(); + } + } + public void SetEyeTracking(bool isOn) { EnableEyeTracking = isOn; @@ -1121,6 +1130,7 @@ public class UmaContainerCharacter : UmaContainer if (clip.name.Contains("_cti_crd")) { + ResetDynamicBone(); var dir = Path.GetDirectoryName(clip.name).Replace("\\", "/"); string[] param = Path.GetFileName(clip.name).Split('_'); if (param.Length > 4) diff --git a/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs b/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs index 6392cee..b97fbae 100644 --- a/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs +++ b/Assets/Scripts/umamusume/Gallop/CySpringDataContainer.cs @@ -158,5 +158,13 @@ namespace Gallop dynamic.enabled = isOn; } } + + public void ResetPhysics() + { + foreach (DynamicBone dynamic in DynamicBones) + { + dynamic.ResetParticlesPosition(); + } + } } } diff --git a/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs b/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs index b22a290..2385f2e 100644 --- a/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs +++ b/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs @@ -973,7 +973,8 @@ namespace Gallop MangaMorph.BindProperties[1].Value = 1; } - var tearytype = info.tearyType; + var tearyEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrTeary) > 0; + var tearytype = tearyEnable ? info.tearyType : 0; StaticTearMorph.BindProperties.ForEach(p => p.Value = tearytype); var shaderEnable = ((int)info.attribute & LiveTimelineKeyFacialEffectData.kAttrFaceShadowVisible) > 0; diff --git a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs index 6d9f41f..890f1da 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs @@ -6,13 +6,21 @@ using UnityEngine; namespace Gallop.Live.Cutt { + [Flags] public enum LiveTimelineKeyAttribute { Disable = 1, CameraDelayEnable = 2, CameraDelayInherit = 4, - KeyCommonBitMask = 32768 - } + KeyCommonBitMask = 32768, + kAttrCheek = 65536, + kAttrTeary = 131072, + kAttrTearful = 262144, + kAttrTeardrop = 524288, + kAttrMangame = 2097152, + kAttrFaceShadow = 4194304, + kAttrFaceShadowVisible = 8388608, +} public enum LiveTimelineKeyDataListAttr {