From 322a153ed2e5205f99798244736e43224dc3d3a2 Mon Sep 17 00:00:00 2001 From: k8w Date: Fri, 3 Dec 2021 21:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=AD=E8=90=BD=E5=9C=B0=201=20=E7=A7=92?= =?UTF-8?q?=E5=90=8E=E6=89=8D=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javelin/Materials_javelin01/Material #6.mtl | 1 + .../frontend/assets/prefabs/Arrow/Arrow.ts | 15 ++++++++++++++- .../frontend/assets/prefabs/Player/Player.prefab | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/cocos-creator-multiplayer/frontend/assets/3d/javelin/Materials_javelin01/Material #6.mtl b/examples/cocos-creator-multiplayer/frontend/assets/3d/javelin/Materials_javelin01/Material #6.mtl index d3ed79a..2609551 100644 --- a/examples/cocos-creator-multiplayer/frontend/assets/3d/javelin/Materials_javelin01/Material #6.mtl +++ b/examples/cocos-creator-multiplayer/frontend/assets/3d/javelin/Materials_javelin01/Material #6.mtl @@ -10,6 +10,7 @@ "_techIdx": 0, "_defines": [ { + "USE_INSTANCING": true, "USE_TEXTURE": true } ], diff --git a/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Arrow/Arrow.ts b/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Arrow/Arrow.ts index cad1271..2d4638c 100644 --- a/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Arrow/Arrow.ts +++ b/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Arrow/Arrow.ts @@ -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; diff --git a/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Player/Player.prefab b/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Player/Player.prefab index 8af4529..40cbb8f 100644 --- a/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Player/Player.prefab +++ b/examples/cocos-creator-multiplayer/frontend/assets/prefabs/Player/Player.prefab @@ -216,7 +216,7 @@ "propertyPath": [ "_useBakedAnimation" ], - "value": false + "value": true }, { "__type__": "cc.TargetInfo",