void OnAddUnit(System.Object userData) { if ((int)userData == 0) { EnemyUnitSettingWindow.OpenAddEnemyWindow(x, y, unitSetting); } }
void OnSetUnit() { EnemyDef def = unitSetting.GetDef(new Vector2Int(x, y)); if (def == null) { EnemyUnitSettingWindow.OpenSetEnemyWindow(x, y, unitSetting, def, 0); } else { EnemyUnitSettingWindow.OpenSetEnemyWindow(x, y, unitSetting, def, def.CommonProperty.ID); } }
static void OpenWindow() { IsShowing = true; EnemyUnitSettingWindow mapEditor = EditorWindow.GetWindow <EnemyUnitSettingWindow>(); mapEditor.ShowPopup(); if (EnemyDefList.Count == 0) { Debug.LogError("没有EnemyDef文件"); } else { unit.Enemy = EnemyDefList[0]; } }