Upgraded original RothenburgAR to Unity version 2017.4.5f1 (and upgrading from standalone vuforia to the version integrated in unity)
This commit is contained in:
66
Assets/AssetBundleManager/Utility.cs
Normal file
66
Assets/AssetBundleManager/Utility.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace AssetBundles
|
||||
{
|
||||
public class Utility
|
||||
{
|
||||
public const string AssetBundlesOutputPath = "AssetBundles";
|
||||
|
||||
public static string GetPlatformName()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return GetPlatformForAssetBundles(EditorUserBuildSettings.activeBuildTarget);
|
||||
#else
|
||||
return GetPlatformForAssetBundles(Application.platform);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private static string GetPlatformForAssetBundles(BuildTarget target)
|
||||
{
|
||||
switch(target)
|
||||
{
|
||||
case BuildTarget.Android:
|
||||
return "Android";
|
||||
case BuildTarget.iOS:
|
||||
return "iOS";
|
||||
case BuildTarget.WebGL:
|
||||
return "WebGL";
|
||||
case BuildTarget.StandaloneWindows:
|
||||
case BuildTarget.StandaloneWindows64:
|
||||
return "Windows";
|
||||
case BuildTarget.StandaloneOSX:
|
||||
return "OSX";
|
||||
// Add more build targets for your own.
|
||||
// If you add more targets, don't forget to add the same platforms to GetPlatformForAssetBundles(RuntimePlatform) function.
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private static string GetPlatformForAssetBundles(RuntimePlatform platform)
|
||||
{
|
||||
switch(platform)
|
||||
{
|
||||
case RuntimePlatform.Android:
|
||||
return "Android";
|
||||
case RuntimePlatform.IPhonePlayer:
|
||||
return "iOS";
|
||||
case RuntimePlatform.WebGLPlayer:
|
||||
return "WebGL";
|
||||
case RuntimePlatform.WindowsPlayer:
|
||||
return "Windows";
|
||||
case RuntimePlatform.OSXPlayer:
|
||||
return "OSX";
|
||||
// Add more build targets for your own.
|
||||
// If you add more targets, don't forget to add the same platforms to GetPlatformForAssetBundles(RuntimePlatform) function.
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user