Prechádzať zdrojové kódy

增加编辑器'单位'动作:复活单位

大爷 1 rok pred
rodič
commit
575d2cfaf3

+ 18 - 0
Common/CommonAI/Zone/ZoneEditor/EventTrigger/Actions.Units.cs

@@ -187,6 +187,24 @@ namespace CommonAI.Zone.ZoneEditor.EventTrigger
             }
         }
     }
+    [DescAttribute("复活单位", "单位")]
+    public class ReviveUnitAction : AbstractAction
+    {
+        [DescAttribute("单位")]
+        public UnitValue Unit = new UnitValue.Trigging();
+        public override string ToString()
+        {
+            return string.Format("复活({0})", Unit);
+        }
+        override public void DoAction(EventTriggerAdapter api, EventArguments args)
+        {
+            InstanceUnit unit = Unit.GetValue(api, args);
+            if (unit != null && unit.is_dead())
+            {
+                unit.startRebirth();
+            }
+        }
+    }
 
     [DescAttribute("直接移除单位", "单位")]
     public class RemoveUnitAction : AbstractAction