51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using Simulator.Data;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UVC.UI.Window.PropertyWindow;
|
|
|
|
public class SimulatorProperty : MonoBehaviour
|
|
{
|
|
public Dictionary<ComponentType, List<IPropertyItem>> propertyDict = new Dictionary<ComponentType, List<IPropertyItem>>();
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
public void SetProertyWindow(ComponentType type,ComponentDataBase data)
|
|
{
|
|
Debug.Log(data);
|
|
switch (type)
|
|
{
|
|
case ComponentType.Source:
|
|
InitSourceProperty(data as SourceDataClass);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void InitSourceProperty(SourceDataClass source)
|
|
{
|
|
PropertyWindow.Instance.LoadProperties(
|
|
new List<IPropertyItem>()
|
|
{
|
|
new StringProperty("name", "이름", source.name)
|
|
{
|
|
IsReadOnly=true
|
|
},
|
|
new StringProperty("label", "라벨", source.label)
|
|
{
|
|
IsReadOnly=false
|
|
},
|
|
new Vector2Property("Position","X,Y 좌표(m)", new Vector2(source.physical.position.x,source.physical.position.z))
|
|
{
|
|
IsReadOnly=false
|
|
},
|
|
new ListProperty("prefabType","생성될 개체 유형",new List<string>(PrefabManager.Instance.prefabDict.Keys),source.prefab)
|
|
{
|
|
IsReadOnly=false
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|