【m】框架大更新
This commit is contained in:
84
Assets/00.BuildOriginality/Runtime/ArtLoadAssetServer.cs
Normal file
84
Assets/00.BuildOriginality/Runtime/ArtLoadAssetServer.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
public static class ArtLoadAssetServer
|
||||
{
|
||||
public static string ip;
|
||||
|
||||
static ArtLoadAssetServer()
|
||||
{
|
||||
//初始化读取资源配置表
|
||||
HotfixMainResDomain hotfixMainResDomain =
|
||||
Resources.Load<HotfixMainResDomain>("HotfixMainResDomain");
|
||||
if (hotfixMainResDomain == null)
|
||||
{
|
||||
Debug.LogError($"UnityEvo:读取资源配置表失败【HotfixMainResDomain】...表不存在");
|
||||
}
|
||||
|
||||
ip = hotfixMainResDomain.hotfixMainResDomainEntity.ipconfig;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取服务器全部作用域
|
||||
/// </summary>
|
||||
public async static Task<string[]> GetServerDomainAllName()
|
||||
{
|
||||
var serverDomainEntities = await GetServerDomainAll();
|
||||
List<string> domains = new List<string>();
|
||||
for (int i = 0; i < serverDomainEntities.Count; i++)
|
||||
{
|
||||
if (serverDomainEntities[i].IsEnable)
|
||||
{
|
||||
domains.Add(serverDomainEntities[i].DomainName);
|
||||
}
|
||||
}
|
||||
|
||||
return domains.ToArray();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取全部作用域
|
||||
/// </summary>
|
||||
public static async Task<List<ResDmainResponse>> GetServerDomainAll()
|
||||
{
|
||||
//初始化读取资源配置表
|
||||
HotfixMainResDomain hotfixMainResDomain =
|
||||
Resources.Load<HotfixMainResDomain>("HotfixMainResDomain");
|
||||
if (hotfixMainResDomain == null)
|
||||
{
|
||||
Debug.LogError($"UnityEvo:读取资源配置表失败【HotfixMainResDomain】...表不存在");
|
||||
return null;
|
||||
}
|
||||
|
||||
ip = hotfixMainResDomain.hotfixMainResDomainEntity.ipconfig;
|
||||
//登录
|
||||
string loginurl = ip + "/Authentication/login";
|
||||
await WebRequestSystem.Login(loginurl, hotfixMainResDomain.hotfixMainResDomainEntity.username,
|
||||
hotfixMainResDomain.hotfixMainResDomainEntity.password);
|
||||
string url = $"{ip}/ResDomain/GetResDomainAll";
|
||||
var resDmainRequst = new ResProductRequst()
|
||||
{
|
||||
ProductName = Application.identifier,
|
||||
Platform = UnityEditor.EditorUserBuildSettings.activeBuildTarget.ToString(),
|
||||
};
|
||||
//获取服务器版本
|
||||
var resDmainMessageEntity =
|
||||
await WebRequestSystem.Post(url, JsonConvert.SerializeObject(resDmainRequst));
|
||||
if (resDmainMessageEntity.code == 200)
|
||||
{
|
||||
List<ResDmainResponse> resDmainResponse =
|
||||
JsonConvert.DeserializeObject<List<ResDmainResponse>>(resDmainMessageEntity.data.ToString());
|
||||
return resDmainResponse;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5909a71d7434c24809d3529ded3e0a0
|
||||
timeCreated: 1761202481
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "com.stary.buildoriginality.runtime",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"UniTask",
|
||||
"DOTween.Modules",
|
||||
"com.stary.evo.runtime",
|
||||
"YooAsset"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c6fa7c2cd7bf784e856d9adb3dc2ada
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user