This commit is contained in:
CortexCore 2024-05-03 23:42:30 +08:00
parent af344397f9
commit 33d9ab5a06
5 changed files with 40 additions and 18 deletions

View File

@ -928,6 +928,7 @@ GameObject:
- component: {fileID: 8290153689946699331} - component: {fileID: 8290153689946699331}
- component: {fileID: 412881159354137379} - component: {fileID: 412881159354137379}
- component: {fileID: 7543182919820318553} - component: {fileID: 7543182919820318553}
- component: {fileID: 972627083786413877}
m_Layer: 0 m_Layer: 0
m_Name: In Game m_Name: In Game
m_TagString: Untagged m_TagString: Untagged
@ -991,6 +992,18 @@ MonoBehaviour:
type: {class: IntervalTick, ns: BITKit, asm: BITKit} type: {class: IntervalTick, ns: BITKit, asm: BITKit}
data: data:
interval: 1 interval: 1
--- !u!114 &972627083786413877
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1364924230057242919}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9d07ec9326cd0464589b7c84e3a6db32, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1409338426875962411 --- !u!1 &1409338426875962411
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -6,7 +6,10 @@
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0", "GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
"GUID:3e9ced9430d8ee743b37f99f97066130", "GUID:3e9ced9430d8ee743b37f99f97066130",
"GUID:2b6752324f5c76d4cad13e2095c77b9e", "GUID:2b6752324f5c76d4cad13e2095c77b9e",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50" "GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:296866320aab85a42a0403bf684bac59",
"GUID:e34a5702dd353724aa315fb8011f08c3"
], ],
"includePlatforms": [], "includePlatforms": [],
"excludePlatforms": [], "excludePlatforms": [],

View File

@ -3,8 +3,12 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using BITKit; using BITKit;
using BITKit.IO;
using BITKit.Mod;
using Cysharp.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using YooAsset;
namespace BITFALL.HotFix namespace BITFALL.HotFix
{ {
@ -12,27 +16,24 @@ namespace BITFALL.HotFix
{ {
private void OnEnable() private void OnEnable()
{ {
SceneManager.sceneLoaded += Execute; YooAssetUtils.OnPackageRegistered += Execute;
} }
private void OnDisable() private void OnDisable()
{ {
SceneManager.sceneLoaded -= Execute; YooAssetUtils.OnPackageRegistered -= Execute;
} }
[BIT]
public void Execute() private async void Execute(string obj)
{ {
Execute(SceneManager.GetActiveScene(), LoadSceneMode.Single); var package = YooAssets.GetPackage(obj);
} foreach (var asset in package.GetAssetInfos("material"))
private void Execute(Scene arg0, LoadSceneMode arg1)
{
foreach (var x in SceneManager.GetSceneByName(arg0.name).GetRootGameObjects().SelectMany(o=>o.GetComponentsInChildren<Renderer>()) )
{ {
var materials = x.materials; var assetHandle = package.LoadAssetAsync<Material>(asset.AssetPath);
foreach (var material in materials) await assetHandle;
{ if (destroyCancellationToken.IsCancellationRequested) return;
material.shader = Shader.Find(material.shader.name); if (assetHandle.AssetObject is not Material material) continue;
} material.shader = Shader.Find(material.shader.name);
x.materials = materials;
} }
} }
} }

View File

@ -39,7 +39,12 @@ namespace BITKit.Sensors
data.Clear(); data.Clear();
_addedSet.Clear(); _addedSet.Clear();
await UniTask.SwitchToTaskPool(); await UniTask.SwitchToTaskPool();
var value = AudioSensorService.QuadtreeRoot.Find(new Bounds(position, Vector3.one * radius)).ToArray();
AudioSensorService.AudioSensorData[] value;
lock (AudioSensorService.QuadtreeRoot)
{
value = AudioSensorService.QuadtreeRoot.Find(new Bounds(position, Vector3.one * radius)).ToArray();
}
for (var index = 0; index < value.Length; index++) for (var index = 0; index < value.Length; index++)
{ {
var x = value[index]; var x = value[index];

View File

@ -188,6 +188,6 @@ MeshCollider:
m_ProvidesContacts: 0 m_ProvidesContacts: 0
m_Enabled: 1 m_Enabled: 1
serializedVersion: 5 serializedVersion: 5
m_Convex: 0 m_Convex: 1
m_CookingOptions: 30 m_CookingOptions: 30
m_Mesh: {fileID: 6764286009561641093, guid: 8e82cd2fdf899344ebb774b2922716cd, type: 3} m_Mesh: {fileID: 6764286009561641093, guid: 8e82cd2fdf899344ebb774b2922716cd, type: 3}