问题修改
This commit is contained in:
@@ -13,6 +13,7 @@ using AibisDream.Kit;
|
||||
|
||||
public class MemoryProcess : MonoBehaviour
|
||||
{
|
||||
public BubbleSlotGroup bubbleSlotGroup;
|
||||
public GameObject memoryView;
|
||||
public GameObject projector;
|
||||
public SpriteRenderer memoryFinishedspRender; // 用于显示记忆处理结束的表现
|
||||
@@ -79,13 +80,14 @@ public class MemoryProcess : MonoBehaviour
|
||||
memoryView.gameObject.SetActive(false);
|
||||
memoryGroup.SetActive(false);
|
||||
}
|
||||
|
||||
public void OnEnter()
|
||||
{
|
||||
OpenMemoryView();
|
||||
clueSlot = FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha = 0;
|
||||
}
|
||||
|
||||
public void OnShow()
|
||||
@@ -93,8 +95,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
Debug.Log("memoryView showed.");
|
||||
clueSlot = FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha = 0;
|
||||
}
|
||||
|
||||
public void OnExit()
|
||||
@@ -148,7 +150,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
float t = Mathf.Clamp01(distance / maxDistance);
|
||||
UpdateFrequencyShaderParameters(t);
|
||||
CheckIfFound(t, ref isFrequencyFound);
|
||||
|
||||
|
||||
// 控制音效
|
||||
float speed = Mathf.Abs(Input.GetAxis("Mouse X")); // 获取鼠标移动速度
|
||||
UpdateFaderSound(speed);
|
||||
@@ -165,7 +167,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
UpdateClarityShaderParameters(t);
|
||||
CheckIfFound(t, ref isClarityFound);
|
||||
|
||||
|
||||
// 控制音效
|
||||
float speed = Mathf.Abs(Input.GetAxis("Mouse X")); // 获取鼠标移动速度
|
||||
UpdateFaderSound(speed);
|
||||
@@ -199,19 +201,20 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
void UpdateFrequencyShaderParameters(float distance)
|
||||
{
|
||||
Memoryfrequencyloume.weight=Mathf.Lerp(0, 1, distance);
|
||||
Memoryfrequencyloume.weight = Mathf.Lerp(0, 1, distance);
|
||||
}
|
||||
|
||||
void UpdateClarityShaderParameters(float t)
|
||||
{
|
||||
MemoryClarityVloume.weight=Mathf.Lerp(0, 1, t);
|
||||
|
||||
MemoryClarityVloume.weight = Mathf.Lerp(0, 1, t);
|
||||
}
|
||||
|
||||
public void TweenWeight(Volume postProcessingVolume, float targetWeight, float duration)
|
||||
{
|
||||
// 动态调整权重
|
||||
DOTween.To(() => postProcessingVolume.weight, x => postProcessingVolume.weight = x, targetWeight, duration);
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
isFrequencyFound = false;
|
||||
@@ -235,15 +238,16 @@ public class MemoryProcess : MonoBehaviour
|
||||
lastClarityValue = claritySlider.value;
|
||||
claritySlider.interactable = true;
|
||||
}
|
||||
fadeMaterial.SetFloat("_DirectionalDistortionFade",-15f);
|
||||
memoryFinishedspRender.color=Color.black;
|
||||
MemoryProcessVloume.weight=0;
|
||||
MemoryClarityVloume.weight=0;
|
||||
Memoryfrequencyloume.weight=0;
|
||||
|
||||
fadeMaterial.SetFloat("_DirectionalDistortionFade", -15f);
|
||||
memoryFinishedspRender.color = Color.black;
|
||||
MemoryProcessVloume.weight = 0;
|
||||
MemoryClarityVloume.weight = 0;
|
||||
Memoryfrequencyloume.weight = 0;
|
||||
PunchTape = null;
|
||||
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha = 0;
|
||||
}
|
||||
|
||||
[YarnCommand("MemoryFinished")]
|
||||
@@ -266,7 +270,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
[YarnCommand("ColorFadeOut")]
|
||||
public IEnumerator ColorFadeOut()
|
||||
{ fadeMaterial.SetFloat("_DirectionalDistortionFade",-15f);
|
||||
{
|
||||
fadeMaterial.SetFloat("_DirectionalDistortionFade", -15f);
|
||||
// AudioManager.PauseMemoryAudio();
|
||||
Tween tween = fadeMaterial.DOFloat(0, "_DirectionalDistortionFade", 3);
|
||||
yield return tween.WaitForCompletion();
|
||||
@@ -274,8 +279,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
[YarnCommand("PlayMemory")]
|
||||
public IEnumerator PlayMemory(bool useYarn = false, string memName = "")
|
||||
{
|
||||
memoryFinishedspRender.color=Color.white;
|
||||
{
|
||||
memoryFinishedspRender.color = Color.white;
|
||||
if (useYarn)
|
||||
{
|
||||
fadeMaterial.SetFloat("_DirectionalDistortionFade", -15);
|
||||
@@ -291,11 +296,11 @@ public class MemoryProcess : MonoBehaviour
|
||||
// AudioManager.PlayMemoryAudio("mem_" + memName);
|
||||
playBackground.gameObject.SetActive(true);
|
||||
//FavoritesManager.Instance.CloseFavorites();
|
||||
playBackground.alpha=0;
|
||||
playBackground.alpha = 0;
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mem_play");
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
MemoryClarityVloume.weight=0;
|
||||
Memoryfrequencyloume.weight=0;
|
||||
MemoryClarityVloume.weight = 0;
|
||||
Memoryfrequencyloume.weight = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -304,12 +309,12 @@ public class MemoryProcess : MonoBehaviour
|
||||
// AudioManager.PlayMemoryAudio("mem_" + clueSlot.punchTape.MemoryIndex);
|
||||
playBackground.gameObject.SetActive(true);
|
||||
//FavoritesManager.Instance.CloseFavorites();
|
||||
playBackground.alpha=0;
|
||||
playBackground.alpha = 0;
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mem_play");
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
// Set material properties
|
||||
MemoryClarityVloume.weight=0;
|
||||
Memoryfrequencyloume.weight=0;
|
||||
MemoryClarityVloume.weight = 0;
|
||||
Memoryfrequencyloume.weight = 0;
|
||||
DialogController.Instance.StartDialogNode(clueSlot.punchTape.YarnNodeName);
|
||||
}
|
||||
}
|
||||
@@ -343,17 +348,18 @@ public class MemoryProcess : MonoBehaviour
|
||||
{
|
||||
Debug.LogError("Memory not found: " + PunchTape.MemoryIndex);
|
||||
}
|
||||
MemoryProcessVloume.weight=1;
|
||||
|
||||
MemoryProcessVloume.weight = 1;
|
||||
AudioManager.Instance.PlaySfx("event:/Scriptal/mem_load");
|
||||
|
||||
yield return new WaitForSeconds(1f);
|
||||
AudioManager.Instance.SetSfxParam("event:/Amb/amb_mem_tuning", "is_mem_tuning", 1);
|
||||
|
||||
|
||||
memoryFinishedspRender.color=Color.white;
|
||||
memoryFinishedspRender.color = Color.white;
|
||||
OnFrequencyChanged(frequencySlider.value);
|
||||
OnClarityChanged(claritySlider.value);
|
||||
MemoryProcessVloume.weight=0;
|
||||
MemoryProcessVloume.weight = 0;
|
||||
isProcessing = true; // 开始处理,设置为true
|
||||
frequencySlider.gameObject.SetActive(true);
|
||||
claritySlider.gameObject.SetActive(true);
|
||||
@@ -377,8 +383,9 @@ public class MemoryProcess : MonoBehaviour
|
||||
AudioManager.Instance.PlaySfx("event:/ActionFB/mem_fader");
|
||||
isPlayingFaderSound = true;
|
||||
}
|
||||
|
||||
// 更新音效参数
|
||||
AudioManager.Instance.SetSfxParam("event:/ActionFB/mem_fader", "mem_fader_speed", speed);
|
||||
AudioManager.Instance.SetGlobalParam("mem_fader_speed", speed);
|
||||
}
|
||||
else if (isPlayingFaderSound)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user