Example #1
0
    protected override void OnProjectileReachedEnd(Projectile projectile)
    {
        AreaOfEffect aoe = Instantiate(explosionAreaOfEffectPrefab, projectile.transform.position, projectile.transform.rotation).GetComponent <AreaOfEffect>();

        aoe.CreateAreaOfEffect(projectile.UnitsAlreadyHit, champion.Team, affectedUnitType, durationAoE, true);
        aoe.ActivateAreaOfEffect();
        aoe.OnAbilityEffectHit += OnAreaOfEffectHit;
        Destroy(projectile.gameObject);
    }
Example #2
0
    protected override IEnumerator AbilityWithCastTime()
    {
        Quaternion currentRotation = transform.rotation;

        transform.LookAt(destinationOnCast);
        SetPositionAndRotationOnCast(transform.position + (transform.forward * areaOfEffectPrefab.transform.localScale.z * 0.5f));
        transform.rotation = currentRotation;
        IsBeingCasted      = true;

        yield return(delayCastTime);

        IsBeingCasted = false;
        UseResource();
        champion.OrientationManager.RotateCharacterInstantly(destinationOnCast);

        AreaOfEffect aoe = (Instantiate(areaOfEffectPrefab, positionOnCast, rotationOnCast)).GetComponent <AreaOfEffect>();

        aoe.CreateAreaOfEffect(new List <Unit>(), champion.Team, affectedUnitType, durationAoE);
        aoe.ActivateAreaOfEffect();
        aoe.OnAbilityEffectHit += OnAbilityEffectHit;

        FinishAbilityCast();
    }