update sapce shooter

移除了BetterStreamingAssets插件,并使用安卓原生接口类代替。
This commit is contained in:
hevinci
2023-02-09 12:02:00 +08:00
parent 2612764922
commit ca8b5c85dd
25 changed files with 261 additions and 1990 deletions
@@ -0,0 +1,44 @@
//-------------------------------------
// 作者:Stark
//-------------------------------------
using UnityEngine;
public sealed class StreamingAssetsHelper
{
#if UNITY_ANDROID && !UNITY_EDITOR
private static AndroidJavaClass _unityPlayerClass;
public static AndroidJavaClass UnityPlayerClass
{
get
{
if (_unityPlayerClass == null)
_unityPlayerClass = new UnityEngine.AndroidJavaClass("com.unity3d.player.UnityPlayer");
return _unityPlayerClass;
}
}
private static AndroidJavaObject _currentActivity;
public static AndroidJavaObject CurrentActivity
{
get
{
if (_currentActivity == null)
_currentActivity = UnityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
return _currentActivity;
}
}
/// <summary>
/// 利用安卓原生接口查询内置文件是否存在
/// </summary>
public static bool FileExists(string filePath)
{
return CurrentActivity.Call<bool>("CheckAssetExist", filePath);
}
#else
public static bool FileExists(string filePath)
{
return System.IO.File.Exists(System.IO.Path.Combine(Application.streamingAssetsPath, filePath));
}
#endif
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 358145d67e230b34883002b08b23cba3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: