void CheckForKill(Collider2D other) { if (other.CompareTag("Player")) { other.GetComponent <MoveState>().Kill(); } else { KillObject obj = other.GetComponent <KillObject>(); if (obj != null) { obj.Kill(); } } }
// 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(); } } }
// 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(); } } }
// 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(); } } }
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(); } } }
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); }
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(); } } } }
public override void Kill() { killObj.Kill(); }