手动控制spine 动画
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user