Beispiel #1
0
    public override void OnInspectorGUI()
    {
        SceneObjPos obj = (SceneObjPos)target;

        if (obj == null)
        {
            return;
        }
        for (int i = 0; i < filterNames.Count; i++)
        {
            EditorGUILayout.LabelField(filterNames[i]);
        }
        if (GUILayout.Button("生成文件"))
        {
            TableManager.ClearXmlData <TableFoodPos>();
            List <Transform> lst = new List <Transform>();
            GenFile(obj.transform, lst);
            List <TableFoodPos> foodPos = new List <TableFoodPos>();
            for (int i = 0; i < lst.Count; i++)
            {
                TableFoodPos fP = new TableFoodPos(i + 1, lst[i].position, lst[i].eulerAngles, "Prefabs/Scenes/farmDynamicPrefabs/" + lst[i].name);
                foodPos.Add(fP);
            }
            TableManager.AddItemToXml(foodPos.ToArray());
        }
    }