1
This commit is contained in:
@@ -2,11 +2,21 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BITKit.Mod;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
public static class ModServiceDictionaryReferenceExtensions
|
||||
{
|
||||
public static UniTask<T> LoadAssets<T>(int id) where T :class
|
||||
{
|
||||
var path = DictionaryReferenceScriptableObject.Dictionary[id];
|
||||
return ModService.LoadAsset<T>(path);
|
||||
}
|
||||
}
|
||||
public sealed class DictionaryReferenceConfigAttribute : System.Attribute
|
||||
{
|
||||
public readonly int index;
|
||||
|
@@ -2,9 +2,10 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using AYellowpaper.SerializedCollections;
|
||||
|
||||
using YooAsset;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
@@ -21,7 +22,15 @@ namespace BITKit
|
||||
{
|
||||
if (_singleton == null)
|
||||
{
|
||||
//_singleton = ScriptableObjectHelper.Get<DictionaryReferenceScriptableObject>();
|
||||
#if UNITY_EDITOR
|
||||
_singleton =
|
||||
AssetDatabase.LoadAssetAtPath<DictionaryReferenceScriptableObject>(
|
||||
"Assets/Artists/Configs/reference_dictionary.asset");
|
||||
#else
|
||||
var task = YooAssets.LoadAssetAsync("reference_directory");
|
||||
task.WaitForAsyncComplete();
|
||||
_singleton=task.AssetObject as DictionaryReferenceScriptableObject;
|
||||
#endif
|
||||
}
|
||||
return _singleton;
|
||||
}
|
||||
|
Reference in New Issue
Block a user