feat: support asset bundle

This commit is contained in:
2026-05-15 16:45:58 +08:00
parent f34145d4cf
commit 0823328d99
27 changed files with 390 additions and 8 deletions
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Lofelt.NiceVibrations;
using UnityEngine;
@@ -117,6 +118,16 @@ namespace OCES.Haptic
DontDestroyOnLoad(gameObject);
this.ResourceLoader = gameObject.AddComponent<ResourceLoader>();
if (HapticSettings.Instance.useAssetBundle)
{
string bundlePath = Path.Combine(Application.streamingAssetsPath,
HapticSettings.Instance.hapticBundlePath);
this.ResourceLoader.SetProvider(new AssetBundleAssetProvider(bundlePath));
}
else
{
this.ResourceLoader.SetProvider(new ResourcesAssetProvider());
}
this.m_hapticObjects = HapticConfigLoader.Load<HapticObjectConfig>(HapticSettings.Instance.hapticConfigPath + "HapticObject");
this.IsHapticSupported = DeviceCapabilities.isVersionSupported;