mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2024-12-26 03:38:58 +00:00
Xp anim
This commit is contained in:
parent
2105682fd9
commit
54167ec528
@ -342,6 +342,9 @@
|
|||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 17
|
"__id__": 17
|
||||||
},
|
},
|
||||||
|
"animation": {
|
||||||
|
"__id__": 18
|
||||||
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user