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