예제 #1
0
 void CheckForKill(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         other.GetComponent <MoveState>().Kill();
     }
     else
     {
         KillObject obj = other.GetComponent <KillObject>();
         if (obj != null)
         {
             obj.Kill();
         }
     }
 }
예제 #2
0
 // Use this for initialization
 void  OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         other.GetComponent <DeadState>().typeOfDead = DeadType.Acid;
         other.GetComponent <MoveState>().Kill(acidDeathSFX);
     }
     else
     {
         KillObject obj = other.GetComponent <KillObject>();
         if (obj != null)
         {
             obj.Kill();
         }
     }
 }
예제 #3
0
    // Use this for initialization
    void  OnTriggerEnter2D(Collider2D other)
    {
        // Debug.Log("Collision");
        if (other.CompareTag("Player"))
        {
            if (isElectricKill)
            {
                other.GetComponent <DeadState>().typeOfDead = DeadType.Ray;
            }

            other.GetComponent <MoveState>().Kill(spikeDeathSFX);
        }
        else
        {
            KillObject obj = other.GetComponent <KillObject>();
            if (obj != null)
            {
                obj.Kill();
            }
        }
    }
예제 #4
0
 // Use this for initialization
 protected virtual void OnTriggerEnter2D(Collider2D other)
 {
     if (!other.CompareTag("Glitch"))
     {
         if (box.enabled)
         {
             if (other.CompareTag("Player") && canKillPlayer)
             {
                 if (isMegaElectricKill)
                 {
                     other.GetComponent <DeadState>().typeOfDead = DeadType.MegaRay;
                 }
                 else if (isElectricKill)
                 {
                     other.GetComponent <DeadState>().typeOfDead = DeadType.Ray;
                 }
                 if (isGlitch == "W5" && isCollectable != "W5C")//klvo
                 {
                     other.GetComponent <MoveState>().Kill(bulletDeathGSFX);
                 }
                 else //endKlvo
                 {
                     other.GetComponent <MoveState>().Kill(bulletDeathSFX);
                 }
             }
             else
             {
                 KillObject killer = other.GetComponent <KillObject>();
                 //                Debug.Log(other.name +" Killobject: "+ killer);
                 if (killer != null)
                 {
                     killer.Kill();
                 }
             }
             box.enabled = false;
             HandlerDestroy();
         }
     }
 }
예제 #5
0
 void CheckForKill(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         other.GetComponent <DeadState>().typeOfDead = DeadType.Ray;
         other.GetComponent <MoveState>().Kill();
         if (sfxAudio.clip != shieldDeathSFX)
         {
             sfxAudio.clip   = shieldDeathSFX;
             sfxAudio.volume = 1;
             sfxAudio.Play();
         }
     }
     else
     {
         KillObject obj = other.GetComponent <KillObject>();
         if (obj != null)
         {
             obj.Kill();
         }
     }
 }
예제 #6
0
 bool CheckForKill(Collider2D other, bool canKill)
 {
     if (other.CompareTag("Player"))
     {
         if (canKill)
         {
             other.GetComponent <DeadState>().typeOfDead = DeadType.Ray;
             other.GetComponent <MoveState>().Kill(electricDeathSFX);
         }
     }
     else if (other.CompareTag("Player2"))
     {
         return(true);
     }
     else if (other.CompareTag("DoorEspecial"))
     {
         if (canKill)
         {
             other.GetComponent <EspecialDoorRay>().Kill();
         }
     }
     else
     {
         KillObject obj = other.GetComponent <KillObject>();
         if (obj != null)
         {
             if (canKill)
             {
                 obj.Kill();
             }
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
예제 #7
0
    protected override void OnTriggerEnter2D(Collider2D other)
    {
        if (!other.CompareTag("Glitch"))
        {
            if (box.enabled)
            {
                if (other.CompareTag("Player"))
                {
                    if (isElectricKill)
                    {
                        other.GetComponent <DeadState>().typeOfDead = DeadType.Ray;
                    }
                    other.GetComponent <MoveState>().Kill(bulletDeathSFX);
                    box.enabled = false;
                    HandlerDestroy();
                }
                else if (other.CompareTag("Resorte"))
                {
                }
                else if (other.CompareTag("Pistol"))
                {
                }
                else
                {
                    KillObject killer = other.GetComponent <KillObject>();
                    //                Debug.Log(other.name +" Killobject: "+ killer);
                    if (killer != null)
                    {
                        killer.Kill();
                    }

                    box.enabled = false;
                    HandlerDestroy();
                }
            }
        }
    }
예제 #8
0
 public override void Kill()
 {
     killObj.Kill();
 }