예제 #1
0
 IEnumerator DunkCancel_C()
 {
     ChangeState(DunkState.Canceling);
     currentCD = dunkCooldown;
     EnergyManager.DecreaseEnergy(energyPercentLostOnFail);
     yield return(FallOnGround_C(dunkCancelledFallSpeed));
 }
예제 #2
0
    private void Explode()
    {
        Analytics.CustomEvent("SuccessfulDunk", new Dictionary <string, object> {
            { "Zone", GameManager.GetCurrentZoneName() },
        });
        BallBehaviour i_ball = passController.GetBall();

        ChangeState(DunkState.Explosing);
        if (playerController != null)
        {
            EnergyManager.DecreaseEnergy(energyPercentLostOnSuccess);
        }
        List <IHitable> i_hitTarget = new List <IHitable>();

        Collider[] i_hitColliders = Physics.OverlapSphere(i_ball.transform.position, dunkExplosionRadius);
        int        i = 0;

        while (i < i_hitColliders.Length)
        {
            IHitable i_potentialHitableObject = i_hitColliders[i].GetComponentInParent <IHitable>();
            if (i_potentialHitableObject != null && !i_hitTarget.Contains(i_potentialHitableObject))
            {
                i_potentialHitableObject.OnHit(i_ball, (i_hitColliders[i].transform.position - transform.position).normalized, pawnController, dunkDamages, DamageSource.Dunk);
                i_hitTarget.Add(i_potentialHitableObject);
            }
            i++;
        }
        ChangeState(DunkState.None);
    }