30 lines
841 B
C#
30 lines
841 B
C#
using UnityEngine;
|
|
using UnityEditor;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
public class TEst : MonoBehaviour
|
|
{
|
|
|
|
public CityExcelData manager = new CityExcelData();
|
|
|
|
[ContextMenu("GetInfo")]
|
|
public void CreateItemAsset()
|
|
{
|
|
manager.cityItems = null;
|
|
manager.cityItems = ExcelTool.CreateItemArrayWithExcel(ExcelConfig.excelsFolderPath + "ɽ¶«ÐÐÕþÇø»®Êý¾Ý.xlsx");
|
|
|
|
for (int i = 0; i < transform.childCount; i++)
|
|
{
|
|
CityInfo c = transform.GetChild(i).GetComponent<CityInfo>();
|
|
c.cityName = c.gameObject.name;
|
|
for (int l = 0; l < manager.cityItems.Length; l++)
|
|
{
|
|
if (c.cityName == manager.cityItems[l].districtName)
|
|
c.distCode = manager.cityItems[l].divisionNumber;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|