40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using NUnit.Framework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using UnityEngine;
|
|
|
|
namespace Studio
|
|
{
|
|
[CreateAssetMenu(fileName = "AddComponetData", menuName = "Scriptable Objects/AddComponetData")]
|
|
public class AddComponetDataScriptable : ScriptableObject
|
|
{
|
|
public List<AddComponetData> compoenets;
|
|
|
|
[ContextMenu("SetItem")]
|
|
public void SetItem()
|
|
{
|
|
//디렉토리 경로 가져오고
|
|
compoenets.Clear();
|
|
var allObject = Resources.LoadAll<AbstractFunctionObject>("Prefabs/FunctionObject");
|
|
foreach(var obj in allObject)
|
|
{
|
|
var key = obj.name;
|
|
var item = new AddComponetData(key, obj);
|
|
compoenets.Add(item);
|
|
}
|
|
}
|
|
}
|
|
[Serializable]
|
|
public class AddComponetData
|
|
{
|
|
public AddComponetData(string key, Component comp)
|
|
{
|
|
this.key = key;
|
|
this.comp = comp;
|
|
}
|
|
public string key;
|
|
public Component comp;
|
|
}
|
|
}
|