Brak opisu
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.

Surface.cs 757B

12345678910111213141516171819202122232425262728293031323334
  1. using Unity.Collections;
  2. using Unity.Collections.LowLevel.Unsafe;
  3. using UnityEngine;
  4. namespace PDNWrapper
  5. {
  6. internal class Surface
  7. {
  8. NativeArray<Color32> m_Color;
  9. public Surface(int w, int h)
  10. {
  11. width = w;
  12. height = h;
  13. m_Color = new NativeArray<Color32>(width * height, Allocator.Persistent);
  14. }
  15. public void Dispose()
  16. {
  17. if (m_Color.IsCreated)
  18. {
  19. m_Color.Dispose();
  20. m_Color = default;
  21. }
  22. }
  23. public NativeArray<Color32> color
  24. {
  25. get { return m_Color; }
  26. }
  27. public int width { get; private set; }
  28. public int height { get; private set; }
  29. }
  30. }