5311e24d68857b28eb676fa5f1899f1955268dfe.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, ParamType, AnimatorParams, _crd;
  4. function _reportPossibleCrUseOfParamType(extras) {
  5. _reporterNs.report("ParamType", "./AnimatorCondition", _context.meta, extras);
  6. }
  7. _export("default", void 0);
  8. return {
  9. setters: [function (_unresolved_) {
  10. _reporterNs = _unresolved_;
  11. }, function (_cc) {
  12. _cclegacy = _cc.cclegacy;
  13. }, function (_unresolved_2) {
  14. ParamType = _unresolved_2.ParamType;
  15. }],
  16. execute: function () {
  17. _crd = true;
  18. _cclegacy._RF.push({}, "13926xryDRPXJ50lCnLvy4J", "AnimatorParams", undefined);
  19. /**
  20. * 参数结构
  21. */
  22. /**
  23. * 状态机参数
  24. */
  25. _export("default", AnimatorParams = class AnimatorParams {
  26. constructor(dataArr) {
  27. this._paramMap = new Map();
  28. dataArr.forEach(data => {
  29. var param = {
  30. type: data.type,
  31. value: data.init
  32. };
  33. this._paramMap.set(data.param, param);
  34. });
  35. }
  36. getParamType(key) {
  37. var param = this._paramMap.get(key);
  38. if (param) {
  39. return param.type;
  40. } else {
  41. return null;
  42. }
  43. }
  44. setNumber(key, value) {
  45. var param = this._paramMap.get(key);
  46. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  47. error: Error()
  48. }), ParamType) : ParamType).NUMBER) {
  49. param.value = value;
  50. }
  51. }
  52. setBool(key, value) {
  53. var param = this._paramMap.get(key);
  54. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  55. error: Error()
  56. }), ParamType) : ParamType).BOOLEAN) {
  57. param.value = value ? 1 : 0;
  58. }
  59. }
  60. setTrigger(key) {
  61. var param = this._paramMap.get(key);
  62. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  63. error: Error()
  64. }), ParamType) : ParamType).TRIGGER) {
  65. param.value = 1;
  66. }
  67. }
  68. resetTrigger(key) {
  69. var param = this._paramMap.get(key);
  70. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  71. error: Error()
  72. }), ParamType) : ParamType).TRIGGER) {
  73. param.value = 0;
  74. }
  75. }
  76. autoTrigger(key) {
  77. var param = this._paramMap.get(key);
  78. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  79. error: Error()
  80. }), ParamType) : ParamType).AUTO_TRIGGER) {
  81. param.value = 1;
  82. }
  83. }
  84. resetAutoTrigger(key) {
  85. var param = this._paramMap.get(key);
  86. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  87. error: Error()
  88. }), ParamType) : ParamType).AUTO_TRIGGER) {
  89. param.value = 0;
  90. }
  91. }
  92. resetAllAutoTrigger() {
  93. this._paramMap.forEach((param, key) => {
  94. if (param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  95. error: Error()
  96. }), ParamType) : ParamType).AUTO_TRIGGER) {
  97. param.value = 0;
  98. }
  99. });
  100. }
  101. getNumber(key) {
  102. var param = this._paramMap.get(key);
  103. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  104. error: Error()
  105. }), ParamType) : ParamType).NUMBER) {
  106. return param.value;
  107. } else {
  108. return 0;
  109. }
  110. }
  111. getBool(key) {
  112. var param = this._paramMap.get(key);
  113. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  114. error: Error()
  115. }), ParamType) : ParamType).BOOLEAN) {
  116. return param.value;
  117. } else {
  118. return 0;
  119. }
  120. }
  121. getTrigger(key) {
  122. var param = this._paramMap.get(key);
  123. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  124. error: Error()
  125. }), ParamType) : ParamType).TRIGGER) {
  126. return param.value;
  127. } else {
  128. return 0;
  129. }
  130. }
  131. getAutoTrigger(key) {
  132. var param = this._paramMap.get(key);
  133. if (param && param.type === (_crd && ParamType === void 0 ? (_reportPossibleCrUseOfParamType({
  134. error: Error()
  135. }), ParamType) : ParamType).AUTO_TRIGGER) {
  136. return param.value;
  137. } else {
  138. return 0;
  139. }
  140. }
  141. });
  142. _cclegacy._RF.pop();
  143. _crd = false;
  144. }
  145. };
  146. });
  147. //# sourceMappingURL=5311e24d68857b28eb676fa5f1899f1955268dfe.js.map