diff --git a/assets/Media/Prefabs/Game/Drops/XP.prefab b/assets/Media/Prefabs/Game/Drops/XP.prefab index a7ad47f..070f4b9 100644 --- a/assets/Media/Prefabs/Game/Drops/XP.prefab +++ b/assets/Media/Prefabs/Game/Drops/XP.prefab @@ -342,6 +342,9 @@ "__prefab": { "__id__": 17 }, + "animation": { + "__id__": 18 + }, "_id": "" }, { diff --git a/assets/Scripts/Game/XP/XP.ts b/assets/Scripts/Game/XP/XP.ts index b4b5078..91e5d7b 100644 --- a/assets/Scripts/Game/XP/XP.ts +++ b/assets/Scripts/Game/XP/XP.ts @@ -1,10 +1,12 @@ -import { Component, Vec3, _decorator } from "cc"; +import { Animation, Component, Vec3, _decorator } from "cc"; import { ISignal } from "../../Services/EventSystem/ISignal"; import { Signal } from "../../Services/EventSystem/Signal"; const { ccclass, property } = _decorator; @ccclass("XP") export class XP extends Component { + @property(Animation) private animation: Animation; + private pickUpEvent: Signal = new Signal(); private value = 2; @@ -12,6 +14,7 @@ export class XP extends Component { this.node.setWorldPosition(position); this.value = value; this.node.active = true; + this.animation.play("DropStart"); } public get Value(): number {