Ejemplo n.º 1
0
 public override void ReactToCollision(int collidedHealth)
 {
     if (collisionEffect != null)
     {
         collisionEffect.PlayEffect();
     }
 }
    public override void ReactToCollision(int collidedHealth)
    {
        if (collisionEffect != null)
        {
            collisionEffect.PlayEffect();
        }

        runtimeObsHealth -= collidedHealth;
        if (runtimeObsHealth <= 0)
        {
            obstacleState    = HealthState.Wrecked;
            runtimeObsHealth = obsHealth;
            StartCoroutine(objReturner.ReturnToPool(0));
        }
        else
        {
            obstacleState = HealthState.Fractured;
        }
    }