public void Spawn(Vector3 position, int spawnOrder) { if (enemyType == ENEMY_TYPE.Slime) { //땅으로 나와서 스폰해야한다. RaycastHit hitResult; bool isHit = Physics.Raycast(position + new Vector3(0, 10, 0), new Vector3(0, -1, 0), out hitResult, 100); if (isHit && hitResult.collider != null) { position.y = hitResult.point.y - footPos.localPosition.y; } } transform.position = position; transform.localScale = new Vector3(1, 1, 1); portrait.SetSortingOrder(6 + spawnOrder); portrait.Show(); //portrait.Play("Idle"); if (UnityEngine.Random.Range(0, 10) < 5) { LookLeft(); } else { LookRight(); } _isFirstFrame = true; _status = STATUS_IDLE; animator.SetInteger("Status", _status); spawnFx.Play(); }