You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.9 KiB

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<GAShotGunSpec>.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<GAShotGunSpec>.Free(ref deathAbilitySpec);
}
}
}