You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
412 B

5 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. [RequireComponent(typeof(Camera))]
  4. public class wireframe : MonoBehaviour {
  5. public KeyCode wireFrameKey;
  6. public bool wireFrameMode;
  7. public void Start()
  8. {
  9. }
  10. void OnPreRender() {
  11. if(wireFrameMode)
  12. GL.wireframe = true;
  13. else
  14. GL.wireframe = false;
  15. }
  16. void Update()
  17. {
  18. if(Input.GetKeyDown(wireFrameKey))
  19. wireFrameMode = !wireFrameMode;
  20. }
  21. }