Exemple #1
0
    private void OnCollisionEnter(Collision other)
    {
        //충돌한 Collider의 태그가 BULLET이면 Player의 currHp차감
        if (other.gameObject.tag == AttackTag)
        {
            //혈흔 효과
            StartCoroutine(ShowBloodScreen());
            currHp -= 5f;
            print(currHp.ToString());
            GetComponent<PlayerCtrl>().HitDamage();
            GetComponent<FireCtrl>().HitDam();
            DisplayHpBar();
            shake.StartCoroutine(shake.ShakeCamera());

            //Player의 생명이 0이하면 Die처리
            if (currHp <= 0)
            {
                PlayerDie();                
                currHp = 0;
                lost.gameObject.SetActive(true);
                manager.MouseNone();
                
            }            
        }
       
    }
Exemple #2
0
 //Shake the screen
 public void ScreenShake(float duration, float magnitude)
 {
     camShaker.StartCoroutine(camShaker.StartShake(duration, magnitude));
 }
Exemple #3
0
 public static void ShakeObj(float duration, float amount)
 {
     instance._originalPos = instance.gameObject.transform.localPosition;
     instance.StopAllCoroutines();
     instance.StartCoroutine(instance.cShake(duration, amount, new Vector3()));
 }