feat: support asset bundle

This commit is contained in:
2026-05-15 16:45:58 +08:00
parent 8a0ad07a2a
commit 2cec127e31
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;