From f00d0ac5f573de2627d33a5b6055152ffe50726e Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Mon, 9 Sep 2024 11:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E8=89=B2=E8=A7=89=E6=A0=A1=E5=87=86=E7=9A=84=E8=A1=A8=E7=8E=B0?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86day2=E7=9A=84yarn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prototype/佩佩/Scripts/EyeManager.cs | 53 ++++++++++++++++++- Assets/Prototype/佩佩/佩佩视觉模块.unity | 22 ++++---- .../Yarn/PeipeiTalk/PeipeiTalk1.yarn | 2 +- .../Yarn/PeipeiTalk2/PeipeiTalk2.yarn | 38 +++++++++---- 4 files changed, 92 insertions(+), 23 deletions(-) diff --git a/Assets/Prototype/佩佩/Scripts/EyeManager.cs b/Assets/Prototype/佩佩/Scripts/EyeManager.cs index 4596ad76b..91a069628 100644 --- a/Assets/Prototype/佩佩/Scripts/EyeManager.cs +++ b/Assets/Prototype/佩佩/Scripts/EyeManager.cs @@ -40,6 +40,7 @@ public class EyeManager : MonoBehaviour private bool isFirstTarget=true; // 新增的字段 private float colorTransitionDuration; + private EyeState currentState=EyeState.CanImagineColor; public EyeState CurrentState @@ -55,13 +56,13 @@ public class EyeManager : MonoBehaviour } } } + private Tween hsvShiftTween; private void Awake() { InitializeTargets(); - } private void Start() { @@ -286,7 +287,51 @@ private float MapSaturation(float input) return Mathf.Lerp(-100, 0, input); } +private Sequence glitchin; +[YarnCommand("EyeGlitch_in")] +public IEnumerator EyeGlitch_in() +{ + glitchin = DOTween.Sequence(); + Material material = eyeImage.material; + if(eyeImage==null) + { + Debug.LogError("No eyeImage"); + yield break; + } + // _HsvShift 从 0 ~ 360 来回变化 + hsvShiftTween = DOTween.To(() => material.GetFloat("_HsvShift"), x => material.SetFloat("_HsvShift", x), 360, 1f) + .SetLoops(-1, LoopType.Yoyo); + glitchin.Append(hsvShiftTween); + // _GlitchAmount 1 秒内从 0 ~ 8 + glitchin.Insert(0, DOTween.To(() => material.GetFloat("_GlitchAmount"), x => material.SetFloat("_GlitchAmount", x), 8, 1f)); + + // _WarpStrength 1 秒内从 0 ~ 0.015 + glitchin.Insert(0, DOTween.To(() => material.GetFloat("_WarpStrength"), x => material.SetFloat("_WarpStrength", x), 0.015f, 1f)); + + yield return new WaitForSeconds(1f); +} + +[YarnCommand("EyeGlitch_out")] +public void EyeGlitch_out(float duration) +{ + Material material = eyeImage.material; + if(eyeImage==null) + { + Debug.LogError("No eyeImage"); + return; + } + if (glitchin != null && glitchin.IsActive()) + { + glitchin.Kill(); + } + material.DOFloat(0,"_WarpStrength", duration); + material.DOFloat(0,"_GlitchAmount", duration); + material.DOFloat(0,"_HsvShift", duration); + // 确保之前的动画被停止 + + +} @@ -333,7 +378,11 @@ public IEnumerator SetEyeColor(string color,string memoryName=null) Sequence sequence = DOTween.Sequence(); // 添加一个 tween 来改变 _RoundWaveStrength 的值 - sequence.Append(material.DOFloat(1, "_RoundWaveStrength", 2)); + sequence.Append(material.DOFloat(1, "_RoundWaveStrength", 2)).OnComplete(() => + { + EyeGlitch_out(0.5f); + }); + // 根据颜色改变 _ColorChangeTolerance 的值 switch (color.ToLower()) diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 9c4dadca0..82a13e915 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -2363,7 +2363,7 @@ MonoBehaviour: m_EditorClassIdentifier: targetTransform: {fileID: 0} burnRadiusMin: 28 - burnRadiusMax: 33 + burnRadiusMax: 34 backSpriteRenderer: {fileID: 1813954929} wrongColorSpriteRenderer: {fileID: 588332639} --- !u!212 &179062445 @@ -12129,7 +12129,7 @@ MonoBehaviour: m_EditorClassIdentifier: targetTransform: {fileID: 0} burnRadiusMin: 25 - burnRadiusMax: 31 + burnRadiusMax: 32 backSpriteRenderer: {fileID: 1505625441} wrongColorSpriteRenderer: {fileID: 1213839932} --- !u!212 &887059454 @@ -14545,8 +14545,10 @@ Material: - CHANGECOLOR2_ON - CHANGECOLOR3_ON - CHANGECOLOR_ON + - GLITCH_ON - HSV_ON - ROUNDWAVEUV_ON + - WARP_ON m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -14638,7 +14640,7 @@ Material: - _ColorSwapRedLuminosity: -0.64 - _Contrast: 1 - _CullingOption: 0 - - _DistortAmount: 0.5 + - _DistortAmount: 0.29 - _DistortTexXSpeed: 5 - _DistortTexYSpeed: 5 - _EditorDrawers: 6 @@ -14653,7 +14655,7 @@ Material: - _GhostBlend: 1 - _GhostColorBoost: 0 - _GhostTransparency: 0 - - _GlitchAmount: 3 + - _GlitchAmount: 0 - _GlitchSize: 1 - _Glow: 10 - _GlowGlobal: 1 @@ -14693,7 +14695,7 @@ Material: - _MotionBlurDist: 1.25 - _MyDstMode: 10 - _MySrcMode: 5 - - _NegativeAmount: 1 + - _NegativeAmount: 0 - _OffsetUvX: 0 - _OffsetUvY: 0 - _OnlyInnerOutline: 0 @@ -14713,8 +14715,8 @@ Material: - _OverlayTextureScrollYSpeed: 0.25 - _PinchUvAmount: 0.35 - _PixelateSize: 32 - - _PosterizeGamma: 0.75 - - _PosterizeNumColors: 8 + - _PosterizeGamma: 0.1 + - _PosterizeNumColors: 33.6 - _PosterizeOutline: 0 - _RadialClip: 45 - _RadialClip2: 0 @@ -14742,7 +14744,7 @@ Material: - _TwistUvRadius: 0.75 - _WarpScale: 0.5 - _WarpSpeed: 8 - - _WarpStrength: 0.025 + - _WarpStrength: 0 - _WaveAmount: 12.9 - _WaveSpeed: 10 - _WaveStrength: 7.5 @@ -16114,7 +16116,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1229487020 RectTransform: m_ObjectHideFlags: 0 @@ -27436,7 +27438,7 @@ MonoBehaviour: m_EditorClassIdentifier: targetTransform: {fileID: 0} burnRadiusMin: 26 - burnRadiusMax: 29 + burnRadiusMax: 30 backSpriteRenderer: {fileID: 754425920} wrongColorSpriteRenderer: {fileID: 238151918} --- !u!212 &1921249781 diff --git a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn index 1fbaf0432..25ce91b77 100644 --- a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn +++ b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn @@ -800,7 +800,7 @@ position: 345,412 <> <> -<> +<> <> <> diff --git a/Assets/Resources/Yarn/PeipeiTalk2/PeipeiTalk2.yarn b/Assets/Resources/Yarn/PeipeiTalk2/PeipeiTalk2.yarn index e9d65e244..90a191637 100644 --- a/Assets/Resources/Yarn/PeipeiTalk2/PeipeiTalk2.yarn +++ b/Assets/Resources/Yarn/PeipeiTalk2/PeipeiTalk2.yarn @@ -7,6 +7,9 @@ tags: position: 58,-1212 --- //<> +// <> +// <> + <> === @@ -688,7 +691,9 @@ position: 85,821 //<> //[command name=activate_socket_choice /] //->UFViewCrowBar//要拆除哪个veiw就加后缀 + <> <> + <> //////撬开来之后佩佩应该就开始痛,直到你说这不会停下,佩佩吼着让你把它拆掉 佩佩: 啊…医生,又开始痛了… 我: 不好…看来UF的光漏了出来,正在灼烧她的左侧视觉…… @@ -741,6 +746,7 @@ position: 85,821 我: 色觉模块吗? 佩佩: 当然啦。我想知道,我的想象一直都是对的吗? 佩佩: 我已经太久没有看到过真实的色彩了…我想要看到。 +//////这里感觉是不是说规定好一点?其实感觉医生这里爆粗会不错233 我: 这已经超出了公司雇佣我希望我完成的工作了…… 我: 但是…为什么不呢? 我: 我们来吧。 @@ -766,19 +772,29 @@ position: 85,1052 佩佩: 这不是你告诉我的道理吗? 佩佩: 我知道你有任务在身,但你是真心想要帮助我,治好我…… 佩佩: 你说想象力是可贵的,尽管想象力不能帮我更好地操作UF。 -佩佩: 医生,我觉得你的慈悲心也是可贵的。 -佩佩: 你说艺术家是伟大的,你也是伟大的,医生。 +//感觉慈悲和伟大从佩佩嘴里说出来略怪 +佩佩: 医生,我觉得你也是可贵的。 +//佩佩: 医生,我觉得你的慈悲心也是可贵的。 +//佩佩: 你说艺术家是伟大的,你也是伟大的,医生。 我: …… ->谢谢你 我: 谢谢你,佩佩……谢谢你。 佩佩: 真希望你能一直这样…真希望我们都能一直这样。 佩佩: …… -->我担不起 - 我: 我…并不伟大。我失败了,佩佩。 - 佩佩: 不,你尽力了,医生。换一个人来,也不会做的更好的…… +->照顾好自己 + 我: 佩佩,照顾好自己... + 佩佩: 我会的! + 佩佩: 在水下已经太久了...马上,我就要去大口的呼吸了! + 佩佩: 医生,别担心我 +// ->我担不起 +// 我: 我…并不伟大。我失败了,佩佩。 +// 佩佩: 不,你尽力了,医生。换一个人来,也不会做的更好的…… 我: 啊…初始化完成了,佩佩。回复色觉的过程可能会有些痛,准备好了吗? 佩佩: 当然,来吧。 -->执行色觉校准 +//->执行色觉校准 +<> +<> +<> //我们的两次上色都是从无色开始,所以先进入无色模式 //<> //<> @@ -797,11 +813,11 @@ position: 85,1052 //<> //如果这里不想要混合这一步,也可以自己做逻辑判断,在最后一部直接调用以下部分 ->校准颜色 -<> -<> +<> +<> +//<> 佩佩: 啊…啊啊啊!好多…… 我: 佩佩? #auto_next -<> 佩佩: 啊,啊!啊!! 我: 坚持住,佩佩! 佩佩: 啊…美丽的…… @@ -815,7 +831,9 @@ position: 85,1052 <> <> 佩佩: 我已经……太久没有…… -我: 好了。佩佩,让我们收拾一下…… +//我: 好了,佩佩,让我们收拾一下…… +我: 好了佩佩,你需要休息一下 +我: 外面会有更多的色彩可以让你“呼吸” <> <> <>