提交火山功能合入流程

This commit is contained in:
2025-04-24 15:15:17 +08:00
parent c6c98acbd8
commit c51a777c22
28 changed files with 7640 additions and 26 deletions
@@ -62,6 +62,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: cd64bd80f343f3b4fbf2f2ecd1856691
m_Address: HuoShanFixScene
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -414,7 +414,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 8642715513493161296}
- component: {fileID: 1206314127285781502}
m_Layer: 5
m_Name: ExpressController
m_TagString: Untagged
@@ -442,31 +441,6 @@ RectTransform:
m_AnchoredPosition: {x: -583, y: -73.5}
m_SizeDelta: {x: 2658, y: 2025}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1206314127285781502
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 823865590291697640}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e8b90161520a05a45ab9128b1a0bab21, type: 3}
m_Name:
m_EditorClassIdentifier:
sliders:
- {fileID: 3366831051504337262}
- {fileID: 5642507820321920442}
- {fileID: 8210506857768920509}
- {fileID: 1709250378875916404}
- {fileID: 6552294217900422064}
totalPointsText: {fileID: 7186576965640130024}
totalPoints: 10
driverSlotText: {fileID: 799282547373627506}
logOutput: {fileID: 5121892254174370917}
matchButton: {fileID: 3687977870106026687}
matchResultsPanel: {fileID: 4266635309015103954}
driverButtonPrefab: {fileID: 4310732234424748951, guid: f156ac1ece77fe345a95416797701dc1, type: 3}
--- !u!1 &870020598742957211
GameObject:
m_ObjectHideFlags: 0
@@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 157431981b8a721458e6706c374a3867, type: 3}
m_Name: Test_HuoShan
m_EditorClassIdentifier:
nextScene: {fileID: 0}
yarnProject: {fileID: 7545569452688597077, guid: dc075ea1c729cec4484634a00ebb03a4, type: 3}
firstSceneName: HuoShanFixScene
isEndOfDay: 0
nameToPlayer: "\u706B\u5C71\u7B2C\u4E00\u6B21\u7EF4\u4FEE"
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8ce86974047bb404c9096e70a606355a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 53548a014876d444baecf04b919d92d1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7a2ff38165b186b43a55ff606db0a735
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c09bb54c1e8e74e429f6efc7b4ec50c0
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8b6b60c9e0d23a4469a87ec7a8fe9776
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,58 @@
title: Start
tags:
colorID: 8
position: 205,-53
---
zhanwei
//<<switch_fix_system_to Expression>>
// <<jump VarsInit>>
===
title: VarsInit
tags:
colorID: 4
position: 205,199
---
///在这里决定这次诊疗的目标是什么,以及目标判断相关的数值
//【流程相关】
//gamestage:1-引入对话;2-检查;3-检查后对话;4-调速;5-调速后对话(冷却液)
<<declare $gameStage="开始对话">>
///【流程逻辑】
//【功能相关】
//插线
<<declare $currentSocket="">>
<<declare $PlugCount=0>>
<<declare $PlugAll=false>>
<<jump Center>>
===
title: Center
description: 脚本跳转中心,GameStage在此处处理,理论上不在其他地方读取GameStage
position: 205,446
colorID: 1
---
// 每次进入维修界面就自动保存
<<auto_save>>
<<if $gameStage == "开始对话">>
<<jump 开始对话>>
<<elseif $gameStage == "身体维修">>
<<jump 身体维修>>
<<elseif $gameStage == "表达模块调参">>
<<jump 表达模块调参>>
<<elseif $gameStage == "流程完成">>
占位:流程结束
<<endif>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4041fad857384404d92bd4d5cca127fa
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,51 @@
title: EmoPlugIn
tags: 待编辑
colorID: 8
position: -2,-3039
---
<<jump 检查情绪>>
===
title: SpeakPlugIn
tags: 待编辑
colorID: 8
position: 240,-2640
---
<<jump 检查表达>>
===
title: LogicPlugIn
tags: 待编辑
colorID: 8
position: 480,-3040
---
<<jump 检查逻辑>>
===
title: MemoryPlugIn
tags: 待编辑
colorID: 8
position: 240,-3040
---
<<jump 检查记忆>>
===
title: EyePlugIn
tags: 待编辑
colorID: 8
position: 480,-2840
---
<<jump 检查视觉>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8a32fdca95336d74cbd89770a947cffa
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,12 @@
{
"projectFileVersion": 2,
"sourceFiles": [
"*.yarn"
],
"excludeFiles": [
"**/*~/*"
],
"localisation": {},
"baseLanguage": "zh-CHS",
"compilerOptions": {}
}
@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: dc075ea1c729cec4484634a00ebb03a4
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 053561912b1654d80a424bb0696a74ae, type: 3}
useAddressableAssets: 0
UseUnityLocalisationSystem: 0
unityLocalisationStringTableCollection: {instanceID: 0}
@@ -0,0 +1,20 @@
title: 开场对话
tags:
colorID: 8
position: 272,-1156
---
<<jump 结束开场对话>>
===
title: 结束开场对话
position: 275,-222
---
<<set $gameStage = "身体检查">>
<<jump Center>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 58ef8125d35282a4f9ec8515f76804ce
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,20 @@
title: 结束对话
tags:
colorID: 8
position: 272,-1156
---
<<jump 结束结束对话>>
===
title: 结束结束对话
position: 275,-222
---
<<set $gameStage = "流程完成">>
<<jump Center>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 08a93a99b13c201488ca702adf330968
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,20 @@
title: 表达模块调参
tags:
colorID: 8
position: 272,-1156
---
<<jump 结束表达模块调参>>
===
title: 结束表达模块调参
position: 275,-222
---
<<set $gameStage = "结束对话">>
<<jump Center>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: cb272773edeaa0d459acdbfccaf528ef
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,20 @@
title: 身体维修
tags:
colorID: 8
position: 272,-1156
---
<<jump 结束身体维修>>
===
title: 结束身体维修
position: 275,-222
---
<<set $gameStage = "深入表达模块">>
<<jump Center>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 84e91ff2fc2d8d141a432aae9549c8b4
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
File diff suppressed because it is too large Load Diff
@@ -76,6 +76,7 @@ namespace AibisDream.FixSystem
Memory,
Eye,
UF,
Expression,
Engine,
Gear
}
@@ -366,4 +367,38 @@ namespace AibisDream.FixSystem
memorySystem.PullMemoryProjector();
}
}
public struct ExpressionState : IState
{
public FixState GetState => FixState.Expression;
public void SetArgs(string args)
{
// 无
}
public IEnumerator Enter()
{
// 先切BodyModule
var expressionManager = FixSystemCenter.SystemDic.Get<ExpressionManager>();
if (!CameraKit.Instance.EqualToCameraState(CameraEnum.BodyModule))
{
var bodyModule = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
bodyModule.SwitchModuleGroup(ModuleState.Body);
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
}
// 切换相机
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Expression);
expressionManager.OpenView();
}
public IEnumerator Exit()
{
var expressionManager = FixSystemCenter.SystemDic.Get<ExpressionManager>();
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
bodyModuleSystem.ResetPlug();
expressionManager.CloseView();
yield break;
}
}
}
@@ -267,6 +267,7 @@ namespace AibisDream.Framework
Memory,
Eye,
UF,
Expression,
Engine,
Gear,
EyeDeep,
@@ -4,11 +4,15 @@ using UnityEngine;
using TMPro;
using UnityEngine.UI;
using System.IO;
using AibisDream.FixSystem;
using Cinemachine;
using AibisDream.Framework;
namespace AibisDream
{
public class DriverUIController : MonoBehaviour
{
public GameObject expressView;
public Slider[] sliders; // A, P, R, E, T
public TMP_Text totalPointsText;
public int totalPoints = 10;
@@ -27,6 +31,10 @@ namespace AibisDream
void Start()
{
FixSystemCenter.SystemDic.Register(this);
var virtualCam = transform.Find("Expression Camera").GetComponent<ICinemachineCamera>();
CameraKit.Instance.RegisterCamera(CameraEnum.Expression, virtualCam);
db.LoadFromCSV(Path.Combine(Application.streamingAssetsPath, "drivers.csv"));
for (int i = 0; i < sliders.Length; i++)
@@ -43,6 +51,14 @@ namespace AibisDream
matchButton.onClick.AddListener(MatchDriver);
UpdateUI();
}
public void OpenView()
{
expressView.SetActive(true);
}
public void CloseView()
{
expressView.SetActive(false);
}
void AdjustValue(int index, int delta)
{
@@ -0,0 +1,141 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
using System.IO;
using AibisDream.FixSystem;
using Cinemachine;
using AibisDream.Framework;
namespace AibisDream
{
public class ExpressionManager : MonoBehaviour
{
public GameObject expressView;
public Slider[] sliders; // A, P, R, E, T
public TMP_Text totalPointsText;
public int totalPoints = 10;
public TMP_Text driverSlotText;
public TMP_Text logOutput;
public Button matchButton;
public GameObject matchResultsPanel;
public GameObject driverButtonPrefab;
private int[] valuesCurrent = new int[5];
private DriverProfile currentDriver = null;
private DriverDatabase db = new DriverDatabase();
private List<GameObject> currentResultButtons = new List<GameObject>();
void Start()
{
FixSystemCenter.SystemDic.Register(this);
var virtualCam = transform.Find("Expression Camera").GetComponent<ICinemachineCamera>();
CameraKit.Instance.RegisterCamera(CameraEnum.Expression, virtualCam);
db.LoadFromCSV(Path.Combine(Application.streamingAssetsPath, "drivers.csv"));
for (int i = 0; i < sliders.Length; i++)
{
int index = i;
Transform plus = sliders[i].transform.Find("Plus");
if (plus != null && plus.TryGetComponent(out Button plusBtn))
plusBtn.onClick.AddListener(() => AdjustValue(index, 1));
Transform minus = sliders[i].transform.Find("Minus");
if (minus != null && minus.TryGetComponent(out Button minusBtn))
minusBtn.onClick.AddListener(() => AdjustValue(index, -1));
}
matchButton.onClick.AddListener(MatchDriver);
UpdateUI();
}
public void OpenView()
{
expressView.SetActive(true);
}
public void CloseView()
{
expressView.SetActive(false);
}
void AdjustValue(int index, int delta)
{
if (delta > 0 && totalPoints <= 0) return;
if (delta < 0 && valuesCurrent[index] <= 0) return;
if (valuesCurrent[index] + delta > 5) return;
valuesCurrent[index] += delta;
totalPoints -= delta;
CheckDriverStillValid();
UpdateUI();
}
void UpdateUI()
{
for (int i = 0; i < sliders.Length; i++)
{
sliders[i].value = valuesCurrent[i];
Transform valueTextTransform = sliders[i].transform.Find("Value");
if (valueTextTransform != null && valueTextTransform.TryGetComponent(out TMP_Text valueText))
valueText.text = valuesCurrent[i].ToString();
}
totalPointsText.text = $"Points Left: {totalPoints}";
}
void MatchDriver()
{
currentResultButtons.ForEach(btn => Destroy(btn));
currentResultButtons.Clear();
var matches = db.MatchDrivers(
valuesCurrent[0], valuesCurrent[1],
valuesCurrent[2], valuesCurrent[3],
valuesCurrent[4]);
if (matches.Count > 0)
{
matchResultsPanel.SetActive(true);
foreach (var driver in matches)
{
var btnObj = Instantiate(driverButtonPrefab, matchResultsPanel.transform);
var text = btnObj.GetComponentInChildren<TMP_Text>();
if (text) text.text = driver.Name;
var btn = btnObj.GetComponent<Button>();
if (btn) btn.onClick.AddListener(() => SelectDriver(driver));
currentResultButtons.Add(btnObj);
}
logOutput.text = $"共找到 {matches.Count} 个可用驱动,请选择。";
}
else
{
matchResultsPanel.SetActive(false);
currentDriver = null;
driverSlotText.text = "No Driver";
logOutput.text = "没有找到匹配的驱动。";
}
}
void SelectDriver(DriverProfile driver)
{
currentDriver = driver;
driverSlotText.text = $"Driver: {driver.Name}";
logOutput.text = $"[YARN] Loading: {driver.YarnFile}";
matchResultsPanel.SetActive(false);
}
void CheckDriverStillValid()
{
if (currentDriver != null && !currentDriver.Matches(
valuesCurrent[0], valuesCurrent[1],
valuesCurrent[2], valuesCurrent[3],
valuesCurrent[4]))
{
currentDriver = null;
driverSlotText.text = "No Driver";
logOutput.text = "当前驱动与属性不匹配,已卸载。";
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7245d320411db7c449fe8dec4ef86edf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: