37 lines
696 B
Plaintext
37 lines
696 B
Plaintext
|
#if UNITY_EDITOR
|
||
|
|
||
|
using Sirenix.OdinInspector;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.AddressableAssets;
|
||
|
using UnityEditor;
|
||
|
|
||
|
public class Test : MonoBehaviour
|
||
|
{
|
||
|
public AssetReference Asset;
|
||
|
public TextAsset TAsset;
|
||
|
|
||
|
[Button]
|
||
|
public void PP()
|
||
|
{
|
||
|
print(Asset.AssetGUID);
|
||
|
print(Asset.SubObjectName);
|
||
|
}
|
||
|
|
||
|
[Button]
|
||
|
public void Set(string guid, string subOjbectName)
|
||
|
{
|
||
|
Asset = new AssetReference(guid);
|
||
|
Asset.SubObjectName = subOjbectName;
|
||
|
}
|
||
|
|
||
|
|
||
|
[Button]
|
||
|
public void PrintAssetPath(string guid)
|
||
|
{
|
||
|
print(AssetDatabase.GUIDToAssetPath(guid));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|