Prechádzať zdrojové kódy

修复GameEditor在新增技能KeyFrame时报错的问题

大爷 1 rok pred
rodič
commit
3b2d8ac81e

+ 18 - 0
Common/CommonAI/Zone/Data.cs

@@ -149,6 +149,7 @@ namespace CommonAI.Zone
         }
 
         [NotNull]
+        [ListAttribute(typeof(MapBlockBrush))]
         [Desc("地块定义列表")]
         public List<MapBlockBrush> Brushes = new List<MapBlockBrush>();
 
@@ -235,6 +236,7 @@ namespace CommonAI.Zone
             [DescAttribute("动作", "动作")]
             public UnitActionStatus Action = UnitActionStatus.Idle;
 
+            [ListAttribute(typeof(UnitActionKeyFrame))]
             [DescAttribute("动作序列", "动作")]
             public List<UnitActionKeyFrame> ActionQueue = new List<UnitActionKeyFrame>();
 
@@ -312,6 +314,7 @@ namespace CommonAI.Zone
             }
         }
 
+        [ListAttribute(typeof(UnitAction))]
         [DescAttribute("动作集合")]
         public List<UnitAction> ActionMap = new List<UnitAction>();
 
@@ -674,11 +677,13 @@ namespace CommonAI.Zone
         /// <summary>
         /// 此单位绑定的所有技能ID
         /// </summary>
+        [ListAttribute(typeof(LaunchSkill))]
         [DescAttribute("此单位绑定的所有技能ID", "技能")]
         public List<LaunchSkill> Skills = new List<LaunchSkill>();
         /// <summary>
         /// 触发类特效
         /// </summary>
+        [ListAttribute(typeof(LaunchTrigger))]
         [DescAttribute("触发类", "技能")]
         public List<LaunchTrigger> Triggers = new List<LaunchTrigger>();
         //------------------------------------
@@ -710,6 +715,7 @@ namespace CommonAI.Zone
         /// <summary>
         /// 掉落道具列表
         /// </summary>
+        [ListAttribute(typeof(DropItemList))]
         [DescAttribute("掉落道具", "掉落")]
         public List<DropItemList> DropItemsSet = new List<DropItemList>();
 
@@ -720,6 +726,7 @@ namespace CommonAI.Zone
         [DescAttribute("单位背包数量", "背包")]
         public int InventorySize = 1;
 
+        [ListAttribute(typeof(InventoryItem))]
         [DescAttribute("进入战斗携带的道具列表(比如血瓶)", "背包")]
         public List<InventoryItem> InventoryList = new List<InventoryItem>();
 
@@ -1482,6 +1489,7 @@ namespace CommonAI.Zone
         /// <summary>
         /// 所有关键帧
         /// </summary>
+        [ListAttribute(typeof(KeyFrame))]
         [DescAttribute("所有关键帧", "关键帧")]
         public List<KeyFrame> KeyFrames = new List<KeyFrame>();
 
@@ -2511,6 +2519,7 @@ namespace CommonAI.Zone
         /// <summary>
         /// 按顺序触发的所有关键帧
         /// </summary>
+        [ListAttribute(typeof(KeyFrame))]
         [DescAttribute("按顺序触发的所有关键帧", "关键帧")]
         public List<KeyFrame> KeyFrames = new List<KeyFrame>();
         //--------------------------------------------
@@ -2935,6 +2944,7 @@ namespace CommonAI.Zone
         [DescAttribute("每间隔时间触发一次的时候起效", "关键帧")]
         public KeyFrame HitKeyFrame;
 
+        [ListAttribute(typeof(KeyFrame))]
         [DescAttribute("所有关键帧", "关键帧")]
         public List<KeyFrame> KeyFrames = new List<KeyFrame>();
 
@@ -2989,9 +2999,12 @@ namespace CommonAI.Zone
         [DescAttribute("此单位变身普通攻击技能", "变身 - 技能")]
         [DependOnProperty("UnitChangeSkills")]
         public LaunchSkill UnitBaseSkillID;
+
+        [ListAttribute(typeof(LaunchSkill))]
         [DescAttribute("此单位变身绑定的所有技能ID", "变身 - 技能")]
         [DependOnProperty("UnitChangeSkills")]
         public List<LaunchSkill> UnitSkills = new List<LaunchSkill>();
+
         [DescAttribute("变身改变技能时,保留的技能ID", "变身 - 技能")]
         [TemplatesIDAttribute(typeof(SkillTemplate))]
         [DependOnProperty("UnitChangeSkills")]
@@ -3025,9 +3038,11 @@ namespace CommonAI.Zone
         [DescAttribute("BUFF期间绑定特效(客户端用)", "特效")]
         public LaunchEffect BindingEffect;
 
+        [ListAttribute(typeof(LaunchEffect))]
         [DescAttribute("BUFF期间绑定特效集合(客户端用)", "特效")]
         public List<LaunchEffect> BindingEffectList = new List<LaunchEffect>();
 
+        [ListAttribute(typeof(LaunchEffect))]
         [DescAttribute("BUFF期间每层绑定特效(每层对应一个特效,客户端用)", "特效")]
         [DependOnProperty("IsOverlay")]
         public List<LaunchEffect> OverlayBindingEffect = new List<LaunchEffect>();
@@ -3438,6 +3453,7 @@ namespace CommonAI.Zone
         [DescAttribute("是否弹出非物品类的二级面板", "显示")]
         public bool IsPopPanel = false;
 
+        [ListAttribute(typeof(FlyEffect))]
         [DescAttribute("飞行特效", "妖气修为")]
         public List<FlyEffect> Fly;
 
@@ -3753,6 +3769,7 @@ namespace CommonAI.Zone
         [DescAttribute("单位事件触发名字", "基础")]
         public string Name;
 
+        [ListAttribute(typeof(UnitEvent))]
         [DescAttribute("所有事件", "基础", false)]
         public List<UnitEvent> Events = new List<UnitEvent>();
 
@@ -4948,6 +4965,7 @@ namespace CommonAI.Zone
         /// <summary>
         /// 掉落道具模板ID
         /// </summary>
+        [ListAttribute(typeof(DropItem))]
         [DescAttribute("掉落道具模板列表")]
         public List<DropItem> DropItems = new List<DropItem>();
 

+ 1 - 1
Common/CommonFroms/G2D.DataGrid/G2DProperty.cs

@@ -1361,7 +1361,7 @@ namespace CommonFroms.G2D.DataGrid
                             return value;
                         }
                     }
-                    MessageBox.Show("此单位不支持Ability扩展");
+                    MessageBox.Show($"标识为列表的属性打开出错({fieldType}), 忘记标识ListAttribute?");
                 }
                 else
                 {