暂存
This commit is contained in:
@@ -26,7 +26,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
public Slider claritySlider; // 频率调节滑动条
|
||||
|
||||
public Image playBackground;
|
||||
public CanvasGroup playBackground;
|
||||
public float targetFrequency = 1.25f; // 目标频率
|
||||
|
||||
public float targetClarity = 5.7f; // 目标频率
|
||||
@@ -76,10 +76,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
OpenMemoryView();
|
||||
clueSlot = FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
Color color = playBackground.color;
|
||||
color.a = 0f;
|
||||
playBackground.color = color;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
}
|
||||
|
||||
public void OnShow()
|
||||
@@ -87,10 +85,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
Debug.Log("memoryView showed.");
|
||||
clueSlot = FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
Color color = playBackground.color;
|
||||
color.a = 0f;
|
||||
playBackground.color = color;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
}
|
||||
|
||||
public void OnExit()
|
||||
@@ -115,10 +111,6 @@ public class MemoryProcess : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 绑定搜寻记忆按钮事件
|
||||
//searchMemoryButton.onClick.AddListener(SearchMemory);
|
||||
|
||||
// 初始化UI状态
|
||||
Init();
|
||||
}
|
||||
|
||||
@@ -184,38 +176,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
void UpdateClarityShaderParameters(float t)
|
||||
{
|
||||
MemoryClarityVloume.weight=Mathf.Lerp(0, 1, Mathf.InverseLerp(0f, 1f, t));
|
||||
// if (memoryMaterial != null)
|
||||
// {
|
||||
// float smoothT = Mathf.SmoothStep(0, 1, t);
|
||||
// float pixelateSize;
|
||||
// // 根据 t 的值线性插值材质参数,实现平滑过渡
|
||||
// //float pixelateSize = Mathf.Lerp(512, 20, smoothT);
|
||||
// float offsetUvX = Mathf.Lerp(0, 0.12f, smoothT);
|
||||
// float offsetUvY = Mathf.Lerp(0, 0.18f, smoothT);
|
||||
// float distortAmount = Mathf.Lerp(0, 1.735f, smoothT);
|
||||
|
||||
// if (t >= 0.7f && t <= 1)
|
||||
// {
|
||||
// // 在 t 值为 0.7 到 1 时,PixelateSize 在 15 到 30 之间变化
|
||||
// pixelateSize = Mathf.Lerp(30, 15, Mathf.InverseLerp(0.7f, 1f, t));
|
||||
// }
|
||||
// else if (t > 0.35f && t < 0.7f)
|
||||
// {
|
||||
// // 在 t 值为 0.35 到 0.7 时,PixelateSize 在 30 到 50 之间变化
|
||||
// pixelateSize = Mathf.Lerp(80, 30, Mathf.InverseLerp(0.35f, 0.7f, t));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // 在 t 值小于 0.35 时,PixelateSize 在 50 到 512 之间变化
|
||||
// pixelateSize = Mathf.Lerp(512, 80, Mathf.InverseLerp(0f, 0.35f, t));
|
||||
// }
|
||||
|
||||
|
||||
// memoryMaterial.SetFloat("_PixelateSize", pixelateSize);
|
||||
// memoryMaterial.SetFloat("_OffsetUvX", offsetUvX);
|
||||
// memoryMaterial.SetFloat("_OffsetUvY", offsetUvY);
|
||||
// memoryMaterial.SetFloat("_DistortAmount", distortAmount);
|
||||
// }
|
||||
}
|
||||
public void TweenWeight(Volume postProcessingVolume, float targetWeight, float duration)
|
||||
{
|
||||
@@ -244,15 +205,14 @@ public class MemoryProcess : MonoBehaviour
|
||||
}
|
||||
|
||||
memoryFinishedspRender.color=Color.black;
|
||||
MemoryProcessVloume.weight=1;
|
||||
MemoryProcessVloume.weight=0;
|
||||
MemoryClarityVloume.weight=0;
|
||||
Memoryfrequencyloume.weight=0;
|
||||
memoryFinishedspRender.color=Color.black;
|
||||
PunchTape = null;
|
||||
|
||||
Color color = playBackground.color;
|
||||
color.a = 0f;
|
||||
playBackground.color = color;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.gameObject.SetActive(false);
|
||||
playBackground.alpha=0;
|
||||
}
|
||||
|
||||
[YarnCommand("MemoryFinished")]
|
||||
@@ -300,8 +260,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
AudioManager.PlayMemoryAudio("mem_" + memName);
|
||||
playBackground.gameObject.SetActive(true);
|
||||
//FavoritesManager.Instance.CloseFavorites();
|
||||
playBackground.color = new Color(playBackground.color.r, playBackground.color.g, playBackground.color.b, 0);
|
||||
|
||||
playBackground.alpha=0;
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
MemoryClarityVloume.weight=0;
|
||||
Memoryfrequencyloume.weight=0;
|
||||
@@ -313,8 +272,7 @@ public class MemoryProcess : MonoBehaviour
|
||||
AudioManager.PlayMemoryAudio("mem_" + clueSlot.punchTape.MemoryIndex);
|
||||
playBackground.gameObject.SetActive(true);
|
||||
//FavoritesManager.Instance.CloseFavorites();
|
||||
playBackground.color = new Color(playBackground.color.r, playBackground.color.g, playBackground.color.b, 0);
|
||||
|
||||
playBackground.alpha=0;
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
// Set material properties
|
||||
MemoryClarityVloume.weight=0;
|
||||
@@ -352,6 +310,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
{
|
||||
Debug.LogError("Memory not found: " + PunchTape.MemoryIndex);
|
||||
}
|
||||
TweenWeight(MemoryProcessVloume,1,1f);
|
||||
yield return new WaitForSeconds(1f);
|
||||
TweenWeight(MemoryProcessVloume,0,0.5f);
|
||||
TweenWeight(MemoryClarityVloume,0.5f,0.5f);
|
||||
TweenWeight(Memoryfrequencyloume,0.5f,0.5f);
|
||||
@@ -360,7 +320,6 @@ public class MemoryProcess : MonoBehaviour
|
||||
frequencySlider.gameObject.SetActive(true);
|
||||
claritySlider.gameObject.SetActive(true);
|
||||
Sequence memorySequence = DOTween.Sequence();
|
||||
|
||||
yield return memorySequence.WaitForCompletion();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user