手动控制spine 动画

This commit is contained in:
pan@work
2024-07-19 17:11:19 +08:00
parent f34018ac59
commit d80f16a0f7
22 changed files with 675 additions and 1221 deletions

View File

@@ -6,7 +6,6 @@
*/
import { Component, Node, _decorator } from 'cc';
import { Timer } from '../../../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer';
import Charactor from '../charactor/Charactor';
const { ccclass, property } = _decorator;
@@ -21,15 +20,16 @@ export default class EntityLayer extends Component {
private timer: Timer = new Timer(0.2);
update(dt: number) {
if (this.timer.update(dt))
this.node.children.sort(this.zIndexSort);
this.timer.update(dt)
// if (this.timer.update(dt))
// this.node.children.sort(this.zIndexSort);
}
private zIndexSort(a: Node, b: Node) {
let a_zIndex = a.getComponent(Charactor)!.zIndex;
let b_zIndex = b.getComponent(Charactor)!.zIndex;
return a_zIndex - b_zIndex;
}
// private zIndexSort(a: Node, b: Node) {
// let a_zIndex = a.getComponent(Charactor)!.zIndex;
// let b_zIndex = b.getComponent(Charactor)!.zIndex;
// return a_zIndex - b_zIndex;
// }
public clear() {
this.node.children.forEach(n => {