|
|
@@ -1,3 +1,5 @@
|
|
|
+import { RewardType } from "../../game/data/GameData";
|
|
|
+
|
|
|
/**
|
|
|
* @description 获取道具特效
|
|
|
* @author kaka
|
|
|
@@ -15,10 +17,10 @@ export default class FlySystem extends cc.Component {
|
|
|
* @param type 类型 道具id 10001,10002
|
|
|
* @param num 特效数量
|
|
|
* @param pos 起始位置
|
|
|
- * @param endpos 飞行目标的世界坐标 或目标对象路径
|
|
|
+ * @param endpos 飞行目标的世界坐标 或目标对象路径 如果为"",则飞到主界面货币按钮处 默认""
|
|
|
* @param cb 动画结束回调
|
|
|
*/
|
|
|
- public async PlayCoinAnim(type: number = 0, num: number, pos: cc.Vec2, endpos: cc.Vec2 | string, item_cb: Function = null) {
|
|
|
+ public async PlayCoinAnim(type: number = 0, num: number, pos: cc.Vec2, endpos: cc.Vec2 | string = '', item_cb: Function = null) {
|
|
|
for (let i = 0; i < num; i++) {
|
|
|
let copyCoin = await mk.pool.getPrefab('game/prefab/coin');
|
|
|
let url = 'game/texture/coin/' + type;
|
|
|
@@ -56,6 +58,17 @@ export default class FlySystem extends cc.Component {
|
|
|
let end_pos: cc.Vec2 = null;
|
|
|
let end_node: cc.Node = null;
|
|
|
if (typeof end === 'string') {
|
|
|
+ if (end == '') {
|
|
|
+ let url = ''
|
|
|
+ if (type == RewardType.redBag) {
|
|
|
+ url = 'Canvas/界面层/game/node_ui/顶部个人信息/红包币按钮/icon_hb';
|
|
|
+ }
|
|
|
+ else if (type == RewardType.pigRmb) {
|
|
|
+ url = 'Canvas/界面层/game/node_ui/顶部个人信息/金猪币按钮/icon_zb';
|
|
|
+ }
|
|
|
+ end = url;
|
|
|
+ }
|
|
|
+
|
|
|
end_node = cc.find(end as string);
|
|
|
let world_pos = end_node.parent.convertToWorldSpaceAR(end_node.getPosition());
|
|
|
end_pos = this.node.convertToNodeSpaceAR(world_pos);
|