DeviceParam.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. [CreateAssetMenu(menuName = "SCConfig/SCDeviceConfig")]
  6. public class DeviceParam : ScriptableObject {
  7. public enum DeviceType {
  8. Action,
  9. ActionPro,
  10. Jimo,
  11. V01
  12. }
  13. [Serializable]
  14. public class Device {
  15. public DeviceType type;
  16. public bool HasRGB=true;
  17. public Vector3 RGBRotationOffset;
  18. public Vector3 RGBPositionOffset;
  19. }
  20. public Device Action = new Device {
  21. type = DeviceType.Action,
  22. HasRGB = true,
  23. RGBRotationOffset = new Vector3(8.0f, 0.0f, 0.0f),
  24. RGBPositionOffset = new Vector3(0.0f, 0.04f, 0.0f),
  25. };
  26. public Device ActionPro = new Device {
  27. type = DeviceType.ActionPro,
  28. HasRGB = true,
  29. RGBRotationOffset = new Vector3(8.0f, 0.0f, 0.0f),
  30. RGBPositionOffset = new Vector3(0.0f, 0.04f, 0.0f),
  31. };
  32. public Device Jimo = new Device {
  33. type = DeviceType.Jimo,
  34. HasRGB = true,
  35. RGBRotationOffset = new Vector3(0.0f, 0.0f, 0.0f),
  36. RGBPositionOffset = new Vector3(0.0f, 0.04f, 0.0f),
  37. };
  38. public Device V01 = new Device {
  39. type = DeviceType.V01,
  40. HasRGB = false,
  41. RGBRotationOffset = Vector3.zero,
  42. RGBPositionOffset = Vector3.zero,
  43. };
  44. public Device Current {
  45. get {
  46. if(DeviceInfo.MODEL == "JIMO") {
  47. return Jimo;
  48. } else if(DeviceInfo.MODEL == "V01") {
  49. return V01;
  50. } else if(DeviceInfo.MODEL == "A01") {
  51. return Action;
  52. } else if(DeviceInfo.MODEL == "A01_PRO") {
  53. return ActionPro;
  54. } else {
  55. return ActionPro;
  56. }
  57. }
  58. }
  59. }