Unity : La classe Gizmos – Débogage visuel

Les gizmos sont utilisés pour fournir des aides au débogage visuel ou à la configuration dans la vue de la scène.

Tous les dessins de gizmo doivent être effectués dans les fonctions OnDrawGizmos ou OnDrawGizmosSelected du script.
OnDrawGizmos est appelé chaque image. 

Tous les gadgets rendus dans OnDrawGizmos sont sélectionnables. OnDrawGizmosSelected est appelé uniquement si l’objet auquel le script est attaché est sélectionné.

YouTube player
Tutoriel gratuit…

Static Properties

colorSets the color for the gizmos that will be drawn next.
exposureSet a texture that contains the exposure correction for LightProbe gizmos. The value is sampled from the red channel in the middle of the texture.
matrixSets the Matrix4x4 that the Unity Editor uses to draw Gizmos.

Static Methods

DrawCubeDraw a solid box with center and size.
DrawFrustumDraw a camera frustum using the currently set Gizmos.matrix for it’s location and rotation.
DrawGUITextureDraw a texture in the Scene.
DrawIconDraw an icon at a position in the Scene view.
DrawLineDraws a line starting at from towards to.
DrawMeshDraws a mesh.
DrawRayDraws a ray starting at from to from + direction.
DrawSphereDraws a solid sphere with center and radius.
DrawWireCubeDraw a wireframe box with center and size.
DrawWireMeshDraws a wireframe mesh.
DrawWireSphereDraws a wireframe sphere with center and radius.

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur la façon dont les données de vos commentaires sont traitées.