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