This commit is contained in:
Martin 2022-12-20 10:05:43 +01:00
parent 2105682fd9
commit 54167ec528
2 changed files with 7 additions and 1 deletions

View File

@ -342,6 +342,9 @@
"__prefab": { "__prefab": {
"__id__": 17 "__id__": 17
}, },
"animation": {
"__id__": 18
},
"_id": "" "_id": ""
}, },
{ {

View File

@ -1,10 +1,12 @@
import { Component, Vec3, _decorator } from "cc"; import { Animation, Component, Vec3, _decorator } from "cc";
import { ISignal } from "../../Services/EventSystem/ISignal"; import { ISignal } from "../../Services/EventSystem/ISignal";
import { Signal } from "../../Services/EventSystem/Signal"; import { Signal } from "../../Services/EventSystem/Signal";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass("XP") @ccclass("XP")
export class XP extends Component { export class XP extends Component {
@property(Animation) private animation: Animation;
private pickUpEvent: Signal<XP> = new Signal<XP>(); private pickUpEvent: Signal<XP> = new Signal<XP>();
private value = 2; private value = 2;
@ -12,6 +14,7 @@ export class XP extends Component {
this.node.setWorldPosition(position); this.node.setWorldPosition(position);
this.value = value; this.value = value;
this.node.active = true; this.node.active = true;
this.animation.play("DropStart");
} }
public get Value(): number { public get Value(): number {