| using UnityEngine; | 
| using System.Collections.Generic; | 
| using System; | 
|   | 
| #if UNITY_EDITOR | 
|   | 
| public class TestSkillAction : RecordAction | 
| { | 
|   | 
|     public HB427_tagSCUseSkill vNetData; | 
|   | 
|     public TestSkillAction(BattleField _battleField, int skillId, int hurtIndex) | 
|         : base(RecordActionType.Skill, _battleField, null) | 
|     { | 
|         try | 
|         { | 
|             vNetData = new HB427_tagSCUseSkill(); | 
|   | 
|             BattleObject battleObj = battleField.battleObjMgr.redCampList[0]; | 
|   | 
|             vNetData.ObjID = (uint)battleObj.ObjID; | 
|             vNetData.SkillID = (uint)skillId; | 
|             vNetData.PMType = 0; | 
|             vNetData.BattleType = 0; | 
|             vNetData.CurHP = 100; | 
|             vNetData.CurHPEx = 0; | 
|             vNetData.HurtCount = 1; | 
|             vNetData.HurtList = new HB427_tagSCUseSkill.tagSCUseSkillHurt[vNetData.HurtCount]; | 
|   | 
|             //  伤害的对象 | 
|             BattleObject hurtObj = battleField.battleObjMgr.GetBattleObjectByIndex(BattleCamp.Blue, hurtIndex); | 
|             var hurt = new HB427_tagSCUseSkill.tagSCUseSkillHurt(); | 
|             hurt.ObjID = (uint)hurtObj.ObjID; | 
|             hurt.AttackTypes = 1; // 普通伤害 | 
|             hurt.HurtHP = 2; // 伤害值 | 
|             hurt.HurtHPEx = 0; | 
|             hurt.CurHP = 100; | 
|             hurt.CurHPEx = 0; | 
|             hurt.SuckHP = 0; | 
|             hurt.BounceHP = 0; | 
|   | 
|             vNetData.HurtList[0] = hurt; | 
|         } | 
|         catch (Exception err) | 
|         { | 
|             BattleDebug.LogError("Error occurred while creating TestSkillAction: " + err.Message); | 
|         } | 
|          | 
|   | 
|     } | 
|   | 
|     public override bool IsFinished() | 
|     { | 
|         return isFinish; | 
|     } | 
|   | 
|     public override void Run() | 
|     { | 
|         base.Run(); | 
|   | 
|         if (!isRunOnce) | 
|         { | 
|             isRunOnce = true; | 
|             CustomHB426CombinePack pack = CustomHB426CombinePack.CreateCustomPack(string.Empty, vNetData); | 
|             battleField.recordPlayer.PlayRecord(pack.CreateSkillAction()); | 
|             isFinish = true; | 
|             return; | 
|         } | 
|     } | 
|   | 
| } | 
|   | 
| #endif |