FMOD功能迁移
This commit is contained in:
@@ -90,8 +90,6 @@ namespace AibisDream
|
||||
/// <returns>动画序列</returns>
|
||||
public Tween OpenCover()
|
||||
{
|
||||
AudioManager.PlayLoop2Audio("amb_shitou_engine");
|
||||
|
||||
var sq = DOTween.Sequence();
|
||||
// 盖板上移
|
||||
var moveDis = new Vector3(0, coverMoveDistance, 0);
|
||||
@@ -111,7 +109,6 @@ namespace AibisDream
|
||||
/// <returns>动画序列</returns>
|
||||
public Tween CloseCover()
|
||||
{
|
||||
AudioManager.PauseLoop2Audio();
|
||||
var sq = DOTween.Sequence();
|
||||
sq.Join(_cover.DOFade(1, coverMoveDuration));
|
||||
|
||||
|
||||
@@ -143,15 +143,6 @@ namespace AibisDream
|
||||
|
||||
public void CheckGearSystemState()
|
||||
{
|
||||
if (_isTargetReached)
|
||||
{
|
||||
AudioManager.PlayLoop3Audio("gears_running");
|
||||
}
|
||||
else
|
||||
{
|
||||
AudioManager.PauseLoop3Audio();
|
||||
}
|
||||
|
||||
if (_shaftGraph.AllRunning())
|
||||
{
|
||||
if (_shaftGraph.AllNewGear())
|
||||
@@ -184,7 +175,6 @@ namespace AibisDream
|
||||
|
||||
public IEnumerator OpenCover()
|
||||
{
|
||||
AudioManager.PlayLoop2Audio("amb_gearbox");
|
||||
// 旋转拉杆
|
||||
yield return _coverStick.DORotate(new Vector3(0, 0, -90), 1.5f).WaitForCompletion();
|
||||
// 开盖
|
||||
@@ -198,9 +188,6 @@ namespace AibisDream
|
||||
public IEnumerator CloseCover()
|
||||
{
|
||||
isAvailable = false;
|
||||
AudioManager.PauseLoopAudio();
|
||||
AudioManager.PauseLoop2Audio();
|
||||
AudioManager.PauseLoop3Audio();
|
||||
// 关盖
|
||||
var sq = DOTween.Sequence();
|
||||
sq.Join(_cover.transform.DOLocalMove(coverDownPos, 1.5f));
|
||||
|
||||
@@ -101,12 +101,6 @@ namespace AibisDream
|
||||
|
||||
private void OnGearPlugIn()
|
||||
{
|
||||
// 插入音效
|
||||
if (!CommonUtil.IsZero(speed) && IsBroken)
|
||||
{
|
||||
AudioManager.PlayLoopAudio("gearbox_bad");
|
||||
}
|
||||
|
||||
// 破损齿轮插进来就发一次事件,交给yarn处理
|
||||
if (IsBroken)
|
||||
{
|
||||
@@ -124,11 +118,6 @@ namespace AibisDream
|
||||
|
||||
public void PlugOutGear()
|
||||
{
|
||||
if (IsBroken)
|
||||
{
|
||||
AudioManager.PauseLoopAudio();
|
||||
}
|
||||
|
||||
// 拔出时齿轮停转
|
||||
childGear.UpdateRotation(0, _speedScale);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using UnityEngine.Playables;
|
||||
using DG.Tweening; // 引入 DoTween 命名空间
|
||||
using Yarn.Unity;
|
||||
using AibisDream;
|
||||
using AibisDream.Kit;
|
||||
|
||||
public class LineInteraction : MonoBehaviour
|
||||
{
|
||||
@@ -115,7 +116,7 @@ public class LineInteraction : MonoBehaviour
|
||||
|
||||
void ContinueTimeline()
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("wire_cut");
|
||||
FmodManager.Instance.PlaySfx("event:/Scriptal/wire_cut");
|
||||
timelineDirector.Play();
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class EyeSystem : MonoBehaviour
|
||||
{
|
||||
if (currentTarget != null)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
// AudioManager.RandomPlayInteraction("colorimagine");
|
||||
eyeStateEffect?.ApplyFocusedEffect(currentTarget);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public class EyeSystem : MonoBehaviour
|
||||
{
|
||||
if (currentTarget != null)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
// AudioManager.RandomPlayInteraction("colorimagine");
|
||||
eyeStateEffect?.ApplyUnfocusedEffect(currentTarget);
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ public class EyeSystem : MonoBehaviour
|
||||
memorySequence.Insert(4.5f, memoryMaterial.DOFloat(0f, "_FullDistortionFade", 0.5f).OnComplete(() =>
|
||||
{
|
||||
memoryRender.gameObject.SetActive(false);
|
||||
AudioManager.RandomPlayInteraction("water_drip");
|
||||
// AudioManager.RandomPlayInteraction("water_drip");
|
||||
}));
|
||||
|
||||
// 等待序列完成
|
||||
|
||||
@@ -12,6 +12,7 @@ using VolFx;
|
||||
using System.Drawing.Text; // 引入 DoTween 命名空间
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using System;
|
||||
using AibisDream.Kit;
|
||||
|
||||
public class UFSystem : MonoBehaviour
|
||||
{
|
||||
@@ -51,31 +52,37 @@ public class UFSystem : MonoBehaviour
|
||||
CameraKit.Instance.RegisterCamera(CameraEnum.UF, virtualCam);
|
||||
eyeSystem = FindObjectOfType<EyeSystem>();
|
||||
}
|
||||
|
||||
public void TweenWeight(Volume postProcessingVolume, float targetWeight, float duration)
|
||||
{
|
||||
// 动态调整权重
|
||||
DOTween.To(() => postProcessingVolume.weight, x => postProcessingVolume.weight = x, targetWeight, duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_spriteIn")]
|
||||
public IEnumerator UF_spriteIn(float duration = 1.5f)
|
||||
{
|
||||
if (eyeSystem.CurrentTarget != null)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
eyeSystem.CurrentTarget.ImageIn(duration);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_spriteOut")]
|
||||
public IEnumerator UF_spriteOut(float duration = 1.5f)
|
||||
{
|
||||
if (eyeSystem.CurrentTarget != null)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
eyeSystem.CurrentTarget.ImageOut(duration);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_AllspriteIn")]
|
||||
public IEnumerator UF_AllspriteIn(float duration = 1.5f)
|
||||
{
|
||||
@@ -83,8 +90,10 @@ public class UFSystem : MonoBehaviour
|
||||
{
|
||||
target.ImageIn(duration);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_AllspriteOut")]
|
||||
public IEnumerator UF_AllspriteOut(float duration = 1.5f)
|
||||
{
|
||||
@@ -92,19 +101,22 @@ public class UFSystem : MonoBehaviour
|
||||
{
|
||||
target.ImageOut(duration);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_faceIn")]
|
||||
public IEnumerator UF_faceIn(float duration = 1.5f)
|
||||
{
|
||||
face.gameObject.SetActive(true);
|
||||
face.DOFade(1f,duration);
|
||||
face.DOFade(1f, duration);
|
||||
yield return new WaitForSeconds(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_faceOut")]
|
||||
public IEnumerator UF_faceOut(float duration = 1.5f)
|
||||
{
|
||||
face.DOFade(0f,duration);
|
||||
face.DOFade(0f, duration);
|
||||
yield return new WaitForSeconds(duration);
|
||||
face.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -112,52 +124,57 @@ public class UFSystem : MonoBehaviour
|
||||
[YarnCommand("UF_ImaginationEffectIn")]
|
||||
public IEnumerator UF_ImaginationEffectIn(float duration = 1.5f)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(imageVolume, 1, duration);
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
[YarnCommand("UF_ImaginationEffectOut")]
|
||||
|
||||
[YarnCommand("UF_ImaginationEffectOut")]
|
||||
public IEnumerator UF_ImaginationEffectOut(float duration = 1.5f)
|
||||
{
|
||||
TweenWeight(imageVolume, 0, duration);
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_MemoryEffectIn")]
|
||||
public IEnumerator UF_MemoryEffectIn(float duration = 1.5f)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(finalVolume, 1, duration);
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
[YarnCommand("UF_MemoryEffectOut")]
|
||||
|
||||
[YarnCommand("UF_MemoryEffectOut")]
|
||||
public IEnumerator UF_MemoryEffectOut(float duration = 1.5f)
|
||||
{
|
||||
TweenWeight(finalVolume, 0, duration);
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_EyeTargetAscillIn")]
|
||||
public IEnumerator UF_EyeTargetAscillIn(float duration = 1.5f)
|
||||
{
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(imageAscillVolume, 1, duration);
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_EyeTargetAscillOut")]
|
||||
public IEnumerator UF_EyeTargetAscillOut(float duration = 1.5f)
|
||||
{
|
||||
TweenWeight(imageAscillVolume, 0, duration);
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
yield return new WaitForSeconds(0);
|
||||
}
|
||||
|
||||
[YarnCommand("UF_SetBorkenValue")]
|
||||
public void UF_Borken(int value)
|
||||
{
|
||||
public void UF_Borken(int value)
|
||||
{
|
||||
FullAscillVolume.profile.TryGet<AsciiVol>(out ascii);
|
||||
ascii.m_Depth.value=value;
|
||||
ascii.m_Ascii.value=Color.red;
|
||||
ascii.m_Depth.value = value;
|
||||
ascii.m_Ascii.value = Color.red;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,23 +189,25 @@ public class UFSystem : MonoBehaviour
|
||||
{
|
||||
isLoopImage = false;
|
||||
}
|
||||
|
||||
[YarnCommand("UF_fightEffect")]
|
||||
public void UF_fightEffect()
|
||||
{
|
||||
scaleTween = DOTween.To(() => 0f, t =>
|
||||
{
|
||||
// 根据 t(0 到 1 的变化)更新多个值
|
||||
imageVolume.weight = Mathf.Lerp(0f, 1f, t); // 例如:imageVolume 的 weight
|
||||
imageAscillVolume.weight = Mathf.Lerp(0f, 1f, t); // 假设 saturation 是另一个值
|
||||
finalVolume.weight = Mathf.Lerp(1f, 0f, t); // 假设 contrast 是另一个值
|
||||
}, 1f, 1f)
|
||||
.SetEase(Ease.InOutSine) // 平滑缓动
|
||||
.SetLoops(-1, LoopType.Yoyo); // 无限循环
|
||||
{
|
||||
// 根据 t(0 到 1 的变化)更新多个值
|
||||
imageVolume.weight = Mathf.Lerp(0f, 1f, t); // 例如:imageVolume 的 weight
|
||||
imageAscillVolume.weight = Mathf.Lerp(0f, 1f, t); // 假设 saturation 是另一个值
|
||||
finalVolume.weight = Mathf.Lerp(1f, 0f, t); // 假设 contrast 是另一个值
|
||||
}, 1f, 1f)
|
||||
.SetEase(Ease.InOutSine) // 平滑缓动
|
||||
.SetLoops(-1, LoopType.Yoyo); // 无限循环
|
||||
}
|
||||
|
||||
[YarnCommand("UF_StopfightEffect")]
|
||||
public void UF_StopfightEffect()
|
||||
{
|
||||
scaleTween.Kill();
|
||||
scaleTween.Kill();
|
||||
}
|
||||
|
||||
public IEnumerator UFImageLoopProcess()
|
||||
@@ -210,13 +229,14 @@ public class UFSystem : MonoBehaviour
|
||||
StartCoroutine(UF_MemoryEffectOut(0.5f));
|
||||
index++;
|
||||
// 如果到达列表末尾,则回到开头
|
||||
if (index >= eyeSystem.Targets.Count-2)
|
||||
if (index >= eyeSystem.Targets.Count - 2)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
//yield return new WaitForSeconds(1f); // 每隔1秒打印一次
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenUFView()
|
||||
{
|
||||
if (!FullAscillVolume.gameObject.activeInHierarchy)
|
||||
@@ -225,7 +245,6 @@ public class UFSystem : MonoBehaviour
|
||||
imageAscillVolume.weight = 1;
|
||||
imageVolume.weight = 0;
|
||||
finalVolume.weight = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,21 +293,21 @@ public class UFSystem : MonoBehaviour
|
||||
switch (state)
|
||||
{
|
||||
case UFState.UF:
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(imageAscillVolume, 1, duration);
|
||||
TweenWeight(imageVolume, 0, duration);
|
||||
TweenWeight(finalVolume, 0, duration);
|
||||
break;
|
||||
|
||||
case UFState.imagination:
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(imageAscillVolume, 0, duration);
|
||||
TweenWeight(imageVolume, 1, duration);
|
||||
TweenWeight(finalVolume, 0, duration);
|
||||
break;
|
||||
|
||||
case UFState.memory:
|
||||
AudioManager.RandomPlayInteraction("colorimagine");
|
||||
FmodManager.Instance.PlaySfx("event:/ActionFB/color_imagine");
|
||||
TweenWeight(imageAscillVolume, 0, duration);
|
||||
TweenWeight(imageVolume, 0, duration);
|
||||
TweenWeight(finalVolume, 1, duration);
|
||||
|
||||
Reference in New Issue
Block a user