Esempio n. 1
0
 void ColWithSpike(Spike spike)
 {
     if ((isPowered && state == State.Jumping) || isStomping)
     {
         spike.ColWithStomp();
         GameManager.Instance.StompSpike(transform.position);
     }
     else if (!isImmune)
     {
         life -= 1;
         lifeSet.GetDamage();
         isImmune    = true;
         immuneTick  = 0f;
         immuneETime = 0f;
         cameraScript.ShakeSpike();
         if (life == 0)
         {
             Die();
         }
         else
         {
             hitParticle.transform.position   = transform.position + new Vector3(0, 0, 500);
             hitParticle.transform.localScale = transform.localScale;
             hitParticle.gameObject.SetActive(true);
             hurtSound.Play();
         }
     }
 }