缺一些东西,但是基本通了
缺task UF内部表现不对 擦除记忆不是手动的(或许可接受) 工具和鼠标相关的屏蔽
This commit is contained in:
@@ -31,7 +31,8 @@ public class EyeManager : MonoBehaviour, IViewLifecycle
|
||||
CanImagineColor,
|
||||
CannotImagineColor,
|
||||
EyeDisorder,
|
||||
CanSeeColor
|
||||
CanSeeColor,
|
||||
HaveChip
|
||||
}
|
||||
public ViewCameraManager cameraManager;
|
||||
|
||||
@@ -273,6 +274,10 @@ private void SetEyeState(EyeState state)
|
||||
eyeStateEffect = new CanSeeColorEffect();
|
||||
//isFirstSetTargetAfterStateChange = false;
|
||||
break;
|
||||
case EyeState.HaveChip:
|
||||
eyeStateEffect = new HaveChip();
|
||||
//isFirstSetTargetAfterStateChange = false;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException("Unknown eye state: " + state.ToString(), nameof(state));
|
||||
}
|
||||
@@ -419,7 +424,7 @@ public IEnumerator SetEyeColor(string color,string memoryName=null)
|
||||
sequence.Join(material.DOFloat(1, "_ColorChangeTolerance", 2));
|
||||
sequence.Join(material.DOFloat(1, "_ColorChangeTolerance3", 2));
|
||||
break;
|
||||
case "all":
|
||||
case "All":
|
||||
sequence.Join(material.DOFloat(1, "_ColorChangeTolerance2", 2));
|
||||
sequence.Join(material.DOFloat(1, "_ColorChangeTolerance", 2));
|
||||
sequence.Join(material.DOFloat(1, "_ColorChangeTolerance3", 2));
|
||||
|
||||
@@ -159,3 +159,31 @@ public class EyeDisorderEffect : IEyeStateEffect
|
||||
}
|
||||
}
|
||||
|
||||
public class HaveChip : IEyeStateEffect
|
||||
{
|
||||
public float TransitionDuration { get; } = 1f;
|
||||
|
||||
public void InitializeEffect(EyeTarget target, ViewCameraManager cameraManager)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void CleanupEffect(EyeTarget target)
|
||||
{
|
||||
|
||||
// Add cleanup logic here
|
||||
}
|
||||
|
||||
public void ApplyFocusedEffect(EyeTarget target)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ApplyUnfocusedEffect(EyeTarget target)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle
|
||||
public Image memoryProcessImage; // 用于显示调取记忆的表现
|
||||
public Image memoryFinishedImage; // 用于显示记忆处理结束的表现
|
||||
|
||||
public Image memoryFinishedImageForFade; // 用于显示记忆处理结束的表现
|
||||
|
||||
public Image memoryFinishedImageNoColor; // 用于显示记忆处理结束的表现
|
||||
//public Button searchMemoryButton; // 搜寻记忆按钮
|
||||
|
||||
@@ -42,6 +44,8 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle
|
||||
|
||||
private MemoryClueSlot clueSlot;
|
||||
|
||||
public Material fadeMaterial;
|
||||
|
||||
private Dictionary<PunchTape, bool> processedPunchTapes = new Dictionary<PunchTape, bool>();
|
||||
|
||||
|
||||
@@ -63,7 +67,6 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle
|
||||
}
|
||||
public void OnShow()
|
||||
{
|
||||
// 离开视图时的逻辑
|
||||
Debug.Log("memoryView showed.");
|
||||
clueSlot=FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
@@ -71,9 +74,7 @@ public class MemoryProcess : MonoBehaviour,IViewLifecycle
|
||||
color.a = 0f;
|
||||
playBackground.color = color;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
|
||||
|
||||
|
||||
DialogController.Instance.StartDialogNode("OnMemoryViewShow");
|
||||
}
|
||||
|
||||
public void OnExit()
|
||||
@@ -244,35 +245,70 @@ void OnClarityChanged(float value)
|
||||
[YarnCommand("ColorFadeOut")]
|
||||
public IEnumerator ColorFadeOut()
|
||||
{
|
||||
memoryFinishedImageForFade.sprite=memoryFinishedImage.sprite;
|
||||
memoryFinishedImageNoColor.sprite=memoryFinishedImage.sprite;
|
||||
memoryFinishedImageForFade.gameObject.SetActive(true);
|
||||
memoryFinishedImageNoColor.gameObject.SetActive(true);
|
||||
memoryFinishedImage.gameObject.SetActive(false);
|
||||
|
||||
AudioManager.RandomPlayInteraction("colorerase");
|
||||
AudioManager.PauseMemoryAudio();
|
||||
// 在3秒内把 _DirectionalDistortionFade 从 -2 变成 -14
|
||||
Tween tween = memoryFinishedImage.material.DOFloat(-14, "_DirectionalDistortionFade", 3);
|
||||
Tween tween = fadeMaterial.DOFloat(-3, "_DirectionalDistortionFade", 3);
|
||||
yield return tween.WaitForCompletion();
|
||||
}
|
||||
public IEnumerator PlayMemory()
|
||||
[YarnCommand("PlayMemory")]
|
||||
public IEnumerator PlayMemory(bool useYarn=false,string memName="")
|
||||
{
|
||||
FavoritesManager.Instance.CloseFavorites();
|
||||
// Activate playBackground and fade in alpha from 0 to 1
|
||||
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);
|
||||
if(useYarn)
|
||||
{
|
||||
fadeMaterial.SetFloat("_DirectionalDistortionFade",-15);
|
||||
memoryFinishedImage.gameObject.SetActive(true);
|
||||
FavoritesManager.Instance.CloseFavorites();
|
||||
Sprite memSprite = Resources.Load<Sprite>("Art/Memory/" + memName);
|
||||
memoryFinishedImage.sprite = memSprite;
|
||||
memoryFinishedImageNoColor.sprite = memSprite;
|
||||
if (memSprite == null)
|
||||
{
|
||||
Debug.LogError("Memory not found: " + memName);
|
||||
}
|
||||
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);
|
||||
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
|
||||
// Set material properties
|
||||
processMaterial.SetFloat("_FullAlphaDissolveFade", 0);
|
||||
memoryMaterial.SetFloat("_PixelateSize", 512);
|
||||
memoryMaterial.SetFloat("_OffsetUvX", 0);
|
||||
memoryMaterial.SetFloat("_OffsetUvY", 0);
|
||||
memoryMaterial.SetFloat("_DistortAmount", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
FavoritesManager.Instance.CloseFavorites();
|
||||
// Activate playBackground and fade in alpha from 0 to 1
|
||||
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);
|
||||
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
|
||||
// Set material properties
|
||||
processMaterial.SetFloat("_FullAlphaDissolveFade", 0);
|
||||
memoryMaterial.SetFloat("_PixelateSize", 512);
|
||||
memoryMaterial.SetFloat("_OffsetUvX", 0);
|
||||
memoryMaterial.SetFloat("_OffsetUvY", 0);
|
||||
memoryMaterial.SetFloat("_DistortAmount", 0);
|
||||
DialogController.Instance.StartDialogNode(clueSlot.punchTape.ClueName);
|
||||
|
||||
}
|
||||
|
||||
yield return playBackground.DOFade(1f, 1f).WaitForCompletion(); // Fade to fully opaque over 1 second
|
||||
|
||||
// Set material properties
|
||||
processMaterial.SetFloat("_FullAlphaDissolveFade", 0);
|
||||
memoryMaterial.SetFloat("_PixelateSize", 512);
|
||||
memoryMaterial.SetFloat("_OffsetUvX", 0);
|
||||
memoryMaterial.SetFloat("_OffsetUvY", 0);
|
||||
memoryMaterial.SetFloat("_DistortAmount", 0);
|
||||
|
||||
// Trigger dialog
|
||||
DialogController.Instance.StartDialogNode(clueSlot.punchTape.ClueName);
|
||||
}
|
||||
[YarnCommand("search_memory")]
|
||||
public IEnumerator SearchMemory(PunchTape punchTape,bool isSearchedBefore=false)
|
||||
public IEnumerator SearchMemory(PunchTape punchTape, bool isSkipDialogue=false)
|
||||
{
|
||||
if(punchTape==null)
|
||||
{
|
||||
@@ -280,11 +316,19 @@ public IEnumerator PlayMemory()
|
||||
yield break;
|
||||
}
|
||||
PunchTape=punchTape;
|
||||
if (isSearchedBefore)
|
||||
{
|
||||
PlayMemory();
|
||||
yield break;
|
||||
}
|
||||
// if (isSearchedBefore)
|
||||
// {
|
||||
// if(isSkipDialogue)
|
||||
// {
|
||||
// PlayMemory(true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// PlayMemory();
|
||||
// }
|
||||
|
||||
// yield break;
|
||||
// }
|
||||
|
||||
if (processedPunchTapes.TryGetValue(punchTape, out bool isProcessed) && isProcessed)
|
||||
{
|
||||
|
||||
+1407
-260
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user