private void OnTriggerEnter(Collider col) { if (col.gameObject.CompareTag("Player")) { if (ghostType == GhostType.wall && ghostNumber == 1) { game.ghost_Wall_1 = record.positions; } else if (ghostType == GhostType.wall && ghostNumber == 2) { game.ghost_Wall_2 = record.positions; } else if (ghostType == GhostType.wall && ghostNumber == 3) { game.ghost_Wall_3 = record.positions; } else if (ghostType == GhostType.kill && ghostNumber == 1) { game.ghost_Kill_1 = record.positions; } else if (ghostType == GhostType.kill && ghostNumber == 2) { game.ghost_Kill_2 = record.positions; } else if (ghostType == GhostType.kill && ghostNumber == 3) { game.ghost_Kill_3 = record.positions; } record.NewGhost(ghostType.GetHashCode(), ghostNumber); SaveSystem.SavePlayer(game); ghost.SetActive(true); this.enabled = false; } }