No Description
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.

DummyLoader.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using UnityEngine.Rendering;
  2. using System.Collections.Generic;
  3. using System.Runtime.CompilerServices;
  4. [assembly: InternalsVisibleTo("Unity.AdaptivePerformance.Editor.Tests")]
  5. namespace UnityEngine.AdaptivePerformance.Tests
  6. {
  7. internal class DummyLoader : AdaptivePerformanceLoader
  8. {
  9. public bool shouldFail = false;
  10. public int id;
  11. public GraphicsDeviceType supportedDeviceType = GraphicsDeviceType.Null;
  12. public DummyLoader()
  13. {
  14. }
  15. public override ISubsystem GetDefaultSubsystem()
  16. {
  17. return null;
  18. }
  19. public override IAdaptivePerformanceSettings GetSettings()
  20. {
  21. return null;
  22. }
  23. public override bool Initialize()
  24. {
  25. return !shouldFail;
  26. }
  27. public override T GetLoadedSubsystem<T>()
  28. {
  29. return default(T);
  30. }
  31. protected bool Equals(DummyLoader other)
  32. {
  33. return base.Equals(other) && shouldFail == other.shouldFail && id == other.id;
  34. }
  35. public override bool Equals(object obj)
  36. {
  37. if (ReferenceEquals(null, obj)) return false;
  38. if (ReferenceEquals(this, obj)) return true;
  39. if (obj.GetType() != this.GetType()) return false;
  40. return Equals((DummyLoader)obj);
  41. }
  42. public override int GetHashCode()
  43. {
  44. unchecked
  45. {
  46. int hashCode = base.GetHashCode();
  47. hashCode = (hashCode * 397) ^ shouldFail.GetHashCode();
  48. hashCode = (hashCode * 397) ^ id;
  49. return hashCode;
  50. }
  51. }
  52. }
  53. }