chore(eye): 删除废弃的EyeTransitionManager和相关旧资源引用
This commit is contained in:
@@ -1,235 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AibisDream;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class EyeTransitionManager : MonoBehaviour
|
||||
{
|
||||
private float zoomDuration = 1.5f;
|
||||
|
||||
public Image blackScreenImage;
|
||||
|
||||
// 视图配置类
|
||||
[System.Serializable]
|
||||
public class ViewConfig
|
||||
{
|
||||
public ViewState viewState;
|
||||
public MonoBehaviour manager;
|
||||
public GameObject viewPanel; // 视图的面板
|
||||
public float cameraSize;
|
||||
|
||||
public UnityEngine.Vector2 cameraPos;
|
||||
}
|
||||
|
||||
// 在 Unity 编辑器中配置视图(不包括MainView)
|
||||
[SerializeField] private List<ViewConfig> viewConfigs;
|
||||
|
||||
// 视图状态和视图配置的映射
|
||||
private Dictionary<ViewState, ViewConfig> viewConfigDictionary;
|
||||
|
||||
// 是否正在进行视图过渡
|
||||
private bool isTransitioning = false;
|
||||
|
||||
public Transform projector;
|
||||
|
||||
// 视图状态枚举
|
||||
public enum ViewState
|
||||
{
|
||||
MainView,
|
||||
EyeView,
|
||||
UFView,
|
||||
MemoryView,
|
||||
// 为未来的视图添加更多状态
|
||||
}
|
||||
|
||||
// 当前的视图状态,默认为 MainView
|
||||
private ViewState currentViewState = ViewState.MainView;
|
||||
|
||||
public event Action OnGetMainView;
|
||||
public event Action OnGetDeepView;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
SceneManager.sceneUnloaded -= OnSceneUnloaded;
|
||||
}
|
||||
|
||||
private void OnSceneUnloaded(Scene currentScene)
|
||||
{
|
||||
if (currentScene.name == "佩佩视觉模块")
|
||||
{
|
||||
//SaveState();
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 初始化视图
|
||||
InitializeView();
|
||||
|
||||
// 初始化视图状态和视图配置的映射
|
||||
viewConfigDictionary = new Dictionary<ViewState, ViewConfig>();
|
||||
foreach (var config in viewConfigs)
|
||||
{
|
||||
viewConfigDictionary[config.viewState] = config;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeView()
|
||||
{
|
||||
// 默认激活 MainView
|
||||
SetView(ViewState.MainView);
|
||||
}
|
||||
|
||||
private void SetView(ViewState viewState)
|
||||
{
|
||||
// 如果是 MainView,就设置为默认值
|
||||
if (viewState == ViewState.MainView)
|
||||
{
|
||||
foreach (var viewConfig in viewConfigs)
|
||||
{
|
||||
if (viewConfig.viewPanel != null)
|
||||
viewConfig.viewPanel.SetActive(false);
|
||||
//viewConfig.viewLifecycle?.OnExit(); // 初始化视图
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!viewConfigDictionary.TryGetValue(viewState, out ViewConfig config)) return;
|
||||
|
||||
if (config.viewPanel != null)
|
||||
{
|
||||
config.viewPanel.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExitView(ViewState viewState)
|
||||
{
|
||||
if (!viewConfigDictionary.TryGetValue(viewState, out ViewConfig config)) return;
|
||||
|
||||
if (config.viewPanel != null)
|
||||
{
|
||||
config.viewPanel.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 开始视图过渡
|
||||
private void StartTransition(ViewState targetViewState)
|
||||
{
|
||||
// 如果正在进行视图过渡,或者目标视图是当前视图,或者 MemoryProcess 正在处理,就不进行视图过渡
|
||||
//if (isTransitioning || currentViewState == targetViewState || (memoryProcess != null && memoryProcess.IsProcessing()))
|
||||
if (isTransitioning || currentViewState == targetViewState)
|
||||
{
|
||||
Debug.LogWarning("Transition is currently not allowed. Please wait until the current process is finished.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 开始视图过渡
|
||||
isTransitioning = true;
|
||||
|
||||
if (targetViewState == ViewState.MainView)
|
||||
{
|
||||
Debug.Log("into mainview");
|
||||
// Zoom Out 的时候,先黑屏淡入
|
||||
blackScreenImage.gameObject.SetActive(true);
|
||||
Sequence zoomOutSequence = DOTween.Sequence();
|
||||
zoomOutSequence.Append(blackScreenImage.DOFade(1f, zoomDuration / 2));
|
||||
|
||||
// 在黑屏淡入完成后关闭 Panel
|
||||
zoomOutSequence.AppendCallback(() => { ExitView(currentViewState); });
|
||||
|
||||
// 开始淡出黑屏
|
||||
zoomOutSequence.Append(blackScreenImage.DOFade(0f, zoomDuration)
|
||||
.OnComplete(() => blackScreenImage.gameObject.SetActive(false)));
|
||||
zoomOutSequence.Insert(zoomDuration / 2, Camera.main.DOOrthoSize(5f, zoomDuration).SetEase(Ease.OutCubic));
|
||||
zoomOutSequence.Insert(zoomDuration / 2,
|
||||
Camera.main.transform.DOMove(new UnityEngine.Vector3(0, 0, -10), zoomDuration).SetEase(Ease.OutCubic));
|
||||
|
||||
if (projector.localPosition.y <= -1)
|
||||
{
|
||||
zoomOutSequence.Append(projector.DOLocalMoveY(-1, zoomDuration).SetEase(Ease.OutCubic));
|
||||
}
|
||||
|
||||
// 在整个动画完成后更新视图状态
|
||||
zoomOutSequence.OnComplete(() =>
|
||||
{
|
||||
currentViewState = ViewState.MainView;
|
||||
isTransitioning = false;
|
||||
OnGetMainView.Invoke();
|
||||
//MouseCursorManager.Instance.isInDeepView=false;
|
||||
DialogController.Instance.StartDialogNode("主维修界面游戏状态检查");
|
||||
});
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (!viewConfigDictionary.TryGetValue(targetViewState, out ViewConfig targetConfig)) return;
|
||||
|
||||
// AudioManager.RandomPlayInteraction(targetConfig.soundName);
|
||||
// Zoom In 的时候,开始 Zoom
|
||||
Sequence zoomInSequence = DOTween.Sequence();
|
||||
|
||||
float FadeTiming = zoomDuration / 4;
|
||||
if (targetViewState == ViewState.MemoryView)
|
||||
{
|
||||
FadeTiming *= 5f;
|
||||
|
||||
zoomInSequence.Append(projector.DOLocalMoveY(-5, zoomDuration).SetEase(Ease.OutElastic, 0.5f));
|
||||
zoomInSequence.AppendCallback(() => { });
|
||||
}
|
||||
|
||||
zoomInSequence.Append(Camera.main.DOOrthoSize(targetConfig.cameraSize, zoomDuration)
|
||||
.SetEase(Ease.OutCubic));
|
||||
zoomInSequence.Join(Camera.main.transform
|
||||
.DOMove(new UnityEngine.Vector3(targetConfig.cameraPos.x, targetConfig.cameraPos.y, -10), zoomDuration)
|
||||
.SetEase(Ease.OutCubic));
|
||||
|
||||
// 在 Zoom 到一半时开始黑屏过渡
|
||||
zoomInSequence.Insert(FadeTiming,
|
||||
blackScreenImage.DOFade(1f, zoomDuration / 2)
|
||||
.OnStart(() => blackScreenImage.gameObject.SetActive(true)));
|
||||
|
||||
|
||||
// 在整个 Zoom 完成后激活 Eye View
|
||||
zoomInSequence.OnComplete(() =>
|
||||
{
|
||||
if (zoomInSequence != null)
|
||||
{
|
||||
zoomInSequence.Kill();
|
||||
}
|
||||
|
||||
ExitView(currentViewState);
|
||||
SetView(targetViewState);
|
||||
FadeFromBlack(() =>
|
||||
{
|
||||
//MouseCursorManager.Instance.isInDeepView=true;
|
||||
currentViewState = targetViewState;
|
||||
isTransitioning = false;
|
||||
OnGetDeepView.Invoke();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void FadeFromBlack(TweenCallback onComplete)
|
||||
{
|
||||
blackScreenImage.DOFade(0f, 1f).OnComplete(() =>
|
||||
{
|
||||
blackScreenImage.gameObject.SetActive(false);
|
||||
onComplete?.Invoke();
|
||||
});
|
||||
}
|
||||
|
||||
public void RequestViewChange(ViewState targetViewState)
|
||||
{
|
||||
StartTransition(targetViewState);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43bd7269031ce1643a4fd4e65f3e3ab6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace AibisDream
|
||||
{
|
||||
public static class TimelineAssetRef
|
||||
{
|
||||
// ------------------- 维修面板相关 -------------------
|
||||
public const string BlockPuzzleEnter = "引擎仓面板/引擎仓面板开启";
|
||||
public const string BlockPuzzleExit = "引擎仓面板/引擎仓面板关闭";
|
||||
public const string CablePanelEnter = "插线面板/插线面板开启";
|
||||
public const string CablePanelExit = "插线面板/插线面板关闭";
|
||||
|
||||
// ------------------- 插线模块相关 -------------------
|
||||
public const string EngineModuleEnter = "引擎模块/引擎开盖";
|
||||
public const string EngineModuleExit = "引擎模块/引擎合盖";
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad3885fd232d55b4d88cf21be8a292fb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,89 +0,0 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.Utility
|
||||
{
|
||||
public static class ConstRef
|
||||
{
|
||||
public const string QQURL = "https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XQFpOqRb1_zqkCdR2bLT3kHb11XzZ54T" +
|
||||
"&authKey=w8G8qxzecnATXDOec1Ybv8LA%2FTTN8gQkyegvbK%2FUZ9m90WxggTjXy2U6%2FJes" +
|
||||
"WJF3&noverify=0&group_code=325268983";
|
||||
|
||||
public const string DiscordURL = "https://discord.gg/C7Xv8Z9NxG";
|
||||
|
||||
public const string BugSurveyURL = "https://jsj.top/f/F24cC6";
|
||||
|
||||
public const string SurveyURL_CN = "https://jsj.top/f/HkmCnH";
|
||||
public const string SurveyURL_EN = "https://jsj.top/f/y501LX";
|
||||
public const string SurveyURL_JP = "https://jsj.top/f/icnVug";
|
||||
|
||||
public const string WishlistURL = "https://store.steampowered.com/app/3473430/_All_Our_Broken_Parts?utm_source=playtest";
|
||||
|
||||
public static readonly string TestSaveFilePath = Application.streamingAssetsPath + "/TestSaveFiles";
|
||||
|
||||
#if UnityEditor
|
||||
public static readonly string SaveFilePath = Application.persistentDataPath + "/SaveFiles/";
|
||||
#else
|
||||
public static readonly string SaveFilePath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "saves");
|
||||
#endif
|
||||
|
||||
public static readonly string ChapterProgressPath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "Config", "chapter.json");
|
||||
|
||||
public static readonly string CharacterConfigPath = Path.Combine(Application.streamingAssetsPath, "Config", "character.csv");
|
||||
|
||||
public static readonly string LogFilePath = Path.Combine(Application.persistentDataPath, "LogFile");
|
||||
public static readonly string BlockPuzzleDataPath = Path.Combine(Application.streamingAssetsPath, "LevelData", "BlockPuzzle", "BlockPuzzleData.json");
|
||||
public static readonly string BlockShapeDataPath = Path.Combine(Application.streamingAssetsPath, "LevelData", "BlockPuzzle", "BlockShapeData.json");
|
||||
public static readonly string BlockShapeInfoPath = Path.Combine(Application.streamingAssetsPath, "LevelData", "BlockPuzzle", "BlockShapeInfo.json");
|
||||
|
||||
#region 本地化索引
|
||||
|
||||
public const string UITextTable = "UIText";
|
||||
|
||||
public const string ActorNameTable = "ActorName";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 资产
|
||||
|
||||
public const string CutLinePrefabName = "Prefab/CutLine";
|
||||
|
||||
public const string TaskItemName = "Prefab/TaskItem";
|
||||
|
||||
public const string GearFollowerPrefabName = "GearFollower";
|
||||
|
||||
public const string ActorPrefabName = "ActorAnima";
|
||||
public const string SpriteActorPrefabName = "SpriteActor";
|
||||
public const string ActorAnimaExPrefabName = "ActorAnimaEx";
|
||||
|
||||
public const string MobileAnima = "AnimaMobileObject";
|
||||
public const string MobileSprite = "SpriteMobileObject";
|
||||
public const string MobileObject = "PrefabMobileObject";
|
||||
|
||||
public const string BubblePrefab = "Prefab/NormalBubble";
|
||||
|
||||
public const string PipelinePrefabAddress = "PipelinePrefab";
|
||||
|
||||
public const string BlockShapePrefab = "BlockPuzzle/BlockShape";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 动画配置
|
||||
|
||||
public const float TargetAspect = 16f / 9f;
|
||||
|
||||
public const float PanelDelayDuration = 0.4f;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 文字速度配置 (毫秒)
|
||||
|
||||
public const int CharacterDelayTime = 70;
|
||||
public const int LineMaxDelay = 2800;
|
||||
public const int LineMinDelay = 600;
|
||||
public const int AutoHideDelay = 150;
|
||||
public const int FixedDelay = 200;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7d5dc10d6784924a322b8968a6488d6
|
||||
timeCreated: 1744355327
|
||||
Reference in New Issue
Block a user