public void Die(Damager damager, Damageable damageable) { Vector2 throwVector = new Vector2(0, 2.0f); Vector2 damagerToThis = damager.transform.position - transform.position; throwVector.x = Mathf.Sign(damagerToThis.x) * -4.0f; SetMoveVector(throwVector); m_Animator.SetTrigger(m_HashDeathPara); dieAudio.PlayRandomSound(); m_Dead = true; m_Collider.enabled = false; CameraShaker.Shake(0.15f, 0.3f); }
public void Die(TakeDamager damager, TakeDamageable damageable) { //Vector2 throwVector = new Vector2(0, 2.0f); //Vector2 damagerToThis = damager.transform.position - transform.position; //throwVector.x = Mathf.Sign(damagerToThis.x) * -4.0f; //SetMoveVector(throwVector); m_Animator.SetTrigger(m_HashDeathPara); dieAudio.PlayRandomSound(); m_Dead = true; //Debug.Log(moveVector); //m_Collider.enabled = false; gameObject.layer = 20; CameraShaker.Shake(0.15f, 0.3f); }
public void Hit(Damager damager, Damageable damageable) { if (damageable.CurrentHealth <= 0) { return; } m_Animator.SetTrigger(m_HashHitPara); Vector2 throwVector = new Vector2(0, 3.0f); Vector2 damagerToThis = damager.transform.position - transform.position; throwVector.x = Mathf.Sign(damagerToThis.x) * -2.0f; m_MoveVector = throwVector; if (m_FlickeringCoroutine != null) { StopCoroutine(m_FlickeringCoroutine); m_SpriteRenderer.color = m_OriginalColor; } m_FlickeringCoroutine = StartCoroutine(Flicker(damageable)); CameraShaker.Shake(0.15f, 0.3f); }
private void OnEnable() { s_Instance = this; }