DrawLine
How do I use Draw Line
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: PickupCamera.cs
Copy
80 void DebugDrawStuff()
81 {
82 Debug.DrawLine( _target.position, _target.position + headOffset );
83
84 }
File name: ThirdPersonCamera.cs
Copy
72 void DebugDrawStuff()
73 {
74 Debug.DrawLine( _target.position, _target.position + headOffset );
75
76 }
File name: PhotonTransformView.cs
Copy
130 void DoDrawEstimatedPositionError()
131 {
132 Vector3 targetPosition = m_PositionControl.GetNetworkPosition();
133
134 Debug.DrawLine( targetPosition, transform.position, Color.red, 2f );
135 Debug.DrawLine( transform.position, transform.position + Vector3.up, Color.green, 2f );
136 Debug.DrawLine( targetPosition, targetPosition + Vector3.up, Color.red, 2f );
137 }
File name: ReadmeEditor.cs
Copy
143 bool LinkLabel (GUIContent label, params GUILayoutOption[] options)
144 {
145 var position = GUILayoutUtility.GetRect(label, LinkStyle, options);
146
147 Handles.BeginGUI ();
148 Handles.color = LinkStyle.normal.textColor;
149 Handles.DrawLine (new Vector3(position.xMin, position.yMax), new Vector3(position.xMax, position.yMax));
150 Handles.color = Color.white;
151 Handles.EndGUI ();
152
153 EditorGUIUtility.AddCursorRect (position, MouseCursor.Link);
154
155 return GUI.Button (position, label, LinkStyle);
156 }
DrawLine 125 lượt xem
Gõ tìm kiếm nhanh...