public override void Activate(Transform transform, AbilityUser abilityUser) { if (Clone == null && abilityUser.CanAffordAbility(Reflect.EnergyCostPerTick)) { abilityUser.AdjustEnergy(-Reflect.EnergyCostPerTick); Clone = Instantiate(Reflect, transform.position, transform.rotation); Clone.CasterTransform = transform; Clone.AbilityUser = abilityUser; } }
private void Update() { if (IsShooting && NextShotTime <= Time.time && AbilityUser.CanAffordAbility(BounceBolt.EnergyCost)) { AbilityUser.AdjustEnergy(-BounceBolt.EnergyCost); Vector3 position = Transform.position + (BounceBolt.ProjectileSpawnDistance * Transform.up); Instantiate(BounceBolt, position, Transform.rotation); NextShotTime = Time.time + BounceBolt.ShotCooldownSec; } }