【m】框架大更新
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.Editor
|
||||
{
|
||||
public static class ArtLoadAssetLocal
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取本地全部作用域
|
||||
/// </summary>
|
||||
public static string[] GetLocalDomainAllName()
|
||||
{
|
||||
var creatDomainEntities = GetLocalDomainAll();
|
||||
string[] domains = new string[creatDomainEntities.Count];
|
||||
for (int i = 0; i < creatDomainEntities.Count; i++)
|
||||
{
|
||||
domains[i] = creatDomainEntities[i].DomainName;
|
||||
}
|
||||
|
||||
return domains;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取全部作用域
|
||||
/// </summary>
|
||||
public static List<CreatArtDomainEntity> GetLocalDomainAll()
|
||||
{
|
||||
string domainPath = $"{Application.dataPath}/Art";
|
||||
string[] domains;
|
||||
// 新增目录获取代码
|
||||
if (Directory.Exists(domainPath))
|
||||
{
|
||||
var dirInfo = new DirectoryInfo(domainPath);
|
||||
// 获取直接子目录(不递归)
|
||||
domains = dirInfo.GetDirectories("*", SearchOption.TopDirectoryOnly)
|
||||
.Select(d => d.Name)
|
||||
.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
domains = Array.Empty<string>();
|
||||
}
|
||||
|
||||
List<CreatArtDomainEntity> domainList = new List<CreatArtDomainEntity>();
|
||||
foreach (var item in domains)
|
||||
{
|
||||
if (File.Exists($"{domainPath}/{item}/Scenes/TestScene.unity"))
|
||||
{
|
||||
CreatArtDomainEntity domainEntity = new CreatArtDomainEntity(domainList)
|
||||
{
|
||||
DomainName = item,
|
||||
domainPath = $"{domainPath}/{item}"
|
||||
};
|
||||
domainList.Add(domainEntity);
|
||||
}
|
||||
}
|
||||
|
||||
return domainList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user