AssetAdvancedConfig.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using UnityEngine;
  3. namespace TriLib
  4. {
  5. [Serializable]
  6. public class AssetAdvancedConfig
  7. {
  8. public AssetAdvancedConfig()
  9. {
  10. }
  11. public AssetAdvancedConfig(string key)
  12. {
  13. this.Key = key;
  14. }
  15. public AssetAdvancedConfig(string key, int defaultValue)
  16. {
  17. this.Key = key;
  18. this.IntValue = defaultValue;
  19. }
  20. public AssetAdvancedConfig(string key, float defaultValue)
  21. {
  22. this.Key = key;
  23. this.FloatValue = defaultValue;
  24. }
  25. public AssetAdvancedConfig(string key, bool defaultValue)
  26. {
  27. this.Key = key;
  28. this.BoolValue = defaultValue;
  29. }
  30. public AssetAdvancedConfig(string key, string defaultValue)
  31. {
  32. this.Key = key;
  33. this.StringValue = defaultValue;
  34. }
  35. public AssetAdvancedConfig(string key, AiComponent defaultValue)
  36. {
  37. this.Key = key;
  38. this.IntValue = (int)defaultValue;
  39. }
  40. public AssetAdvancedConfig(string key, AiPrimitiveType defaultValue)
  41. {
  42. this.Key = key;
  43. this.IntValue = (int)defaultValue;
  44. }
  45. public AssetAdvancedConfig(string key, AiUVTransform defaultValue)
  46. {
  47. this.Key = key;
  48. this.IntValue = (int)defaultValue;
  49. }
  50. public AssetAdvancedConfig(string key, Vector3 translation, Vector3 rotation, Vector3 scale)
  51. {
  52. this.Key = key;
  53. this.TranslationValue = translation;
  54. this.RotationValue = rotation;
  55. this.ScaleValue = scale;
  56. }
  57. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, int value)
  58. {
  59. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  60. }
  61. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, float value)
  62. {
  63. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  64. }
  65. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, bool value)
  66. {
  67. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  68. }
  69. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, string value)
  70. {
  71. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  72. }
  73. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, AiComponent value)
  74. {
  75. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  76. }
  77. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, AiPrimitiveType value)
  78. {
  79. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  80. }
  81. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, AiUVTransform value)
  82. {
  83. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), value);
  84. }
  85. public static AssetAdvancedConfig CreateConfig(AssetAdvancedPropertyClassNames className, Vector3 translation, Vector3 rotation, Vector3 scale)
  86. {
  87. return new AssetAdvancedConfig(AssetAdvancedPropertyMetadata.GetConfigKey(className), translation, rotation, scale);
  88. }
  89. public string Key;
  90. public int IntValue;
  91. public float FloatValue;
  92. public bool BoolValue;
  93. public string StringValue;
  94. public Vector3 TranslationValue;
  95. public Vector3 RotationValue;
  96. public Vector3 ScaleValue;
  97. }
  98. }