ProfilerOverlay.cs 850 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace BansheeEngine
  6. {
  7. // Note: Must be the same as C++ enum ProfilerOverlayType
  8. public enum ProfilerOverlayType
  9. {
  10. CPUSamples,
  11. GPUSamples
  12. };
  13. public class ProfilerOverlay : Component
  14. {
  15. private ProfilerOverlayInternal impl;
  16. public void SetType(ProfilerOverlayType type)
  17. {
  18. impl.SetType(type);
  19. }
  20. private void OnReset()
  21. {
  22. if (impl != null)
  23. impl.Destroy();
  24. Camera cam = SceneObject.GetComponent<Camera>();
  25. impl = new ProfilerOverlayInternal(cam);
  26. }
  27. private void Update()
  28. {
  29. impl.Update();
  30. }
  31. private void OnDestroy()
  32. {
  33. impl.Destroy();
  34. }
  35. }
  36. }