using AOT; using CoreGame; using GAS.Runtime; namespace CoreGame.Render { //这个技能是属于持枪者的 public class GAShotGunSpec : AbilitySpec, ISptPool { public override void ActivateAbility() { // if (ctx.ownerEnt.equips == null) // { // TryCancelAbility(); // return; // } // var holdGunEntity = ctx.ownerEnt.equips.GetHoldGunEntity(); // if (holdGunEntity == null) // { // TryCancelAbility(); // return; // } // holdGunEntity.isGunFire = true; } public override void CancelAbility() { // if (ctx.ownerEnt.equips == null) // { // return; // } // var holdGunEntity = ctx.ownerEnt.equips.GetHoldGunEntity(); // if (holdGunEntity == null) // return; // holdGunEntity.isGunFire = false; } public override void EndAbility() { CancelAbility(); } public void Reset() { } } public class GAShotGun : GameplayAbility { public GAShotGun(AbilityAsset abilityAsset) { } public override AbilitySpec CreateSpec(AbilitySystemComponent owner, GameAbilityContext ctx) { var deathAbilitySpec = SptPool.Malloc(); deathAbilitySpec.Awake(this, ctx); return deathAbilitySpec; } public override void FreeSpec(ref AbilitySpec spec) { if (!(spec is GAShotGunSpec deathAbilitySpec)) { BattleLogger.LogInfo("DeathAbilitySpec.FreeSpec: spec is not DeathAbilitySpec"); return; } SptPool.Free(ref deathAbilitySpec); } } }