箭落地 1 秒后才消失
This commit is contained in:
parent
82285176d2
commit
322a153ed2
@ -10,6 +10,7 @@
|
||||
"_techIdx": 0,
|
||||
"_defines": [
|
||||
{
|
||||
"USE_INSTANCING": true,
|
||||
"USE_TEXTURE": true
|
||||
}
|
||||
],
|
||||
|
@ -40,10 +40,23 @@ export class Arrow extends Component {
|
||||
this._updatePosAndForward(percent);
|
||||
|
||||
if (percent >= 1) {
|
||||
this.node.removeFromParent();
|
||||
this.remove();
|
||||
}
|
||||
}
|
||||
|
||||
private _isRemoved = false;
|
||||
remove() {
|
||||
if (this._isRemoved) {
|
||||
return;
|
||||
}
|
||||
this._isRemoved = true;
|
||||
|
||||
// 落地 1 秒后消失
|
||||
this.scheduleOnce(() => {
|
||||
this.node.removeFromParent()
|
||||
}, 1)
|
||||
}
|
||||
|
||||
private _updatePosAndForward(percent: number) {
|
||||
let nextPos = this._getPos(percent);
|
||||
this.node.position = nextPos;
|
||||
|
@ -216,7 +216,7 @@
|
||||
"propertyPath": [
|
||||
"_useBakedAnimation"
|
||||
],
|
||||
"value": false
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"__type__": "cc.TargetInfo",
|
||||
|
Loading…
Reference in New Issue
Block a user