示例#1
0
    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;
        }
    }
示例#2
0
    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;
        }
    }