补充佩佩相关state和相机,以及拆卸相关的数据保存
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63c42386abc960544897d0bd62a77387
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,6 +6,8 @@ using DG.Tweening;
|
||||
using Yarn.Unity;
|
||||
using AibisDream;
|
||||
using AibisDream.FixSystem;
|
||||
using AibisDream.Framework;
|
||||
using Cinemachine;
|
||||
|
||||
public class MemoryProcess : MonoBehaviour
|
||||
{
|
||||
@@ -69,6 +71,16 @@ public class MemoryProcess : MonoBehaviour
|
||||
{
|
||||
memoryView.gameObject.SetActive(false);
|
||||
}
|
||||
public void OnEnter()
|
||||
{
|
||||
OpenMemoryView();
|
||||
clueSlot = FindObjectOfType<MemoryClueSlot>();
|
||||
FavoritesManager.Instance.OpenFavorites();
|
||||
Color color = playBackground.color;
|
||||
color.a = 0f;
|
||||
playBackground.color = color;
|
||||
playBackground.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void OnShow()
|
||||
{
|
||||
@@ -96,6 +108,8 @@ public class MemoryProcess : MonoBehaviour
|
||||
private void InitSystem()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
var virtualCam = transform.Find("Memory Camera").GetComponent<ICinemachineCamera>();
|
||||
CameraKit.Instance.RegisterCamera(FixState.Memory, virtualCam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+382
-5396
File diff suppressed because it is too large
Load Diff
@@ -38,61 +38,43 @@ namespace AibisDream
|
||||
[YarnCommand("Temp_RemoveUF")]
|
||||
public static void Temp_RemoveUF()
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").gameObject;
|
||||
if (_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(false);
|
||||
}
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.RemoveUFModule();
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_RemoveUFCover")]
|
||||
public static void Temp_RemoveUFCover()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("UF").transform.Find("Cover").gameObject;
|
||||
if (_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(false);
|
||||
}
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.RemoveUFCover();
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_InstallUF")]
|
||||
public static void Temp_InstallUF()
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").gameObject;
|
||||
if (!_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(true);
|
||||
}
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.InstallUFModule();
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_InstallUFCover")]
|
||||
public static void Temp_InstallUFCover()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("UF").transform.Find("Cover").gameObject;
|
||||
if (!_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(true);
|
||||
}
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").transform.GetComponent<UFModule>();
|
||||
_UFModule.InstallUFCover();
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_InstallChip")]
|
||||
public static void Temp_InstallChip()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("Color").transform.Find("Chip").gameObject;
|
||||
if (!_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(true);
|
||||
}
|
||||
var _chipModule = BodyModuleSystem.FindBodyModuleByName("Color").transform.GetComponent<ChipModule>();
|
||||
_chipModule.InstallChipModule();
|
||||
}
|
||||
|
||||
[YarnCommand("Temp_RemoveChip")]
|
||||
public static void Temp_RemoveChip()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("Color").transform.Find("Chip").gameObject;
|
||||
if (_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(false);
|
||||
}
|
||||
var _chipModule = BodyModuleSystem.FindBodyModuleByName("Color").transform.GetComponent<ChipModule>();
|
||||
_chipModule.RemoveChipModule();
|
||||
}
|
||||
|
||||
[YarnCommand("SetSocketAvailable")]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe23b997fd344764997e6a0e884a50d8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream;
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
public class ChipModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _ChipModule;
|
||||
|
||||
private ChipData _ChipData;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// 将数据注册到数据容器内
|
||||
GameLoopManager.FixDataContainer.Register(_ChipData);
|
||||
// 添加加载逻辑
|
||||
_ChipData.LoadEvent += LoadData;
|
||||
_ChipModule = transform.Find("Chip").gameObject;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
public void RemoveChipModule()
|
||||
{
|
||||
if (_ChipModule.activeInHierarchy)
|
||||
{
|
||||
_ChipModule.SetActive(false);
|
||||
}
|
||||
_ChipData.isChipRemoved=true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void InstallChipModule()
|
||||
{
|
||||
if (!_ChipModule.activeInHierarchy)
|
||||
{
|
||||
_ChipModule.SetActive(true);
|
||||
}
|
||||
_ChipData.isChipRemoved=false;
|
||||
|
||||
}
|
||||
public void Chipinit()
|
||||
{
|
||||
_ChipModule.SetActive(!_ChipData.isChipRemoved);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadData(ChipData ufData)
|
||||
{
|
||||
Chipinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
Chipinit();
|
||||
}
|
||||
}
|
||||
public class ChipData : IData
|
||||
{
|
||||
public bool isChipRemoved = false;
|
||||
|
||||
public event Action<ChipData> LoadEvent;
|
||||
|
||||
public void Load()
|
||||
{
|
||||
LoadEvent?.Invoke(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9a0e268d6efbc04aae4ab5b2bfbc4b7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream;
|
||||
using System;
|
||||
|
||||
|
||||
|
||||
public class UFModule : MonoBehaviour
|
||||
{
|
||||
private GameObject _UFcover;
|
||||
private GameObject _UFModule;
|
||||
private UFData _ufData;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// 将数据注册到数据容器内
|
||||
GameLoopManager.FixDataContainer.Register(_ufData);
|
||||
// 添加加载逻辑
|
||||
_ufData.LoadEvent += LoadData;
|
||||
_UFModule = transform.Find("Module Pic").gameObject;
|
||||
_UFcover = transform.Find("Cover").gameObject;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
public void RemoveUFCover()
|
||||
{
|
||||
if (_UFcover.activeInHierarchy)
|
||||
{
|
||||
_UFcover.SetActive(false);
|
||||
}
|
||||
_ufData.isUFCoverRemoved=true;
|
||||
|
||||
}
|
||||
public void RemoveUFModule()
|
||||
{
|
||||
if (_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(false);
|
||||
}
|
||||
_ufData.isUFRemoved=true;
|
||||
|
||||
|
||||
}
|
||||
public void InstallUFCover()
|
||||
{
|
||||
if (!_UFcover.activeInHierarchy)
|
||||
{
|
||||
_UFcover.SetActive(true);
|
||||
}
|
||||
_ufData.isUFCoverRemoved=false;
|
||||
|
||||
}
|
||||
public void InstallUFModule()
|
||||
{
|
||||
if (!_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(true);
|
||||
}
|
||||
_ufData.isUFRemoved=false;
|
||||
|
||||
}
|
||||
public void UFinit()
|
||||
{
|
||||
_UFModule.SetActive(!_ufData.isUFRemoved);
|
||||
_UFcover.SetActive(!_ufData.isUFCoverRemoved);
|
||||
}
|
||||
|
||||
|
||||
private void LoadData(UFData ufData)
|
||||
{
|
||||
UFinit(); // 读取存档文件时触发,将当前系统恢复为目标状态
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
UFinit();
|
||||
}
|
||||
}
|
||||
public class UFData : IData
|
||||
{
|
||||
|
||||
public bool isUFCoverRemoved = false;
|
||||
public bool isUFRemoved = false;
|
||||
|
||||
public event Action<UFData> LoadEvent;
|
||||
|
||||
public void Load()
|
||||
{
|
||||
LoadEvent?.Invoke(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50fca6abf953cae49b32d81e91842f43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -220,13 +220,34 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
|
||||
public IEnumerator Enter()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
{
|
||||
float duration = 0.5f;
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var UFSystem = FixSystemCenter.SystemDic.Get<UFSystem>();
|
||||
// 先切BodyModule
|
||||
if (!CameraKit.Instance.EqualToCameraState(FixState.BodyModule))
|
||||
{
|
||||
yield return MainUIController.Instance?.FadeInSync(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.BodyModule);
|
||||
yield return MainUIController.Instance?.FadeOutSync(0.5f);
|
||||
}
|
||||
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.UF);
|
||||
yield return MainUIController.Instance.FadeInSync(duration);
|
||||
UFSystem.OpenUFView();
|
||||
yield return MainUIController.Instance.FadeOutSync(duration);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public IEnumerator Exit()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
||||
eyeSystem.OnExit();
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,15 +259,38 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public IEnumerator Enter()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
{
|
||||
float duration = 0.5f;
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
||||
// 先切BodyModule
|
||||
if (!CameraKit.Instance.EqualToCameraState(FixState.BodyModule))
|
||||
{
|
||||
yield return MainUIController.Instance?.FadeInSync(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.BodyModule);
|
||||
yield return MainUIController.Instance?.FadeOutSync(0.5f);
|
||||
}
|
||||
//打开盖子
|
||||
bodyModuleSystem.FindBodyModuleByName("Eye").transform.Find("Module Pic").GetComponent<SpriteRenderer>().sprite=Resources.Load<Sprite>("Art/Fix/Peipei/视觉盖子打开");
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.Eye);
|
||||
yield return MainUIController.Instance.FadeInSync(duration);
|
||||
eyeSystem.OnEnter();
|
||||
yield return MainUIController.Instance.FadeOutSync(duration);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public IEnumerator Exit()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var eyeSystem = FixSystemCenter.SystemDic.Get<EyeSystem>();
|
||||
eyeSystem.OnExit();
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,12 +305,31 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public IEnumerator Enter()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
float duration = 0.5f;
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
||||
// 先切BodyModule
|
||||
if (!CameraKit.Instance.EqualToCameraState(FixState.BodyModule))
|
||||
{
|
||||
yield return MainUIController.Instance?.FadeInSync(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.BodyModule);
|
||||
yield return MainUIController.Instance?.FadeOutSync(0.5f);
|
||||
}
|
||||
yield return memorySystem.DropMemoryProjector();
|
||||
// 插头回到初始插孔
|
||||
bodyModuleSystem.ResetPlug();
|
||||
// 相机聚焦到目标位
|
||||
yield return CameraKit.Instance.SwitchCamera(FixState.Memory);
|
||||
yield return MainUIController.Instance.FadeInSync(duration);
|
||||
memorySystem.OnEnter();
|
||||
yield return MainUIController.Instance.FadeOutSync(duration);
|
||||
}
|
||||
|
||||
public IEnumerator Exit()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var memorySystem = FixSystemCenter.SystemDic.Get<MemoryProcess>();
|
||||
memorySystem.OnExit();
|
||||
yield return MainUIController.Instance.FadeOutSync(0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,9 @@ using Yarn.Unity;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
using AibisDream.FixSystem;
|
||||
using Cinemachine;
|
||||
using AibisDream;
|
||||
using AibisDream.Framework;
|
||||
|
||||
public class EyeSystem : MonoBehaviour
|
||||
{
|
||||
@@ -52,16 +54,17 @@ public class EyeSystem : MonoBehaviour
|
||||
public void Init()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
var virtualCam = transform.Find("Eye Camera").GetComponent<ICinemachineCamera>();
|
||||
CameraKit.Instance.RegisterCamera(FixState.Eye, virtualCam);
|
||||
}
|
||||
|
||||
public void OnEnter()
|
||||
{
|
||||
mouseFollowAndZoom.SetIsActive(true);
|
||||
mouseFollowAndZoom.SetIsLock(false);
|
||||
OpenEyeView();
|
||||
// 进入视图时的逻辑
|
||||
Debug.Log("EyeView entered.");
|
||||
|
||||
// 可以在这里进行一些特定的初始化或加载数据
|
||||
}
|
||||
|
||||
public void OpenEyeView()
|
||||
@@ -84,6 +87,7 @@ public class EyeSystem : MonoBehaviour
|
||||
{
|
||||
eyeStateEffect?.CleanupEffect(CurrentTarget);
|
||||
mouseFollowAndZoom.SetIsActive(false);
|
||||
currentTarget=null;
|
||||
// 离开视图时的逻辑
|
||||
Debug.Log("EyeView exited.");
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using AibisDream.FixSystem;
|
||||
using AibisDream.Framework;
|
||||
using Cinemachine;
|
||||
|
||||
public class UFSystem : MonoBehaviour
|
||||
{
|
||||
@@ -23,6 +25,8 @@ public class UFSystem : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
var virtualCam = transform.Find("UF Camera").GetComponent<ICinemachineCamera>();
|
||||
CameraKit.Instance.RegisterCamera(FixState.UF, virtualCam);
|
||||
}
|
||||
|
||||
public void OpenUFView()
|
||||
|
||||
Reference in New Issue
Block a user