You've already forked Commercialization.topon
release: 1.4.2
This commit is contained in:
@@ -19,6 +19,18 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
public static string PLUGIN_VERSION = "2.1.7";
|
||||
public static bool isDebug = false;
|
||||
|
||||
public static bool EnableEditorTools
|
||||
{
|
||||
get
|
||||
{
|
||||
#if AnyThinkSDKEditor
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static int PLUGIN_TYPE = 1;
|
||||
public static int OS_ANDROID = 1;
|
||||
public static int OS_IOS = 2;
|
||||
|
||||
@@ -42,6 +42,12 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public IEnumerator loadPluginData(Action<PluginData> callback)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
callback?.Invoke(null);
|
||||
yield break;
|
||||
}
|
||||
|
||||
var anythinkVersionRequest = UnityWebRequest.Get(ATNetInfo.getPluginConfigUrl(ATConfig.PLUGIN_VERSION));
|
||||
var webRequest = anythinkVersionRequest.SendWebRequest();
|
||||
while (!webRequest.isDone)
|
||||
@@ -74,6 +80,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public IEnumerator loadNetworksData(PluginData pluginData, Action<PluginData> callback)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
callback?.Invoke(pluginData);
|
||||
yield break;
|
||||
}
|
||||
|
||||
Network network = pluginData.anyThink;
|
||||
if (pluginData == null)
|
||||
@@ -125,11 +136,22 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
/// <returns></returns>
|
||||
public void downloadPlugin(Network network, int os =1, bool showImport = false)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
ATLog.log("downloadPlugin() >>> AnyThinkSDKEditor disabled, skip remote download.");
|
||||
return;
|
||||
}
|
||||
|
||||
ATEditorCoroutine.startCoroutine(downloadPluginWithEnumerator(network, os, showImport));
|
||||
}
|
||||
|
||||
public IEnumerator downloadPluginWithEnumerator(Network network, int os, bool showImport)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
ATLog.log("downloadPluginWithEnumerator() >>> networkName: " + network.Name + " os: " + os);
|
||||
// if (downloadPluginRequest != null)
|
||||
// {
|
||||
@@ -190,6 +212,12 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
//默认下载core包,在下载完network的数据时。
|
||||
public void downloadCorePlugin(PluginData pluginData)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
ATLog.log("downloadCorePlugin() >>> AnyThinkSDKEditor disabled, skip remote download.");
|
||||
return;
|
||||
}
|
||||
|
||||
mPluginData = pluginData;
|
||||
var requestParams = pluginData.requestParams;
|
||||
var pluginSettingData = pluginData.pluginSettingData;
|
||||
@@ -278,6 +306,12 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public void networkInstallOrUpdate(PluginData pluginData, Network network, int os)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
ATLog.log("networkInstallOrUpdate() >>> AnyThinkSDKEditor disabled, skip remote download.");
|
||||
return;
|
||||
}
|
||||
|
||||
downloadPlugin(network, os);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public static void ShowManager()
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var manager = GetWindow<ATIntegrationManagerWindow>(utility: true, title: windowTitle, focus: true);
|
||||
manager.minSize = windowMinSize;
|
||||
// manager.maxSize = windowMinSize;
|
||||
@@ -125,6 +130,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
warningIcon = new Texture2D(100, 100, TextureFormat.RGBA32, false);
|
||||
warningIcon.LoadImage(warningIconData);
|
||||
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
loadPluginData();
|
||||
//热更新
|
||||
ATIntegrationHotFix.Instance.loadHotFixData();
|
||||
@@ -158,6 +168,13 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
GUILayout.Space(10);
|
||||
EditorGUILayout.HelpBox("AnyThinkSDKEditor 未开启,SDK Manager 已禁用。需要维护 SDK 时请先添加 Scripting Define Symbol: AnyThinkSDKEditor。", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
// OnGUI is called on each frame draw, so we don't want to do any unnecessary calculation if we can avoid it. So only calculate it when the width actually changed.
|
||||
if (Math.Abs(previousWindowWidth - position.width) > 1)
|
||||
{
|
||||
@@ -242,6 +259,13 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
//获取插件和SDK的版本数据
|
||||
private void loadPluginData()
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
pluginData = null;
|
||||
pluginDataLoadFailed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (loadDataCoroutine != null)
|
||||
{
|
||||
loadDataCoroutine.Stop();
|
||||
@@ -275,6 +299,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
//获取networks
|
||||
private void loadNetworksData(PluginData pluginData)
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ATEditorCoroutine.startCoroutine(ATIntegrationManager.Instance.loadNetworksData(pluginData, data =>
|
||||
{
|
||||
pluginData = data;
|
||||
@@ -859,4 +888,4 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,23 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public void loadHotFixData()
|
||||
{
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
ATLog.log("loadHotFixData() >>> AnyThinkSDKEditor disabled, skip hotfix check.");
|
||||
return;
|
||||
}
|
||||
|
||||
var downloadUrl = ATNetInfo.getHotfixPluginDownloadUrl(ATConfig.PLUGIN_VERSION);
|
||||
ATLog.log("loadHotFixData() >>> downloadUrl: " + downloadUrl);
|
||||
ATEditorCoroutine.startCoroutine(loadHotFixDataWithIEnumerator(downloadUrl));
|
||||
}
|
||||
|
||||
private IEnumerator loadHotFixDataWithIEnumerator(string url) {
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
var hotFixDataRequest = UnityWebRequest.Get(url);
|
||||
var webRequest = hotFixDataRequest.SendWebRequest();
|
||||
while (!webRequest.isDone)
|
||||
@@ -86,6 +97,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
}
|
||||
|
||||
private IEnumerator loadHotFixPlugin(HotfixPluginData hotFixDataObj) {
|
||||
if (!ATConfig.EnableEditorTools)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
var path = Path.Combine(Application.temporaryCachePath, hotFixDataObj.file_name);
|
||||
ATLog.log("downloadPluginWithEnumerator() >>> path: " + path);
|
||||
#if UNITY_2017_2_OR_NEWER
|
||||
@@ -161,4 +177,4 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
return JsonUtility.FromJson<HotfixPluginData>(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
{
|
||||
public class AnyThinkMenuItems : MonoBehaviour
|
||||
{
|
||||
#if AnyThinkSDKEditor
|
||||
/**
|
||||
* The special characters at the end represent a shortcut for this action.
|
||||
*
|
||||
@@ -33,5 +34,6 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
// }
|
||||
Application.OpenURL("https://newdocs.toponad.com/docs/lgfbO4");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user