@cc-component/cc-ex-component 1.6.6 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,6 +147,10 @@ declare module 'cc' {
147
147
  * @param time 禁用后xx秒后恢复,不传一直禁用
148
148
  */
149
149
  enable(enable: boolean, time?: number): void;
150
+ /**按下放大动画 */
151
+ touchStartAnim(scale: number, time?: number): void;
152
+ /**抬起缩小 */
153
+ touchEndAnim(time?: number): void;
150
154
  }
151
155
  interface Component {
152
156
  /**
@@ -638,6 +642,27 @@ Node.prototype.enable = function (this: Node, enable: boolean, time?: number): v
638
642
  }
639
643
  };
640
644
 
645
+ Node.prototype.touchStartAnim = function (this: Node, scale?: number, time?: number): void {
646
+ if (this.isValid) {
647
+ const btn = this
648
+ if (btn && btn.isValid) {
649
+ const scal = scale || 1.2
650
+ const t = time || 0.1
651
+ tween(btn).to(t, { scale: v3(scal, scal, scal) }).start();
652
+ }
653
+ }
654
+ };
655
+
656
+ Node.prototype.touchEndAnim = function (this: Node, time?: number): void {
657
+ if (this.isValid) {
658
+ const btn = this
659
+ if (btn && btn.isValid) {
660
+ tween(btn).to(time | 0.1, { scale: v3(1, 1, 1) }).start();
661
+ }
662
+ }
663
+ };
664
+
665
+
641
666
  Map.prototype.toObject = function (): Object {
642
667
  const obj = {};
643
668
  for (const [key, value] of this.entries()) {
package/index.ts CHANGED
@@ -8,6 +8,8 @@ export * from './assets/core/BaseViewModelData';
8
8
  export * from './assets/core/BaseWindow';
9
9
  export * from './assets/core/ViewSearch';
10
10
 
11
+ export * from './assets/ex/ExTween';
12
+
11
13
  export * from './assets/interface/Interface';
12
14
  export * from './assets/interface/ExComponentModule';
13
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-ex-component",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",