FMOD功能迁移

This commit is contained in:
2025-03-07 22:28:12 +08:00
parent 99a2e78466
commit dad6c087fd
336 changed files with 1597 additions and 3230 deletions
@@ -1,13 +1,10 @@
//using System.Drawing;
using UnityEngine;
using UnityEngine.UI;
using Yarn.Unity;
using DG.Tweening;
using System.Collections.Generic;
using System.Collections;
using AibisDream;
using AibisDream.FixSystem;
using AibisDream.Kit;
public class HeatMapController : MonoBehaviour
{
@@ -83,10 +80,7 @@ public class HeatMapController : MonoBehaviour
public void HideHeatMap()
{
var draggableUI = heatmapGameobject.GetComponent<DraggableUI>();
heatmapGameobject.transform.DOLocalMove(outPos, 1f).OnComplete(() =>
{
draggableUI.UnlockDrag();
});
heatmapGameobject.transform.DOLocalMove(outPos, 1f).OnComplete(() => { draggableUI.UnlockDrag(); });
heatmapGameobject.SetActive(false);
}
@@ -115,9 +109,9 @@ public class HeatMapController : MonoBehaviour
Debug.Log("降温成功");
float duration = 3.5f;
SetTemptureSmooth(0, duration);
AudioManager.RandomPlayInteraction("cooler_cooling");
FmodManager.Instance.PlaySfx("event:/FollowInput/cooler_cooling");
yield return new WaitForSeconds(duration);
rotationTween.Kill();
rotationTween.Kill();
imageToRotate.localRotation = Quaternion.identity;
// 恢复初始状态
imageToMove.DOLocalMove(imageInitialPos, 1f);
@@ -139,32 +133,25 @@ public class HeatMapController : MonoBehaviour
// 恢复初始状态
imageToMove.DOLocalMove(imageInitialPos, 1f);
}
void Start()
{
bodyModuleSystem=FindObjectOfType<BodyModuleSystem>();
bodyModuleSystem = FindObjectOfType<BodyModuleSystem>();
// // 初始调用,设置初始位置
//tempture=1;
// // 初始化数据,这里是示例,你可以根据实际需求设置
SetDataToMaterial();
}
// public void SetTemture(float value)
// {
// tempture=value;
// }
public void SetDataToMaterial()
{
if (tempture >=0&&tempture<=1)
if (tempture >= 0 && tempture <= 1)
{
uftempture = Mathf.Lerp(1.5f, 2.8f, tempture ); // 线性插值
uftempture = Mathf.Lerp(1.5f, 2.8f, tempture); // 线性插值
modulesTempture = Mathf.Lerp(1.5f, 1.8f, tempture);
backtemture = Mathf.Lerp(1.5f, 2.25f, tempture);
}
else if (tempture >= 1&&tempture<=2)
else if (tempture >= 1 && tempture <= 2)
{
uftempture = Mathf.Lerp(2.8f, 3.2f, tempture - 1);
modulesTempture = Mathf.Lerp(1.8f, 2.3f, tempture - 1);
@@ -181,8 +168,7 @@ public class HeatMapController : MonoBehaviour
for (int i = 0; i < 7; i++)
{
//RectTransform transform=Pos[i].GetComponent<RectTransform>();
Transform currentTransform=Pos[i].GetComponent<Transform>();
Debug.Log($"Point {i}: {points[i]}");
Transform currentTransform = Pos[i].GetComponent<Transform>();
if (i == 0)
{
@@ -194,22 +180,24 @@ public class HeatMapController : MonoBehaviour
}
else
{
points[i] = new Vector4(Pos[i].position.x, Pos[i].position.y, modulesTempture, 0); // (x, y, z, temperature)
points[i] = new Vector4(Pos[i].position.x, Pos[i].position.y, modulesTempture,
0); // (x, y, z, temperature)
}
}
Sprite currentSprite=currentTransform.GetComponent<SpriteRenderer>().sprite;
properties[i] = new Vector4(currentSprite.bounds.size.x, currentSprite.bounds.size.y, 0.0f, 0.0f); // (boxsize x, boxsize y, unused, unused)
Debug.Log($"Point {i}: {currentSprite.bounds.size.x}");
Sprite currentSprite = currentTransform.GetComponent<SpriteRenderer>().sprite;
properties[i] =
new Vector4(currentSprite.bounds.size.x, currentSprite.bounds.size.y, 0.0f,
0.0f); // (boxsize x, boxsize y, unused, unused)
//properties[i] = new Vector4(transform.rect.width*1, transform.rect.height*1, 0.0f, 0.0f); // (boxsize x, boxsize y, unused, unused)
//properties[i] = new Vector4(transform.rect.width*1, transform.rect.height*1, 0.0f, 0.0f); // (boxsize x, boxsize y, unused, unused)
}
// 将数据传递给 Shader
heatMaterial.SetVectorArray("_Points", points);
heatMaterial.SetVectorArray("_Properties", properties);
}
public void SetTemptureDirect(float value)
public void SetTemptureDirect(float value)
{
Tempture = value;
}
@@ -223,5 +211,4 @@ public class HeatMapController : MonoBehaviour
{
return minTarget + (value - minSource) * (maxTarget - minTarget) / (maxSource - minSource);
}
}
}