/************************************** * @함수명: OnDead * @작성자: zeli * @입력: void * @출력: void * @설명: 제자리 정지 * Dead Animation 실행 * 페이드 아웃 코루틴 호출 */ public void OnDead() { if (!isAlive) { return; //죽었으면 리턴 } enemyRigid.velocity = Vector2.zero; isNotMove = true; AudioSource audio = GetComponent <AudioSource>(); audio.Play(); DeadAnim.SetTrigger("Dead"); StartCoroutine(FadeOutAndDead()); soul.CreateSoul(transform.position + new Vector3(0, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(1, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(1.5f, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(2, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(-1, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(-1.5f, 0, 0), 0.5f); soul.CreateSoul(transform.position + new Vector3(-2f, 0, 0), 0.5f); isAlive = false; }