feat: support asset bundle
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user