Version: 5.3 (switch to 5.4b)
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.


Suggest a change


Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.


Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.



Switch to Manual


해당 오브젝트가 선택되었을 때에만 기즈모(gizmos)를 그리고 싶은 경우에, OnDrawGizmosSelected를 사용합니다.

Gizmos는 해당 오브젝트가 선택되었을 때에만 그려집니다. 기즈모는 선택되지 않지만, 설정을 편리하게 하기위해 사용됩니다. 예를 들어, 폭발 스크립트에서 충돌 반경을 보여주는 구를 그릴 수 있습니다. showing the explosion radius.

	var explosionRadius : float = 5.0;

function OnDrawGizmosSelected () { // Display the explosion radius when selected Gizmos.color = Color.white; Gizmos.DrawSphere (transform.position, explosionRadius); }

See Also: OnDrawGizmos.