去掉了item+ 小强化 动画
This commit is contained in:
1135
assets/resources/game/gui/lcard.prefab
Normal file
1135
assets/resources/game/gui/lcard.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,12 @@
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "d339f36c-b865-4989-8f32-cea0584275f2",
|
||||
"uuid": "0cb93380-70e6-4188-a773-764e6ee6e2ad",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "item_info"
|
||||
"syncNodeName": "lcard"
|
||||
}
|
||||
}
|
||||
258
assets/resources/gui/anim/luckcard.anim
Normal file
258
assets/resources/gui/anim/luckcard.anim
Normal file
@@ -0,0 +1,258 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.AnimationClip",
|
||||
"_name": "luckcard",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {
|
||||
"embeddedPlayerGroups": []
|
||||
},
|
||||
"_native": "",
|
||||
"sample": 24,
|
||||
"speed": 1,
|
||||
"wrapMode": 1,
|
||||
"enableTrsBlending": false,
|
||||
"_duration": 0.5,
|
||||
"_hash": 500763545,
|
||||
"_tracks": [
|
||||
{
|
||||
"__id__": 1
|
||||
}
|
||||
],
|
||||
"_exoticAnimation": null,
|
||||
"_events": [],
|
||||
"_embeddedPlayers": [],
|
||||
"_additiveSettings": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_auxiliaryCurveEntries": []
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.VectorTrack",
|
||||
"_binding": {
|
||||
"__type__": "cc.animation.TrackBinding",
|
||||
"path": {
|
||||
"__id__": 2
|
||||
},
|
||||
"proxy": null
|
||||
},
|
||||
"_channels": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
},
|
||||
{
|
||||
"__id__": 9
|
||||
}
|
||||
],
|
||||
"_nComponents": 3
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.TrackPath",
|
||||
"_paths": [
|
||||
"eulerAngles"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.3333333432674408,
|
||||
0.5
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.3333333432674408,
|
||||
0.5
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.3333333432674408,
|
||||
0.5
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 270,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 360,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": {
|
||||
"tangentMode": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [],
|
||||
"_values": [],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AnimationClipAdditiveSettings",
|
||||
"enabled": false,
|
||||
"refClip": null
|
||||
}
|
||||
]
|
||||
13
assets/resources/gui/anim/luckcard.anim.meta
Normal file
13
assets/resources/gui/anim/luckcard.anim.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "2.0.3",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "846a3928-d2e7-413a-b9db-b67b2bc4c2a5",
|
||||
"files": [
|
||||
".cconb"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"name": "luckcard"
|
||||
}
|
||||
}
|
||||
235
assets/resources/gui/anim/luckcardend.anim
Normal file
235
assets/resources/gui/anim/luckcardend.anim
Normal file
@@ -0,0 +1,235 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.AnimationClip",
|
||||
"_name": "luckcardend",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {
|
||||
"embeddedPlayerGroups": []
|
||||
},
|
||||
"_native": "",
|
||||
"sample": 20,
|
||||
"speed": 1,
|
||||
"wrapMode": 1,
|
||||
"enableTrsBlending": false,
|
||||
"_duration": 0.15,
|
||||
"_hash": 500763545,
|
||||
"_tracks": [
|
||||
{
|
||||
"__id__": 1
|
||||
}
|
||||
],
|
||||
"_exoticAnimation": null,
|
||||
"_events": [],
|
||||
"_embeddedPlayers": [],
|
||||
"_additiveSettings": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_auxiliaryCurveEntries": []
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.ColorTrack",
|
||||
"_binding": {
|
||||
"__type__": "cc.animation.TrackBinding",
|
||||
"path": {
|
||||
"__id__": 2
|
||||
},
|
||||
"proxy": null
|
||||
},
|
||||
"_channels": [
|
||||
{
|
||||
"__id__": 4
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.TrackPath",
|
||||
"_paths": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
"color"
|
||||
]
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.ComponentPath",
|
||||
"component": "cc.Sprite"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.15
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.15
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 9
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.15
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.animation.Channel",
|
||||
"_curve": {
|
||||
"__id__": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.15
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 255,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.RealKeyframeValue",
|
||||
"interpolationMode": 0,
|
||||
"tangentWeightMode": 0,
|
||||
"value": 0,
|
||||
"rightTangent": 0,
|
||||
"rightTangentWeight": 1,
|
||||
"leftTangent": 0,
|
||||
"leftTangentWeight": 1,
|
||||
"easingMethod": 0,
|
||||
"__editorExtras__": null
|
||||
}
|
||||
],
|
||||
"preExtrapolation": 1,
|
||||
"postExtrapolation": 1
|
||||
},
|
||||
{
|
||||
"__type__": "cc.AnimationClipAdditiveSettings",
|
||||
"enabled": false,
|
||||
"refClip": null
|
||||
}
|
||||
]
|
||||
13
assets/resources/gui/anim/luckcardend.anim.meta
Normal file
13
assets/resources/gui/anim/luckcardend.anim.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "2.0.3",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "f39cb03e-911b-432f-9cbe-c072adb946f4",
|
||||
"files": [
|
||||
".cconb"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"name": "luckcardend"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,10 +16,6 @@ export enum UIID {
|
||||
Netinstable,
|
||||
/** 角色控制 */
|
||||
Role_Controller,
|
||||
/**物品 */
|
||||
ItemInfo,
|
||||
/**物品 */
|
||||
Victory,
|
||||
// /** 提示窗 */
|
||||
// Toast,
|
||||
}
|
||||
@@ -30,7 +26,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
|
||||
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
|
||||
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
|
||||
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
|
||||
[UIID.ItemInfo]: { layer: LayerType.Dialog, prefab: "gui/element/item_info" },
|
||||
[UIID.Victory]: { layer: LayerType.Dialog, prefab: "gui/element/victory" },
|
||||
// [UIID.Toast]: { layer: LayerType.PopUp, prefab: "common/prefab/toast" },
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import { instantiate, Label, Prefab, resources, Sprite, SpriteAtlas, Vec3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
import { Items } from "../common/config/Items";
|
||||
|
||||
/** Item 模块 */
|
||||
@ecs.register(`Item`)
|
||||
export class Item extends ecs.Entity {
|
||||
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
load(uuid:number=1001,num:number=0,praent:any=null) {
|
||||
var path = "game/gui/item";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
|
||||
node.parent = praent
|
||||
let iv = node.getComponent(ItemComp)!;
|
||||
iv.i_uuid = uuid
|
||||
iv.num=num
|
||||
iv.update_data(uuid,num)
|
||||
this.add(iv)
|
||||
}
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Item 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6d44969e-0c5d-4ef2-8919-e9c18b012dec",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
import { _decorator, CCInteger, Label, resources, Sprite, SpriteAtlas } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('ItemComp')
|
||||
@ecs.register('ItemComp', false)
|
||||
export class ItemComp extends CCComp {
|
||||
i_uuid:number = 0;
|
||||
num:number = 0;
|
||||
start() {
|
||||
//todo 设定icon 显示
|
||||
}
|
||||
|
||||
update_data(uuid:number,num:number=0){
|
||||
this.i_uuid=uuid;
|
||||
this.num=num;
|
||||
this.node.getChildByName("num").getComponent(Label).string = num.toString();
|
||||
if(num==0){
|
||||
this.node.getChildByName("num").getComponent(Label).string ="";
|
||||
}
|
||||
let url = "gui/items";
|
||||
let pathName= Items[uuid].path;
|
||||
this.node.getChildByName("lv1").active = Items[uuid].lv==1;
|
||||
this.node.getChildByName("lv2").active = Items[uuid].lv==2;
|
||||
this.node.getChildByName("lv3").active = Items[uuid].lv==3;
|
||||
this.node.getChildByName("lv4").active = Items[uuid].lv==4;
|
||||
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
});
|
||||
}
|
||||
show_info(){
|
||||
if(this.node.parent.name=="item_info") return
|
||||
oops.gui.open(UIID.ItemInfo, {uuid:this.i_uuid,type:0});
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
import { EventTouch, Label, Node,Sprite,SpriteAtlas,_decorator, resources } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { Hero } from "../hero/Hero";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('ItemInfoComp')
|
||||
@ecs.register('ItemInfo', false)
|
||||
export class ItemInfoComp extends CCComp {
|
||||
onAdded(args: any) {
|
||||
this.node.setSiblingIndex(100);
|
||||
this.node.getChildByName("item").active = false;
|
||||
this.node.getChildByName("skill").active = false;
|
||||
this.node.getChildByName("hero").active = false;
|
||||
if(args.type==0){
|
||||
this.node.getChildByName("item").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=Items[args.uuid].name
|
||||
this.node.getChildByName("info").getComponent(Label).string=Items[args.uuid].info
|
||||
|
||||
let itemcom = this.node.getChildByName("item").getComponent(ItemComp);
|
||||
itemcom.update_data(args.uuid,args.num);
|
||||
}
|
||||
if(args.type==1){ //技能碎片
|
||||
this.node.getChildByName("skill").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=SkillSet[args.uuid].name+" 碎片"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+SkillSet[args.uuid].name+"」碎片,用于技能升阶"
|
||||
var icon_path = "game/heros/cards"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("skill").getChildByName("skill").getChildByName("icon").getComponent(Sprite);
|
||||
// console.log("update_data",atlas,sprite)
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[args.uuid].path);
|
||||
});
|
||||
|
||||
}
|
||||
if(args.type==2){ //英雄碎片
|
||||
this.node.getChildByName("hero").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=HeroInfo[args.uuid].name+" 碎片"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于强化英雄,怪物掉落和开宝箱抽卡获得"
|
||||
let HChip=this.node.getChildByName("hero").getComponent(HChipComp);
|
||||
HChip.update_data(args.uuid)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private onTouchEnd(event: EventTouch) {
|
||||
switch (event.target.name) {
|
||||
case "btn":
|
||||
this.reset();
|
||||
break;
|
||||
}
|
||||
|
||||
event.propagationStopped = true;
|
||||
}
|
||||
|
||||
reset() {
|
||||
oops.gui.remove(UIID.ItemInfo, false);
|
||||
|
||||
// // 注:模拟二次删除清理缓存
|
||||
// setTimeout(() => {
|
||||
// oops.gui.remove(UIID.ItemInfo);
|
||||
// }, 100);
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
console.log("释放角色信息界面");
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8a98f43a-eefc-40aa-8ab5-b7f25f01eef3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
32
assets/script/game/map/LuckCardComp.ts
Normal file
32
assets/script/game/map/LuckCardComp.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { _decorator, Animation, Component, Node, tween, v3 } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('LuckCardComp')
|
||||
export class LuckCardComp extends Component {
|
||||
timer:number=3;
|
||||
start() {
|
||||
this.timer=2
|
||||
console.log("[LuckCardComp]:start")
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
this.timer-=deltaTime
|
||||
if(this.timer<=0){
|
||||
let anim=this.node.getComponent(Animation)
|
||||
if(anim) anim.play("luckcardend")
|
||||
this.do_destroy()
|
||||
this.timer=2
|
||||
}
|
||||
}
|
||||
do_destroy(){
|
||||
tween(this.node)
|
||||
.to(0.2, {
|
||||
scale: v3(2,2,0),
|
||||
}, {onComplete:()=>{
|
||||
this.node.destroy()
|
||||
}})
|
||||
.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b3d7b41f-5185-4a0a-b690-897800e264ef",
|
||||
"uuid": "598155fc-f31b-4496-b1e4-82219435f425",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3, Vec3,Animation, UI } from "cc";
|
||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3, Vec3,Animation, UI, instantiate, Prefab } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -293,15 +293,23 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
call_func_card(){
|
||||
let mission_data=smc.vmdata.mission_data
|
||||
if(mission_data.gold < (mission_data.refresh_gold+mission_data.buff_refresh_gold)){
|
||||
oops.gui.toast("金币不足", false);
|
||||
return
|
||||
}
|
||||
oops.message.dispatchEvent(GameEvent.FuncSelect)
|
||||
mission_data.gold-=(mission_data.refresh_gold+mission_data.buff_refresh_gold)
|
||||
this.show_lucky_gold()
|
||||
|
||||
}
|
||||
show_lucky_gold(){
|
||||
var path = "game/gui/lcard";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.setScale(0,0,0)
|
||||
node.parent = this.node
|
||||
node.setPosition(v3(this.node.getChildByName("luckybox").position.x,this.node.getChildByName("luckybox").position.y));
|
||||
|
||||
tween(node) .to(0.5, {
|
||||
scale: v3(1,1,1),
|
||||
position: v3(0,this.node.getChildByName("luckybox").position.y+200),
|
||||
}, {easing:"backOut"})
|
||||
.start();
|
||||
}
|
||||
private cleanComponents() {
|
||||
ecs.query(ecs.allOf(HeroViewComp)).forEach(entity => {entity.remove(HeroViewComp);entity.destroy()});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user