火山功能跑通

This commit is contained in:
2025-04-24 18:04:28 +08:00
parent be332cc9a9
commit 8f55e4fdd1
14 changed files with 5782 additions and 12102 deletions
@@ -0,0 +1,181 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &79166284512045475
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3083384313782264551}
- component: {fileID: 2510824233476674207}
m_Layer: 5
m_Name: ExpressManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3083384313782264551
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 79166284512045475}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 2}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1533361117666867922}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 85.5, y: 429.75}
m_SizeDelta: {x: 2658, y: 2025}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2510824233476674207
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 79166284512045475}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7245d320411db7c449fe8dec4ef86edf, type: 3}
m_Name:
m_EditorClassIdentifier:
expressView: {fileID: 0}
sliders:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
totalPointsText: {fileID: 0}
totalPoints: 10
driverSlotText: {fileID: 0}
logOutput: {fileID: 0}
matchButton: {fileID: 0}
matchResultsPanel: {fileID: 0}
driverButtonPrefab: {fileID: 4310732234424748951, guid: f156ac1ece77fe345a95416797701dc1, type: 3}
--- !u!1 &1760882055846438614
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1533361117666867922}
- component: {fileID: 2135293024794947653}
m_Layer: 0
m_Name: Expression Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1533361117666867922
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1760882055846438614}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -59.53, y: -216.14, z: -5}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7762371824201576102}
m_Father: {fileID: 3083384313782264551}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2135293024794947653
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1760882055846438614}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: 9
m_StandbyUpdate: 2
m_LookAt: {fileID: 0}
m_Follow: {fileID: 0}
m_Lens:
FieldOfView: 34
OrthographicSize: 2
NearClipPlane: 0.3
FarClipPlane: 1000
Dutch: 0
ModeOverride: 0
LensShift: {x: 0, y: 0}
GateFit: 2
FocusDistance: 10
m_SensorSize: {x: 1, y: 1}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 7762371824201576102}
--- !u!1 &8328753498539422439
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7762371824201576102}
- component: {fileID: 4767927514016148135}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7762371824201576102
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8328753498539422439}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1533361117666867922}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4767927514016148135
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8328753498539422439}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a435f7fe4f4ab3b419b2141025090f10
guid: f70c72a84de39a34d8a274d273f1d065
PrefabImporter:
externalObjects: {}
userData:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 39a9cd95509412a4c981c0df7a8d6652
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -3,8 +3,10 @@ tags:
colorID: 8
position: 205,-53
---
zhanwei
//<<switch_fix_system_to Expression>>
<<switch_fix_system_to "BodyModule" "Head">>
->深入表达模块
<<switch_fix_system_to Expression>>
// <<switch_fix_system_to Expression>>
// <<jump VarsInit>>
===
@@ -0,0 +1,15 @@
title: UserA_圈层象征者
tags:
colorID: 8
position: 272,-1156
---
huoshan:11111
客户:2222
me:看起来完全不行呢,试试别的吧
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6299e5a45c6d0244eb5d5e3891031b9c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -18,3 +18,4 @@ position: 275,-222
<<jump Center>>
===
File diff suppressed because it is too large Load Diff
@@ -60,6 +60,7 @@ namespace AibisDream.FixSystem
FixState.Eye => new EyeState(),
FixState.UF => new UfState(),
FixState.Gear => new GearState(),
FixState.Expression => new ExpressionState(),
_ => new ClinicState()
};
@@ -383,7 +384,7 @@ namespace AibisDream.FixSystem
if (!CameraKit.Instance.EqualToCameraState(CameraEnum.BodyModule))
{
var bodyModule = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
bodyModule.SwitchModuleGroup(ModuleState.Body);
bodyModule.SwitchModuleGroup(ModuleState.Head);
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
}
// 切换相机
@@ -130,6 +130,7 @@ namespace AibisDream.Framework
/// <param name="camType"></param>
public IEnumerator SwitchCamera(CameraEnum camType)
{
Debug.Log("Camera Type is:"+camType);
if (_curCameraEnum == camType)
{
yield break;
@@ -1,141 +0,0 @@
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 DriverUIController : 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 = "当前驱动与属性不匹配,已卸载。";
}
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e8b90161520a05a45ab9128b1a0bab21
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -7,6 +7,7 @@ using System.IO;
using AibisDream.FixSystem;
using Cinemachine;
using AibisDream.Framework;
using Yarn.Unity;
namespace AibisDream
{
@@ -20,18 +21,22 @@ namespace AibisDream
public TMP_Text driverSlotText;
public TMP_Text logOutput;
public Button matchButton;
public Button applyAndTestButton;
public GameObject matchResultsPanel;
public GameObject driverButtonPrefab;
public string currentUser = "UserA";
private int[] valuesCurrent = new int[5];
private DriverProfile currentDriver = null;
private DriverDatabase db = new DriverDatabase();
private List<GameObject> currentResultButtons = new List<GameObject>();
void Start()
{
CloseView();
FixSystemCenter.SystemDic.Register(this);
var virtualCam = transform.Find("Expression Camera").GetComponent<ICinemachineCamera>();
CameraKit.Instance.RegisterCamera(CameraEnum.Expression, virtualCam);
@@ -49,12 +54,17 @@ namespace AibisDream
}
matchButton.onClick.AddListener(MatchDriver);
applyAndTestButton.onClick.AddListener(ApplyAndTestDriver);
UpdateUI();
}
public void OpenView()
{
expressView.SetActive(true);
}
public void CloseView()
{
expressView.SetActive(false);
@@ -81,7 +91,7 @@ namespace AibisDream
if (valueTextTransform != null && valueTextTransform.TryGetComponent(out TMP_Text valueText))
valueText.text = valuesCurrent[i].ToString();
}
totalPointsText.text = $"Points Left: {totalPoints}";
totalPointsText.text = $"剩余点数: {totalPoints}";
}
void MatchDriver()
@@ -121,8 +131,20 @@ namespace AibisDream
{
currentDriver = driver;
driverSlotText.text = $"Driver: {driver.Name}";
logOutput.text = $"[YARN] Loading: {driver.YarnFile}";
matchResultsPanel.SetActive(false);
logOutput.text = $"已选中驱动:{driver.Name},请点击应用并测试以运行。";
// 保留面板,不关闭 matchResultsPanel
}
void ApplyAndTestDriver()
{
if (currentDriver == null)
{
logOutput.text = "未选择任何驱动。";
return;
}
string nodeName = $"{currentUser}_{currentDriver.Name}";
DialogController.Instance.StartDialogNode(nodeName);
}
void CheckDriverStillValid()
@@ -137,5 +159,11 @@ namespace AibisDream
logOutput.text = "当前驱动与属性不匹配,已卸载。";
}
}
[YarnCommand("setUser")]
public void SetCurrentUser(string userName)
{
currentUser=userName;
}
}
}