예제 #1
0
 void OnAddUnit(System.Object userData)
 {
     if ((int)userData == 0)
     {
         EnemyUnitSettingWindow.OpenAddEnemyWindow(x, y, unitSetting);
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        static void OpenWindow()
        {
            IsShowing = true;
            EnemyUnitSettingWindow mapEditor = EditorWindow.GetWindow <EnemyUnitSettingWindow>();

            mapEditor.ShowPopup();
            if (EnemyDefList.Count == 0)
            {
                Debug.LogError("没有EnemyDef文件");
            }
            else
            {
                unit.Enemy = EnemyDefList[0];
            }
        }