各类弹窗重新设计,使用opps 集成的方式
This commit is contained in:
63
assets/resources/gui/element/item_info.prefab
Normal file
63
assets/resources/gui/element/item_info.prefab
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"__type__": "cc.Prefab",
|
||||||
|
"_name": "item_info",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_native": "",
|
||||||
|
"data": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"optimizationPolicy": 0,
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"persistent": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "item_info",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_parent": null,
|
||||||
|
"_children": [],
|
||||||
|
"_active": true,
|
||||||
|
"_components": [],
|
||||||
|
"_prefab": {
|
||||||
|
"__id__": 2
|
||||||
|
},
|
||||||
|
"_lpos": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_lrot": {
|
||||||
|
"__type__": "cc.Quat",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0,
|
||||||
|
"w": 1
|
||||||
|
},
|
||||||
|
"_lscale": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 1,
|
||||||
|
"y": 1,
|
||||||
|
"z": 1
|
||||||
|
},
|
||||||
|
"_layer": 1073741824,
|
||||||
|
"_euler": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.PrefabInfo",
|
||||||
|
"root": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"__id__": 0
|
||||||
|
},
|
||||||
|
"fileId": "c46/YsCPVOJYA4mWEpNYRx"
|
||||||
|
}
|
||||||
|
]
|
||||||
13
assets/resources/gui/element/item_info.prefab.meta
Normal file
13
assets/resources/gui/element/item_info.prefab.meta
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.1.50",
|
||||||
|
"importer": "prefab",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "9851f9ee-65d3-42c9-8d06-2e1eaf0b8301",
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {
|
||||||
|
"syncNodeName": "item_info"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -945,10 +945,10 @@
|
|||||||
"height": 63,
|
"height": 63,
|
||||||
"rawWidth": 37,
|
"rawWidth": 37,
|
||||||
"rawHeight": 63,
|
"rawHeight": 63,
|
||||||
"borderTop": 0,
|
"borderTop": 42,
|
||||||
"borderBottom": 0,
|
"borderBottom": 17,
|
||||||
"borderLeft": 0,
|
"borderLeft": 17,
|
||||||
"borderRight": 0,
|
"borderRight": 17,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
@@ -10375,10 +10375,10 @@
|
|||||||
"height": 130,
|
"height": 130,
|
||||||
"rawWidth": 65,
|
"rawWidth": 65,
|
||||||
"rawHeight": 130,
|
"rawHeight": 130,
|
||||||
"borderTop": 0,
|
"borderTop": 58,
|
||||||
"borderBottom": 0,
|
"borderBottom": 59,
|
||||||
"borderLeft": 0,
|
"borderLeft": 29,
|
||||||
"borderRight": 0,
|
"borderRight": 28,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
@@ -10605,8 +10605,8 @@
|
|||||||
"height": 63,
|
"height": 63,
|
||||||
"rawWidth": 37,
|
"rawWidth": 37,
|
||||||
"rawHeight": 63,
|
"rawHeight": 63,
|
||||||
"borderTop": 29,
|
"borderTop": 0,
|
||||||
"borderBottom": 30,
|
"borderBottom": 0,
|
||||||
"borderLeft": 16,
|
"borderLeft": 16,
|
||||||
"borderRight": 16,
|
"borderRight": 16,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,6 @@ export enum UIID {
|
|||||||
Netinstable,
|
Netinstable,
|
||||||
/** 角色控制 */
|
/** 角色控制 */
|
||||||
Role_Controller,
|
Role_Controller,
|
||||||
/** 奖励界面 */
|
|
||||||
Rewards,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开界面方式的配置数据 */
|
/** 打开界面方式的配置数据 */
|
||||||
@@ -25,6 +23,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
|
|||||||
[UIID.Loading]: { layer: LayerType.UI, prefab: "loading/prefab/loading", bundle: "resources" },
|
[UIID.Loading]: { layer: LayerType.UI, prefab: "loading/prefab/loading", bundle: "resources" },
|
||||||
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
|
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
|
||||||
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
|
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
|
||||||
[UIID.Rewards]: { layer: LayerType.Dialog, prefab: "gui/rewards" },
|
|
||||||
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
|
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,6 @@ import { HeroViewComp } from "./HeroViewComp";
|
|||||||
import { BoxSet } from "../common/config/BoxSet";
|
import { BoxSet } from "../common/config/BoxSet";
|
||||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||||
import { HeroInfo,MonSet } from "../common/config/heroSet";
|
import { HeroInfo,MonSet } from "../common/config/heroSet";
|
||||||
import { Role } from "../Role/Role";
|
|
||||||
import { MoveToComp } from "../common/ecs/position/MoveTo";
|
import { MoveToComp } from "../common/ecs/position/MoveTo";
|
||||||
import { Talents } from "../common/config/TalentSet";
|
import { Talents } from "../common/config/TalentSet";
|
||||||
import { MonModelComp } from "../mon/MonModelComp";
|
import { MonModelComp } from "../mon/MonModelComp";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
|
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } from "cc";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
@@ -93,6 +93,12 @@ export class CardControllerComp extends CCComp {
|
|||||||
this.node.getChildByName("bar").getChildByName("home_btn").getChildByName("bg").active=false
|
this.node.getChildByName("bar").getChildByName("home_btn").getChildByName("bg").active=false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
item_info_show(){
|
||||||
|
this.node.getChildByName("item_info").setScale(1,1,1)
|
||||||
|
}
|
||||||
|
item_info_hide(){
|
||||||
|
this.node.getChildByName("item_info").setScale(0,0,1)
|
||||||
|
}
|
||||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
reset() {
|
reset() {
|
||||||
this.node.destroy();
|
this.node.destroy();
|
||||||
|
|||||||
29
assets/script/game/map/ItemInfoComp.ts
Normal file
29
assets/script/game/map/ItemInfoComp.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { _decorator } from "cc";
|
||||||
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
|
/** 视图层对象 */
|
||||||
|
@ccclass('ItemInfoComp')
|
||||||
|
@ecs.register('ItemInfo', false)
|
||||||
|
export class ItemInfoComp extends CCComp {
|
||||||
|
/** 视图层逻辑代码分离演示 */
|
||||||
|
start() {
|
||||||
|
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||||
|
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 全局消息逻辑处理 */
|
||||||
|
// private onHandler(event: string, args: any) {
|
||||||
|
// switch (event) {
|
||||||
|
// case ModuleEvent.Cmd:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
reset() {
|
||||||
|
this.node.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
assets/script/game/map/ItemInfoComp.ts.meta
Normal file
9
assets/script/game/map/ItemInfoComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "4.0.23",
|
||||||
|
"importer": "typescript",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "8a98f43a-eefc-40aa-8ab5-b7f25f01eef3",
|
||||||
|
"files": [],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ const { ccclass, property } = _decorator;
|
|||||||
@ccclass('VictoryComp')
|
@ccclass('VictoryComp')
|
||||||
@ecs.register('Victory', false)
|
@ecs.register('Victory', false)
|
||||||
export class VictoryComp extends CCComp {
|
export class VictoryComp extends CCComp {
|
||||||
|
|
||||||
reward_lv:number=1
|
reward_lv:number=1
|
||||||
reward_num:number=2
|
reward_num:number=2
|
||||||
rerawd_item:any={}
|
rerawd_item:any={}
|
||||||
@@ -25,14 +26,14 @@ export class VictoryComp extends CCComp {
|
|||||||
}
|
}
|
||||||
private do_victiry() {
|
private do_victiry() {
|
||||||
if(this.if_show) return
|
if(this.if_show) return
|
||||||
this.node.getChildByName("Node").active = true;
|
this.node.getChildByName("Node").setScale(1,1,1)
|
||||||
this.getReward(true)
|
this.getReward(true)
|
||||||
this.node.getChildByName("Node").getChildByName("defeat").active = false
|
this.node.getChildByName("Node").getChildByName("defeat").active = false
|
||||||
this.node.getChildByName("Node").getChildByName("victory").active = true;
|
this.node.getChildByName("Node").getChildByName("victory").active = true;
|
||||||
}
|
}
|
||||||
private do_defeat() {
|
private do_defeat() {
|
||||||
if(this.if_show) return
|
if(this.if_show) return
|
||||||
this.node.getChildByName("Node").active = true;
|
this.node.getChildByName("Node").setScale(1,1,1)
|
||||||
this.getReward(false)
|
this.getReward(false)
|
||||||
this.node.getChildByName("Node").getChildByName("victory").active = false;
|
this.node.getChildByName("Node").getChildByName("victory").active = false;
|
||||||
this.node.getChildByName("Node").getChildByName("defeat").active = true
|
this.node.getChildByName("Node").getChildByName("defeat").active = true
|
||||||
@@ -53,7 +54,7 @@ export class VictoryComp extends CCComp {
|
|||||||
this.if_show=true
|
this.if_show=true
|
||||||
}
|
}
|
||||||
end_mission(){
|
end_mission(){
|
||||||
this.node.getChildByName("Node").active=false
|
this.node.getChildByName("Node").setScale(0,0,0)
|
||||||
this.if_show=false
|
this.if_show=false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user