forked from zxl/LaboratoryProtection
24 lines
603 B
C#
24 lines
603 B
C#
using System.Collections.Generic;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace UnityTest.ZXL
|
|
{
|
|
public class Test : SerializedMonoBehaviour
|
|
{
|
|
[FolderPath] public string folderPath;
|
|
public string assetName;
|
|
|
|
[Button]
|
|
void AA()
|
|
{
|
|
string path = $"{folderPath}/{assetName}.asset";
|
|
|
|
DialogueAsset dialogueAsset = ScriptableObject.CreateInstance<DialogueAsset>();
|
|
dialogueAsset.datas = new List<DialogueData>();
|
|
|
|
AssetDatabase.CreateAsset(dialogueAsset, path);
|
|
}
|
|
}
|
|
} |