SceneGrid.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. /// <summary>
  7. /// Handles rendering of the scene grid for the specified camera. Grid properties are controlled through
  8. /// <see cref="EditorSettings"/>.
  9. /// </summary>
  10. internal sealed class SceneGrid : ScriptObject
  11. {
  12. /// <summary>
  13. /// Creates a new scene grid renderer.
  14. /// </summary>
  15. /// <param name="sceneCamera">Camera into which the grid will be rendered.</param>
  16. internal SceneGrid(Camera sceneCamera)
  17. {
  18. Internal_Create(this, sceneCamera.Native.GetCachedPtr());
  19. }
  20. /// <summary>
  21. /// Queues grid drawing for this frame.
  22. /// </summary>
  23. internal void Draw()
  24. {
  25. Internal_Draw(mCachedPtr);
  26. }
  27. [MethodImpl(MethodImplOptions.InternalCall)]
  28. private static extern void Internal_Create(SceneGrid managedInstance, IntPtr camera);
  29. [MethodImpl(MethodImplOptions.InternalCall)]
  30. private static extern void Internal_Draw(IntPtr thisPtr);
  31. }
  32. }