Compare commits
No commits in common. "bc32d687eeee4ba09bff84b034a6613f83066982" and "82192ff6646d386fe70231fe0606a22f7495696c" have entirely different histories.
bc32d687ee
...
82192ff664
|
|
@ -23,5 +23,3 @@ node_modules/
|
||||||
# WebStorm
|
# WebStorm
|
||||||
#//////////////////////////
|
#//////////////////////////
|
||||||
.idea/
|
.idea/
|
||||||
assets/ImagePack/!幻想模拟战.NPK
|
|
||||||
assets/ImagePack/!幻想模拟战.NPK.meta
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
/*
|
import { _decorator, Component, Node } from 'cc';
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-11 12:16:36
|
|
||||||
* @LastEditTime: 2024-03-26 15:40:23
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import { _decorator, Node } from 'cc';
|
|
||||||
import { ScriptMyAnimation } from './ScriptMyAnimation';
|
import { ScriptMyAnimation } from './ScriptMyAnimation';
|
||||||
const { ccclass } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@ccclass('AnimationNode')
|
@ccclass('AnimationNode')
|
||||||
export class AnimationNode extends Node{
|
export class AnimationNode extends Node{
|
||||||
|
|
|
||||||
|
|
@ -53,32 +53,6 @@ export class BaseButton extends Component {
|
||||||
//按钮状态
|
//按钮状态
|
||||||
ButtonState = BaseButtonState.Normal; // 0 普通 1悬停 2按下 8失效
|
ButtonState = BaseButtonState.Normal; // 0 普通 1悬停 2按下 8失效
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: BaseButton初始化设置
|
|
||||||
* @param {string} ImgPath: npk中的路径
|
|
||||||
* @param {number} NormalIndex: 普通 在npk.img 中的idnex 其他状态自动+1
|
|
||||||
*/
|
|
||||||
init(ImgPath:string,NormalIndex:number): void;
|
|
||||||
init(ImgPath:string,NormalIndex:number,HoverIndex:number,PressIndex:number,DisableIndex:number,auto:boolean): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: BaseButton初始化设置
|
|
||||||
* @param {string} ImgPath: npk中的路径
|
|
||||||
* @param {number} NormalIndex: 普通 在npk.img 中的idnex
|
|
||||||
* @param {number} HoverIndex: 悬停
|
|
||||||
* @param {number} PressIndex 按下
|
|
||||||
* @param {number} DisableIndex 失效
|
|
||||||
* @param {number} Disable 是否启用失效状态
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
init(ImgPath:string,NormalIndex:number,HoverIndex?:number,PressIndex?:number,DisableIndex?:number,Disable:boolean = true): void{
|
|
||||||
this.ImgPath = ImgPath;
|
|
||||||
this.NormalImgIndex = NormalIndex;
|
|
||||||
this.HoverImgIndex = HoverIndex ? HoverIndex : NormalIndex + 1;
|
|
||||||
this.PressImgIndex = PressIndex ? PressIndex : NormalIndex + 2;
|
|
||||||
if (Disable){ this.DisableImgIndex = DisableIndex ? DisableIndex : NormalIndex + 3; }
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
|
||||||
//判断是否有精灵 如果没有 就给他搞一个
|
//判断是否有精灵 如果没有 就给他搞一个
|
||||||
|
|
@ -146,7 +120,6 @@ export class BaseButton extends Component {
|
||||||
}
|
}
|
||||||
OnHever(event) {
|
OnHever(event) {
|
||||||
if (this.ButtonState == BaseButtonState.Disable) return;
|
if (this.ButtonState == BaseButtonState.Disable) return;
|
||||||
this.ButtonState = BaseButtonState.Hover;
|
|
||||||
}
|
}
|
||||||
OnEnd(event: EventMouse) {
|
OnEnd(event: EventMouse) {
|
||||||
if (this.ButtonState == BaseButtonState.Disable) return;
|
if (this.ButtonState == BaseButtonState.Disable) return;
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-23 13:22:27
|
|
||||||
* @LastEditTime: 2024-03-24 16:04:20
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: node坐标控制
|
|
||||||
*/
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Color,
|
|
||||||
Component,
|
|
||||||
EditBox,
|
|
||||||
Font,
|
|
||||||
HorizontalTextAlignment,
|
|
||||||
Node,
|
|
||||||
Size,
|
|
||||||
Sprite,
|
|
||||||
UITransform,
|
|
||||||
v2,
|
|
||||||
VerticalTextAlignment,
|
|
||||||
} from "cc";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("LocationImportComponent")
|
|
||||||
/**
|
|
||||||
* @description: node坐标控制
|
|
||||||
*/
|
|
||||||
export class LocationImportComponent extends Component {
|
|
||||||
editBox: EditBox;
|
|
||||||
|
|
||||||
onLoad(): void {
|
|
||||||
const node = new Node();
|
|
||||||
node.setPosition(0, 30);
|
|
||||||
|
|
||||||
const uit = node.addComponent(UITransform);
|
|
||||||
uit.anchorPoint = v2(0, 1);
|
|
||||||
uit.setContentSize(new Size(150, 30));
|
|
||||||
|
|
||||||
const sp = node.addComponent(Sprite);
|
|
||||||
sp.color = Color.WHITE;
|
|
||||||
|
|
||||||
const editBox = node.addComponent(EditBox);
|
|
||||||
editBox.inputMode = EditBox.InputMode.SINGLE_LINE;
|
|
||||||
this.editBox = editBox;
|
|
||||||
|
|
||||||
this.node.addChild(node);
|
|
||||||
|
|
||||||
//* 修改 node 的坐标
|
|
||||||
editBox.node.on("editing-did-ended", (text: EditBox) => {
|
|
||||||
const los = text.textLabel.string.split(',');
|
|
||||||
this.node.setPosition(Number(los[0]),Number(los[1]));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
const placeholderLabel = this.editBox.placeholderLabel;
|
|
||||||
placeholderLabel.string = "坐标";
|
|
||||||
placeholderLabel.horizontalAlign = HorizontalTextAlignment.LEFT;
|
|
||||||
placeholderLabel.verticalAlign = VerticalTextAlignment.TOP;
|
|
||||||
placeholderLabel.fontSize = 20;
|
|
||||||
placeholderLabel.color = Color.RED;
|
|
||||||
placeholderLabel.node.setPosition(0, 50);
|
|
||||||
placeholderLabel.node.getComponent(UITransform).anchorPoint = v2(0, 2);
|
|
||||||
|
|
||||||
const textLabel = this.editBox.textLabel;
|
|
||||||
textLabel.horizontalAlign = HorizontalTextAlignment.LEFT;
|
|
||||||
textLabel.verticalAlign = VerticalTextAlignment.TOP;
|
|
||||||
textLabel.fontSize = 20;
|
|
||||||
textLabel.color = Color.RED;
|
|
||||||
textLabel.node.setPosition(0, 50);
|
|
||||||
textLabel.node.getComponent(UITransform).anchorPoint = v2(0, 2);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "08408ae9-019a-4902-9bc2-002e2e663cb6",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-24 16:09:55
|
|
||||||
* @LastEditTime: 2024-03-24 16:30:46
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 通过边框显示node的位置和大小,默认锚点(0,1)
|
|
||||||
*/
|
|
||||||
import { _decorator, Color, Component, Graphics, Node, UITransform } from 'cc';
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass('ShowNodeBorder')
|
|
||||||
/**
|
|
||||||
* @description: 通过边框显示node的位置和大小,默认锚点(0,1)
|
|
||||||
*/
|
|
||||||
export class ShowNodeBorder extends Component {
|
|
||||||
|
|
||||||
graphics: Graphics;
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
if(this.node.getComponent(Graphics)){
|
|
||||||
this.graphics = this.node.getComponent(Graphics);
|
|
||||||
}else{
|
|
||||||
this.graphics = this.node.addComponent(Graphics);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateBorder();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateBorder() {
|
|
||||||
const borderColor = Color.YELLOW;
|
|
||||||
const borderWidth = 4;
|
|
||||||
|
|
||||||
const contentSize = this.node.getComponent(UITransform).contentSize;
|
|
||||||
|
|
||||||
this.graphics.clear();
|
|
||||||
this.graphics.strokeColor = borderColor;
|
|
||||||
this.graphics.lineWidth = borderWidth;
|
|
||||||
// this.graphics.rect(-contentSize.width / 2, -contentSize.height / 2, contentSize.width, contentSize.height);// 锚点 (0,0)
|
|
||||||
this.graphics.rect(0, 0, contentSize.width, -contentSize.height); //锚点 (0,1)
|
|
||||||
this.graphics.stroke();
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "9ef9c0ff-8d63-448d-b95f-89b02e1455f3",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -21,18 +21,18 @@ export class GameState extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 当前是否处于暂停状态 */
|
//当前是否处于暂停状态
|
||||||
PauseState: boolean = false;
|
PauseState: boolean = false;
|
||||||
/** 改变暂停状态的回调函数 */
|
//改变暂停状态的回调函数
|
||||||
ResumeCallBackFunc: ResumeCallback<any>[] = [];
|
ResumeCallBackFunc: ResumeCallback<any>[] = [];
|
||||||
|
|
||||||
|
|
||||||
/** 获取暂停状态 */
|
//获取暂停状态
|
||||||
IsPauseState(): boolean {
|
IsPauseState(): boolean {
|
||||||
return this.PauseState;
|
return this.PauseState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置暂停状态 */
|
//设置暂停状态
|
||||||
SetCurrentPauseState(State: boolean) {
|
SetCurrentPauseState(State: boolean) {
|
||||||
//不等于时 设置一次
|
//不等于时 设置一次
|
||||||
if (State != this.PauseState) {
|
if (State != this.PauseState) {
|
||||||
|
|
@ -45,7 +45,7 @@ export class GameState extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 注册恢复游戏的逻辑回调函数 */
|
//注册恢复游戏的逻辑回调函数
|
||||||
RegisterResumeCallBack(Func: ResumeCallback<any>) {
|
RegisterResumeCallBack(Func: ResumeCallback<any>) {
|
||||||
this.ResumeCallBackFunc.push(Func);
|
this.ResumeCallBackFunc.push(Func);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2,7 +2,7 @@
|
||||||
"ver": "1.0.3",
|
"ver": "1.0.3",
|
||||||
"importer": "buffer",
|
"importer": "buffer",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "6aba7d31-7435-4f59-b5aa-79256df4ede9",
|
"uuid": "dc61d9f4-8a5e-4540-8a2c-dc318bb9f198",
|
||||||
"files": [
|
"files": [
|
||||||
".bin",
|
".bin",
|
||||||
".json"
|
".json"
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,34 @@
|
||||||
/*
|
import { _decorator, Component, Node } from 'cc';
|
||||||
* @Author: WoNiu
|
import { MapTileTypes } from './MapTile/MapTileData';
|
||||||
* @Date: 2024-03-16 15:26:27
|
import { MapTileNode } from './MapTile/MapTileNode';
|
||||||
* @LastEditTime: 2024-03-28 21:13:04
|
const { ccclass, property } = _decorator;
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 最底层的地图 图层Component
|
|
||||||
*/
|
|
||||||
import { _decorator, Component, Node } from "cc";
|
|
||||||
import { MapTileType, MapTileTypes } from "./MapTile/MapTileType";
|
|
||||||
import { MapTileNode } from "./MapTile/MapTileNode";
|
|
||||||
const { ccclass } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("BoardRoot")
|
/// 最底层的地图 图层Component
|
||||||
/**
|
@ccclass('BoardRoot')
|
||||||
* @description: 最底层的地图 图层Component
|
|
||||||
*/
|
|
||||||
export class BoardRoot extends Component {
|
export class BoardRoot extends Component {
|
||||||
|
|
||||||
//* 地块nodeMap
|
|
||||||
mapNodeMap: Map<MapTileType, Node> = new Map<MapTileType, Node>();
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
this.initMapTile();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 初始化 地图快
|
/// 初始化 地图快
|
||||||
initMapTile() {
|
initMapTile(){
|
||||||
|
|
||||||
// 从枚举类型 添加所有地块
|
// 从枚举类型 添加所有地块
|
||||||
MapTileTypes.forEach((type) => {
|
MapTileTypes.forEach((type) => {
|
||||||
const node = new MapTileNode(type);
|
const node = new MapTileNode(type);
|
||||||
this.node.addChild(node);
|
this.node.addChild(node);
|
||||||
this.mapNodeMap.set(type, node);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
update(deltaTime: number) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { _decorator, Component, Node } from 'cc';
|
||||||
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
|
@ccclass('DialogRoot')
|
||||||
|
export class DialogRoot extends Component {
|
||||||
|
start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
update(deltaTime: number) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,209 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-22 19:50:30
|
|
||||||
* @LastEditTime: 2024-03-24 17:09:16
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 选择卡片节点
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
EventMouse,
|
|
||||||
Node,
|
|
||||||
Sprite,
|
|
||||||
SpriteFrame,
|
|
||||||
UITransform,
|
|
||||||
v2,
|
|
||||||
tween,
|
|
||||||
Component,
|
|
||||||
Label,
|
|
||||||
Color,
|
|
||||||
Size,
|
|
||||||
v3,
|
|
||||||
} from "cc";
|
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
|
||||||
import { BaseSpriteFrame } from "../../GlobalScript/CommonComponent/BaseSpriteFrame";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("CardNode")
|
|
||||||
export class CardNode extends Node {
|
|
||||||
//普通精灵帧
|
|
||||||
private NormalSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
// 高亮精灵帧1
|
|
||||||
private oneSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
//高亮精灵帧2
|
|
||||||
private twoSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
// 翻转动画
|
|
||||||
flipsAnimation:CardFlipsAnimation;
|
|
||||||
|
|
||||||
//精灵对象
|
|
||||||
private SpriteObj: Sprite;
|
|
||||||
|
|
||||||
// 是否按钮失效
|
|
||||||
Disable = false;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
const trf = this.addComponent(UITransform);
|
|
||||||
trf.anchorPoint = v2(0.5, 1)
|
|
||||||
trf.contentSize = new Size(178,113);
|
|
||||||
|
|
||||||
this.flipsAnimation = this.addComponent(CardFlipsAnimation);
|
|
||||||
|
|
||||||
this.initBackgroundNode();
|
|
||||||
this.initSpriteFrame();
|
|
||||||
this.initEvent();
|
|
||||||
}
|
|
||||||
|
|
||||||
initBackgroundNode(){
|
|
||||||
// const node = new Node();
|
|
||||||
// this.addChild(node);
|
|
||||||
|
|
||||||
// const trf = node.addComponent(UITransform);
|
|
||||||
// trf.contentSize = new Size(178,113);
|
|
||||||
// trf.anchorPoint = v2(0,1);
|
|
||||||
|
|
||||||
// this.SpriteObj = node.addComponent(Sprite);
|
|
||||||
this.SpriteObj = this.addComponent(Sprite);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
initSpriteFrame() {
|
|
||||||
/// 不同亮度的卡片
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 47, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.NormalSpriteFrame = SpriteFrame;
|
|
||||||
this.SpriteObj.spriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 48, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.oneSpriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 49, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.twoSpriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
initEvent() {
|
|
||||||
this.on(Node.EventType.MOUSE_ENTER, this.OnHever, this);
|
|
||||||
this.on(Node.EventType.MOUSE_LEAVE, this.OffHever, this);
|
|
||||||
this.on(Node.EventType.MOUSE_DOWN, this.OnDown, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
OffHever() {
|
|
||||||
if (this.Disable) return;
|
|
||||||
this.SpriteObj.spriteFrame = this.NormalSpriteFrame;
|
|
||||||
}
|
|
||||||
OnHever() {
|
|
||||||
if (this.Disable) return;
|
|
||||||
this.SpriteObj.spriteFrame = this.oneSpriteFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnDown(event: EventMouse) {
|
|
||||||
//必须是鼠标左键
|
|
||||||
if (event.getButton() != EventMouse.BUTTON_LEFT || this.Disable) return;
|
|
||||||
this.SpriteObj.spriteFrame = this.twoSpriteFrame;
|
|
||||||
this.Disable = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 卡片的翻转动画
|
|
||||||
*/
|
|
||||||
export class CardFlipsAnimation extends Component {
|
|
||||||
// 数字1精灵帧
|
|
||||||
oneSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
//数字2精灵帧
|
|
||||||
twoSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
//数字2精灵帧
|
|
||||||
threeSpriteFrame: SpriteFrame;
|
|
||||||
|
|
||||||
// 数字
|
|
||||||
value: number;
|
|
||||||
|
|
||||||
// 单次缓动时间
|
|
||||||
tweenTime: number = 0.5;
|
|
||||||
|
|
||||||
// 玩家名称
|
|
||||||
nameNode: Node;
|
|
||||||
|
|
||||||
scale = {x:1};
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
/// 数字卡片
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 50, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.oneSpriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 51, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.twoSpriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
new BaseSpriteFrame(NpkImage.ingame, 52, (SpriteFrame: SpriteFrame) => {
|
|
||||||
this.threeSpriteFrame = SpriteFrame;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// this.nameLabel = this.node.addComponent(Label);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 翻转动画
|
|
||||||
* @param {1} value: 这个卡牌反转后是几
|
|
||||||
*/
|
|
||||||
animationStart(value: number,name:string) {
|
|
||||||
this.value = value;
|
|
||||||
if (value > 2) this.value = 2;
|
|
||||||
|
|
||||||
this.initNmaeNode(name);
|
|
||||||
|
|
||||||
tween(this.scale).to(this.tweenTime, { x: 0,},{onComplete:()=>{
|
|
||||||
this.flipsTweenBack();
|
|
||||||
},onUpdate:()=>{
|
|
||||||
this.node.scale = v3(this.scale.x,1,1);
|
|
||||||
},easing:'linear'}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
flipsTweenBack(){
|
|
||||||
const spriteFrames = [this.oneSpriteFrame,this.twoSpriteFrame,this.threeSpriteFrame];
|
|
||||||
this.node.getComponent(Sprite).spriteFrame = spriteFrames[this.value];
|
|
||||||
this.nameNode.active = true;
|
|
||||||
|
|
||||||
tween(this.scale).to(this.tweenTime, { x: 1,},{onUpdate:()=>{
|
|
||||||
this.node.scale = v3(this.scale.x,1,1);
|
|
||||||
},easing:'linear'}).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
initNmaeNode(name:string){
|
|
||||||
const nameNode = new Node('label');
|
|
||||||
this.node.addChild(nameNode);
|
|
||||||
this.nameNode = nameNode;
|
|
||||||
|
|
||||||
nameNode.active = false;
|
|
||||||
nameNode.setPosition(0,-75);
|
|
||||||
|
|
||||||
const trf = nameNode.addComponent(UITransform);
|
|
||||||
trf.anchorPoint = v2(0.5,1);
|
|
||||||
trf.contentSize = new Size(178,20);
|
|
||||||
|
|
||||||
const label = nameNode.addComponent(Label);
|
|
||||||
label.overflow = Label.Overflow.CLAMP;
|
|
||||||
label.string = name;
|
|
||||||
label.fontSize = 15;
|
|
||||||
label.color = Color.RED;
|
|
||||||
label.horizontalAlign = Label.HorizontalAlign.CENTER;
|
|
||||||
label.verticalAlign = Label.VerticalAlign.CENTER;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
update(dt: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "d249ab2c-fe35-459a-915d-a40a053488e2",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-19 17:44:59
|
|
||||||
* @LastEditTime: 2024-03-29 14:00:11
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 弹窗
|
|
||||||
*/
|
|
||||||
import { _decorator, Component } from "cc";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("DialogRoot")
|
|
||||||
/**
|
|
||||||
* @description: 弹窗
|
|
||||||
*/
|
|
||||||
export class DialogRoot extends Component {
|
|
||||||
|
|
||||||
|
|
||||||
start() {}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-26 11:44:58
|
|
||||||
* @LastEditTime: 2024-03-29 14:02:43
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 幸运硬币效果类型
|
|
||||||
*/
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Sprite,
|
|
||||||
Director,
|
|
||||||
director,
|
|
||||||
Node,
|
|
||||||
tween,
|
|
||||||
UITransform,
|
|
||||||
v2,
|
|
||||||
Color,
|
|
||||||
} from "cc";
|
|
||||||
import { AnimationNode } from "../../GlobalScript/Animation/AnimationNode";
|
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
|
||||||
import { CloseButtonNode } from "../Common/CloseButtonNode";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 幸运硬币效果类型
|
|
||||||
*/
|
|
||||||
export enum LuckyType {
|
|
||||||
/** 前进三格 */
|
|
||||||
GoThree = 0,
|
|
||||||
/** 移动到月光酒馆 */
|
|
||||||
YeGuangJiuGuan,
|
|
||||||
/** 移动到决斗场 */
|
|
||||||
JueDouChang,
|
|
||||||
/** 移动到海上列车 */
|
|
||||||
HaiShangLieChe,
|
|
||||||
/** 我要双倍,点数x2 */
|
|
||||||
Double,
|
|
||||||
/** 这是我的钱,点数减半 */
|
|
||||||
Halve,
|
|
||||||
/** 骑士马战 ,点数+2w */
|
|
||||||
HorseCombat,
|
|
||||||
/** 装备修理, 点数-2w */
|
|
||||||
Servicing,
|
|
||||||
/** 收取费用,夺取其他人 2w 点数 */
|
|
||||||
Charge,
|
|
||||||
}
|
|
||||||
|
|
||||||
@ccclass("LuckyCoinsNode")
|
|
||||||
export class LuckyCoinsNode extends Node {
|
|
||||||
luckyType: LuckyType;
|
|
||||||
|
|
||||||
/** 幸运硬币的结果节点 */
|
|
||||||
resultNode: Node;
|
|
||||||
|
|
||||||
/** 动画完成回调 */
|
|
||||||
aniDoneBack: Function;
|
|
||||||
|
|
||||||
constructor(type: LuckyType,aniDone:Function) {
|
|
||||||
super();
|
|
||||||
this.luckyType = type;
|
|
||||||
this.aniDoneBack = aniDone;
|
|
||||||
|
|
||||||
this.addComponent(UITransform).anchorPoint = v2(0, 1);
|
|
||||||
|
|
||||||
this.initResultNode();
|
|
||||||
this.initLuckyAni();
|
|
||||||
this.delayShowResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
initActionButton() {
|
|
||||||
const node = new CloseButtonNode(() => {
|
|
||||||
this.initLuckyAni();
|
|
||||||
});
|
|
||||||
this.addChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
initResultNode() {
|
|
||||||
const node = new Node();
|
|
||||||
this.addChild(node);
|
|
||||||
|
|
||||||
node.setPosition(443, -200);
|
|
||||||
this.resultNode = node;
|
|
||||||
|
|
||||||
node.active = false;
|
|
||||||
|
|
||||||
const bs = node.addComponent(BaseSprite);
|
|
||||||
bs.updateSpriteFrame(NpkImage.luckycoin, this.luckyType);
|
|
||||||
}
|
|
||||||
|
|
||||||
initLuckyAni() {
|
|
||||||
const lucky = new AnimationNode("ani/luckycoin01.ani", () => {
|
|
||||||
/// 这一帧结束之后调用
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
// 销毁,销毁节点只能在当前帧结束后
|
|
||||||
lucky.destroy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
lucky.setPosition(318.5, -107.5);
|
|
||||||
this.addChild(lucky);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 延迟显示结果
|
|
||||||
delayShowResult() {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.resultNode.active = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
this.resultTweenDestroy();
|
|
||||||
}, 1000);
|
|
||||||
}, 1600);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 透明度缓动消失
|
|
||||||
resultTweenDestroy() {
|
|
||||||
|
|
||||||
let obj = { x: 255 };
|
|
||||||
|
|
||||||
tween(obj)
|
|
||||||
.to(0.5, { x: 1 }, { onUpdate: () => {
|
|
||||||
const spr = this.resultNode.getComponent(Sprite);
|
|
||||||
spr.color = new Color(255,255,255,obj.x);
|
|
||||||
}, onComplete: () => {
|
|
||||||
/// 缓动完成
|
|
||||||
this.resultNode.active = false;
|
|
||||||
// 动画完成回调
|
|
||||||
this.aniDoneBack();
|
|
||||||
// 销毁节点
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
this.destroy();
|
|
||||||
});
|
|
||||||
},easing:'linear'})
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "0039c2de-95ce-49a6-aa91-0ca7ee85ecc3",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-21 13:28:47
|
|
||||||
* @LastEditTime: 2024-03-25 19:44:01
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-21 13:28:47
|
|
||||||
* @LastEditTime: 2024-03-22 21:24:13
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 顺序选择卡片节点
|
|
||||||
*/
|
|
||||||
import { _decorator, Director, director, Node } from "cc";
|
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
|
||||||
import { BaseButtonAction } from "../../GlobalScript/CommonComponent/BaseButtonAction";
|
|
||||||
import { CardNode } from "./CardNode";
|
|
||||||
import { TimingProgressBar } from "../Common/TimingProgressBar";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
/// 选择顺序卡牌Node
|
|
||||||
@ccclass("SelectNumberNode")
|
|
||||||
export class SelectNumberNode extends Node {
|
|
||||||
oneCard: CardNode;
|
|
||||||
twoCard: CardNode;
|
|
||||||
threeCard: CardNode;
|
|
||||||
doneFunc: Function;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.initBackground();
|
|
||||||
this.initCards();
|
|
||||||
this.initTiming();
|
|
||||||
}
|
|
||||||
|
|
||||||
initBackground() {
|
|
||||||
const node = new Node();
|
|
||||||
node.setPosition(184.5, -181.5);
|
|
||||||
|
|
||||||
const bs = node.addComponent(BaseSprite);
|
|
||||||
bs.updateSpriteFrame(NpkImage.ingame, 46);
|
|
||||||
this.addChild(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
initCards() {
|
|
||||||
this.oneCard = new CardNode();
|
|
||||||
this.oneCard.setPosition(339, -220);
|
|
||||||
this.addChild(this.oneCard);
|
|
||||||
const Onebba = this.oneCard.addComponent(BaseButtonAction);
|
|
||||||
Onebba.onMouseLeftDown = () => {
|
|
||||||
this.onMouseLeftDown(0);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.twoCard = new CardNode();
|
|
||||||
this.twoCard.setPosition(533.5, -220);
|
|
||||||
this.addChild(this.twoCard);
|
|
||||||
const twoBba = this.twoCard.addComponent(BaseButtonAction);
|
|
||||||
twoBba.onMouseLeftDown = () => {
|
|
||||||
this.onMouseLeftDown(1);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.threeCard = new CardNode();
|
|
||||||
this.threeCard.setPosition(728, -220);
|
|
||||||
this.addChild(this.threeCard);
|
|
||||||
const threeBba = this.threeCard.addComponent(BaseButtonAction);
|
|
||||||
threeBba.onMouseLeftDown = () => {
|
|
||||||
this.onMouseLeftDown(2);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//* 倒计时
|
|
||||||
initTiming() {
|
|
||||||
// 倒计时
|
|
||||||
const time = new TimingProgressBar();
|
|
||||||
this.addChild(time);
|
|
||||||
|
|
||||||
time.tweenerStart(3, () => {
|
|
||||||
//倒计时缓动完成
|
|
||||||
//开始翻转动画,需要1秒完成动画
|
|
||||||
this.flipsCard();
|
|
||||||
|
|
||||||
//* 2秒后关闭node
|
|
||||||
setTimeout(() => {
|
|
||||||
this.doneFunc();
|
|
||||||
/// 这一帧结束之后调用
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
// 销毁,销毁节点只能在当前帧结束后
|
|
||||||
this.destroy();
|
|
||||||
});
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//* 翻转卡片
|
|
||||||
flipsCard() {
|
|
||||||
const cards = [this.oneCard, this.twoCard, this.threeCard];
|
|
||||||
for (let i = 0; i < cards.length; i++) {
|
|
||||||
const card = cards[i];
|
|
||||||
card.Disable = true;
|
|
||||||
card.flipsAnimation.animationStart(i, "玩家" + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMouseLeftDown(tag: number) {
|
|
||||||
const cards = [this.oneCard, this.twoCard, this.threeCard];
|
|
||||||
cards.forEach((card) => {
|
|
||||||
card.Disable = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "06193d25-5a05-4aaf-92a9-d5358c56a4ff",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-21 13:29:53
|
|
||||||
* @LastEditTime: 2024-03-29 14:21:02
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import { _decorator, Component, Node } from "cc";
|
|
||||||
import { BoardRoot } from "./BoardRoot";
|
|
||||||
import { UIRoot } from "./UIRoot/UIRoot";
|
|
||||||
import { GameRoleController } from "./UIRoot/GameRoleController";
|
|
||||||
import { DialogRoot } from "./DialogRoot/DialogRoot";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 游戏根节点的单例 用于直接提供子节点
|
|
||||||
*/
|
|
||||||
export class GameRootSingleton {
|
|
||||||
private static readonly _instance: GameRootSingleton =
|
|
||||||
new GameRootSingleton();
|
|
||||||
|
|
||||||
private constructor() {}
|
|
||||||
|
|
||||||
public static getInstance(): GameRootSingleton {
|
|
||||||
return GameRootSingleton._instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
boardRootNode: Node;
|
|
||||||
UIRootNode: Node;
|
|
||||||
DialogRootNode: Node;
|
|
||||||
|
|
||||||
boardRoot: BoardRoot;
|
|
||||||
UIRoot: UIRoot;
|
|
||||||
DialogRoot: DialogRoot;
|
|
||||||
|
|
||||||
/** 玩家角色控制脚本 */
|
|
||||||
gameRoleController: GameRoleController;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ccclass("GameRootController")
|
|
||||||
/**
|
|
||||||
* @description: 游戏根节点脚本
|
|
||||||
*/
|
|
||||||
export class GameRootController extends Component {
|
|
||||||
@property(Node) boardRootNode: Node;
|
|
||||||
@property(Node) UIRootNode: Node;
|
|
||||||
@property(Node) DialogRootNode: Node;
|
|
||||||
|
|
||||||
start() {
|
|
||||||
/// 给三个图层添加 root 根脚本
|
|
||||||
const game = GameRootSingleton.getInstance();
|
|
||||||
game.boardRootNode = this.boardRootNode;
|
|
||||||
game.UIRootNode = this.UIRootNode;
|
|
||||||
game.DialogRootNode = this.DialogRootNode;
|
|
||||||
|
|
||||||
/// 给三个图层添加 root 根脚本
|
|
||||||
game.boardRoot = this.boardRootNode.getComponent(BoardRoot);
|
|
||||||
game.UIRoot = this.UIRootNode.getComponent(UIRoot);
|
|
||||||
game.DialogRoot = this.DialogRootNode.getComponent(DialogRoot);
|
|
||||||
|
|
||||||
/// 在 UI 节点 添加玩家角色控制脚本
|
|
||||||
this.UIRootNode.addComponent(GameRoleController);
|
|
||||||
|
|
||||||
|
|
||||||
// 添加游戏 匹配过程控制 脚本
|
|
||||||
game.gameRoleController = this.addComponent(GameRoleController);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "949ead83-9b0e-4202-8007-c50ab2ceeeb5",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "1.2.0",
|
|
||||||
"importer": "directory",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "d61e7a19-5a2c-45c6-b9c8-8efecdaafe18",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-27 15:58:07
|
|
||||||
* @LastEditTime: 2024-03-29 14:40:52
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Node,
|
|
||||||
Sprite,
|
|
||||||
SpriteFrame,
|
|
||||||
} from "cc";
|
|
||||||
import { NpkImageTool } from "../../Tool/NPKImage";
|
|
||||||
import { GamerRoleAni, GamerRoleType } from "./GamerRoleType";
|
|
||||||
import { GameState } from "../../GlobalScript/GlobalGameState/GameState";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
@ccclass("GamerRoleNode")
|
|
||||||
|
|
||||||
//* ─── 玩家在地图上的角色 Node ────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 玩家在地图上的角色 节点
|
|
||||||
*/
|
|
||||||
export class GamerRoleNode extends Node {
|
|
||||||
constructor(type: GamerRoleType) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
//角色类型 设置后自动播放动画
|
|
||||||
this.addComponent(RoleAnimation).type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//* ─── 角色动画播放 Component ───────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
export enum PlayAniState {
|
|
||||||
//播放中
|
|
||||||
playing,
|
|
||||||
//暂停
|
|
||||||
pause,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 角色的动画
|
|
||||||
*/
|
|
||||||
export class RoleAnimation extends Component {
|
|
||||||
/** 节点精灵 */
|
|
||||||
private sprite: Sprite;
|
|
||||||
/** 精灵帧总数 */
|
|
||||||
private frameCount: number;
|
|
||||||
/** 是否初始化完成 */
|
|
||||||
private InitState: boolean;
|
|
||||||
/** 精灵帧map缓存 */
|
|
||||||
private frameMap: Map<number, SpriteFrame> = new Map<number, SpriteFrame>();
|
|
||||||
|
|
||||||
/** 每一帧需要显示的时间 千分之一秒 */
|
|
||||||
private static frameShowTime: number = 60;
|
|
||||||
|
|
||||||
/** 当前帧显示了的时间 */
|
|
||||||
private nowFrameTime: number = 0;
|
|
||||||
|
|
||||||
/** 当前帧 */
|
|
||||||
private nowFrameIndex: number = 0;
|
|
||||||
|
|
||||||
/** 动画状态 */
|
|
||||||
private playState: PlayAniState = PlayAniState.playing;
|
|
||||||
|
|
||||||
/** 角色类型 设置后自动播放动画 */
|
|
||||||
set type(type: GamerRoleType) {
|
|
||||||
|
|
||||||
const node = new Node();
|
|
||||||
this.node.addChild(node);
|
|
||||||
|
|
||||||
this.sprite = node.addComponent(Sprite);
|
|
||||||
|
|
||||||
//设置类型
|
|
||||||
this.sprite.sizeMode = Sprite.SizeMode.RAW;
|
|
||||||
//设置
|
|
||||||
this.sprite.trim = false;
|
|
||||||
|
|
||||||
// 获取所有帧图片
|
|
||||||
NpkImageTool.GetNpkImageAll(
|
|
||||||
GamerRoleAni.getPath(type),
|
|
||||||
(count, frameMap) => {
|
|
||||||
this.frameCount = count;
|
|
||||||
this.frameMap = frameMap;
|
|
||||||
this.InitState = true;
|
|
||||||
// 显示第一帧
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(this.nowFrameIndex);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {}
|
|
||||||
|
|
||||||
update(dt: number) {
|
|
||||||
//如果游戏世界处于暂停的模式下 不再继续播放
|
|
||||||
if (GameState.getInstance().IsPauseState()) return;
|
|
||||||
//如果初始化未完成,不播放
|
|
||||||
if (!this.InitState) return;
|
|
||||||
//如果不在播放中
|
|
||||||
if (this.playState != PlayAniState.playing) return;
|
|
||||||
|
|
||||||
//每帧增加过去的时间 取千分之一秒为单位
|
|
||||||
this.nowFrameTime += Math.trunc(dt * 1000);
|
|
||||||
|
|
||||||
// 大于60毫秒换下一帧
|
|
||||||
if (this.nowFrameTime < 60) return;
|
|
||||||
|
|
||||||
this.nowFrameTime -= 60;
|
|
||||||
this.nowFrameTime++;
|
|
||||||
|
|
||||||
// 播放完成后 重新播放
|
|
||||||
if (this.nowFrameIndex >= this.frameCount) this.nowFrameIndex = 0;
|
|
||||||
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(this.nowFrameIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "7b231e75-2650-4560-a447-3e3de615fdae",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,410 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-27 16:10:31
|
|
||||||
* @LastEditTime: 2024-03-29 10:49:55
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 玩家角色类型
|
|
||||||
*/
|
|
||||||
/// 官网总数 63
|
|
||||||
|
|
||||||
import { NpkImage, NpkImagePath } from "../../Tool/NPKImage";
|
|
||||||
|
|
||||||
//* ─── 玩家角色类型 ──────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 玩家角色类型
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export enum GamerRoleType {
|
|
||||||
/** 散打 */
|
|
||||||
SanDa,
|
|
||||||
/** 柔道 */
|
|
||||||
RouDao,
|
|
||||||
/** 气功 */
|
|
||||||
QiGong,
|
|
||||||
/** 街霸 */
|
|
||||||
JieBa,
|
|
||||||
|
|
||||||
/** 女漫游 */
|
|
||||||
NvManYou,
|
|
||||||
/** 女弹药 */
|
|
||||||
NvDanYao,
|
|
||||||
/** 女机械 */
|
|
||||||
NvJiXie,
|
|
||||||
/** 女枪炮 */
|
|
||||||
NvQiangPao,
|
|
||||||
|
|
||||||
/** 冰洁 */
|
|
||||||
BingJie,
|
|
||||||
/** 元素爆破 */
|
|
||||||
|
|
||||||
YuanSuBaoPo,
|
|
||||||
/** 剑魔 */
|
|
||||||
JianMo,
|
|
||||||
/** 剑宗 */
|
|
||||||
|
|
||||||
JianZong,
|
|
||||||
/** 暗殿骑士 */
|
|
||||||
AnDianQiShi,
|
|
||||||
/** 流浪骑士 */
|
|
||||||
|
|
||||||
LiuLangQiShi,
|
|
||||||
/** 光枪 */
|
|
||||||
GuangQiang,
|
|
||||||
/** 暗枪 */
|
|
||||||
AnQiang,
|
|
||||||
|
|
||||||
/** 女街霸 */
|
|
||||||
NvJieBa,
|
|
||||||
/** 女散打 */
|
|
||||||
NvSanDa,
|
|
||||||
/** 女气功 */
|
|
||||||
NvQiGong,
|
|
||||||
/** 女柔道 */
|
|
||||||
NvRouDao,
|
|
||||||
|
|
||||||
/** 弹药 */
|
|
||||||
DanYao,
|
|
||||||
/** 枪炮 */
|
|
||||||
QiangPao,
|
|
||||||
/** 机械 */
|
|
||||||
JiXie,
|
|
||||||
/** 漫游 */
|
|
||||||
ManYou,
|
|
||||||
|
|
||||||
/** 战法 */
|
|
||||||
ZanFa,
|
|
||||||
/** 召唤 */
|
|
||||||
ZhaoHuan,
|
|
||||||
/** 魔道 */
|
|
||||||
MoDao,
|
|
||||||
/** 元素 */
|
|
||||||
YuanSu,
|
|
||||||
|
|
||||||
/** 复仇 */
|
|
||||||
FuChou,
|
|
||||||
/** 篮拳 */
|
|
||||||
LanQuan,
|
|
||||||
/** 圣骑 */
|
|
||||||
ShenQi,
|
|
||||||
/** 驱魔 */
|
|
||||||
QuMo,
|
|
||||||
|
|
||||||
/** 狂战 */
|
|
||||||
KuangZhan,
|
|
||||||
/** 鬼泣 */
|
|
||||||
GuiQi,
|
|
||||||
/** 阿修罗 */
|
|
||||||
AXiuLuo,
|
|
||||||
/** 剑魂 */
|
|
||||||
JianHun,
|
|
||||||
|
|
||||||
/** 刺客 */
|
|
||||||
Cike,
|
|
||||||
/** 影武者 */
|
|
||||||
YinWuZhe,
|
|
||||||
/** 忍者 */
|
|
||||||
RenZhe,
|
|
||||||
/** 死灵 */
|
|
||||||
SiLin,
|
|
||||||
/** 普通鬼剑士 */
|
|
||||||
GuiJianShi,
|
|
||||||
}
|
|
||||||
|
|
||||||
//* ─── 角色立绘 路径 ─────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 角色立绘 路径
|
|
||||||
*/
|
|
||||||
export class GamerRoleCardDate {
|
|
||||||
/** NPk路径 */
|
|
||||||
npkPath: string;
|
|
||||||
/** index */
|
|
||||||
index: number;
|
|
||||||
|
|
||||||
constructor(index: number) {
|
|
||||||
this.npkPath = NpkImage.character_sd;
|
|
||||||
this.index = index;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 从角色类型获取立绘数据
|
|
||||||
*/
|
|
||||||
static getDate(type: GamerRoleType): GamerRoleCardDate {
|
|
||||||
switch (type) {
|
|
||||||
// 散打
|
|
||||||
case GamerRoleType.SanDa:
|
|
||||||
return new GamerRoleCardDate(29);
|
|
||||||
// 柔道
|
|
||||||
case GamerRoleType.RouDao:
|
|
||||||
return new GamerRoleCardDate(31);
|
|
||||||
// 气功
|
|
||||||
case GamerRoleType.QiGong:
|
|
||||||
return new GamerRoleCardDate(28);
|
|
||||||
// 街霸
|
|
||||||
case GamerRoleType.JieBa:
|
|
||||||
return new GamerRoleCardDate(30);
|
|
||||||
|
|
||||||
// 女漫游
|
|
||||||
case GamerRoleType.NvManYou:
|
|
||||||
return new GamerRoleCardDate(20);
|
|
||||||
// 女弹药
|
|
||||||
case GamerRoleType.NvDanYao:
|
|
||||||
return new GamerRoleCardDate(23);
|
|
||||||
// 女机械
|
|
||||||
case GamerRoleType.NvJiXie:
|
|
||||||
return new GamerRoleCardDate(22);
|
|
||||||
// 女枪炮
|
|
||||||
case GamerRoleType.NvQiangPao:
|
|
||||||
return new GamerRoleCardDate(21);
|
|
||||||
|
|
||||||
// 冰洁
|
|
||||||
case GamerRoleType.BingJie:
|
|
||||||
return new GamerRoleCardDate(33);
|
|
||||||
// 元素爆破
|
|
||||||
case GamerRoleType.YuanSuBaoPo:
|
|
||||||
return new GamerRoleCardDate(32);
|
|
||||||
|
|
||||||
// 剑魔
|
|
||||||
case GamerRoleType.JianMo:
|
|
||||||
return new GamerRoleCardDate(41);
|
|
||||||
// 剑宗
|
|
||||||
case GamerRoleType.JianZong:
|
|
||||||
return new GamerRoleCardDate(39);
|
|
||||||
|
|
||||||
// 暗殿骑士
|
|
||||||
case GamerRoleType.AnDianQiShi:
|
|
||||||
return new GamerRoleCardDate(40);
|
|
||||||
// 流浪骑士
|
|
||||||
case GamerRoleType.LiuLangQiShi:
|
|
||||||
return new GamerRoleCardDate(42);
|
|
||||||
|
|
||||||
// 光枪
|
|
||||||
case GamerRoleType.GuangQiang:
|
|
||||||
return new GamerRoleCardDate(48);
|
|
||||||
// 暗枪
|
|
||||||
case GamerRoleType.AnQiang:
|
|
||||||
return new GamerRoleCardDate(47);
|
|
||||||
|
|
||||||
// 女街霸
|
|
||||||
case GamerRoleType.NvJieBa:
|
|
||||||
return new GamerRoleCardDate(6);
|
|
||||||
// 女散打
|
|
||||||
case GamerRoleType.NvSanDa:
|
|
||||||
return new GamerRoleCardDate(5);
|
|
||||||
// 女气功
|
|
||||||
case GamerRoleType.NvQiGong:
|
|
||||||
return new GamerRoleCardDate(4);
|
|
||||||
// 女柔道
|
|
||||||
case GamerRoleType.NvRouDao:
|
|
||||||
return new GamerRoleCardDate(7);
|
|
||||||
|
|
||||||
// 弹药
|
|
||||||
case GamerRoleType.DanYao:
|
|
||||||
return new GamerRoleCardDate(11);
|
|
||||||
// 枪炮
|
|
||||||
case GamerRoleType.QiangPao:
|
|
||||||
return new GamerRoleCardDate(9);
|
|
||||||
// 机械
|
|
||||||
case GamerRoleType.JiXie:
|
|
||||||
return new GamerRoleCardDate(10);
|
|
||||||
// 漫游
|
|
||||||
case GamerRoleType.ManYou:
|
|
||||||
return new GamerRoleCardDate(8);
|
|
||||||
|
|
||||||
// 战法
|
|
||||||
case GamerRoleType.ZanFa:
|
|
||||||
return new GamerRoleCardDate(14);
|
|
||||||
// 召唤
|
|
||||||
case GamerRoleType.ZhaoHuan:
|
|
||||||
return new GamerRoleCardDate(13);
|
|
||||||
// 魔道
|
|
||||||
case GamerRoleType.MoDao:
|
|
||||||
return new GamerRoleCardDate(15);
|
|
||||||
// 元素
|
|
||||||
case GamerRoleType.YuanSu:
|
|
||||||
return new GamerRoleCardDate(12);
|
|
||||||
|
|
||||||
// 复仇
|
|
||||||
case GamerRoleType.FuChou:
|
|
||||||
return new GamerRoleCardDate(19);
|
|
||||||
// 篮拳
|
|
||||||
case GamerRoleType.LanQuan:
|
|
||||||
return new GamerRoleCardDate(16);
|
|
||||||
// 圣骑
|
|
||||||
case GamerRoleType.ShenQi:
|
|
||||||
return new GamerRoleCardDate(17);
|
|
||||||
// 驱魔
|
|
||||||
case GamerRoleType.QuMo:
|
|
||||||
return new GamerRoleCardDate(18);
|
|
||||||
|
|
||||||
// 狂战
|
|
||||||
case GamerRoleType.KuangZhan:
|
|
||||||
return new GamerRoleCardDate(2);
|
|
||||||
// 鬼泣
|
|
||||||
case GamerRoleType.GuiQi:
|
|
||||||
return new GamerRoleCardDate(1);
|
|
||||||
// 阿修罗
|
|
||||||
case GamerRoleType.AXiuLuo:
|
|
||||||
return new GamerRoleCardDate(3);
|
|
||||||
// 剑魂
|
|
||||||
case GamerRoleType.JianHun:
|
|
||||||
return new GamerRoleCardDate(0);
|
|
||||||
|
|
||||||
// 刺客
|
|
||||||
case GamerRoleType.Cike:
|
|
||||||
return new GamerRoleCardDate(24);
|
|
||||||
// 影武者
|
|
||||||
case GamerRoleType.YinWuZhe:
|
|
||||||
return new GamerRoleCardDate(27);
|
|
||||||
// 忍者
|
|
||||||
case GamerRoleType.RenZhe:
|
|
||||||
return new GamerRoleCardDate(26);
|
|
||||||
// 死灵
|
|
||||||
case GamerRoleType.SiLin:
|
|
||||||
return new GamerRoleCardDate(25);
|
|
||||||
|
|
||||||
// 普通鬼剑士
|
|
||||||
case GamerRoleType.GuiJianShi:
|
|
||||||
return new GamerRoleCardDate(62);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//* ─── 角色站立动画 路径 ───────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 角色站立动画 路径
|
|
||||||
*/
|
|
||||||
export class GamerRoleAni {
|
|
||||||
/**
|
|
||||||
* @description: 从角色站立动画 路径
|
|
||||||
*/
|
|
||||||
static getPath(type: GamerRoleType): string {
|
|
||||||
switch (type) {
|
|
||||||
// 散打
|
|
||||||
case GamerRoleType.SanDa:
|
|
||||||
return NpkImagePath + "role_1_sanda.img";
|
|
||||||
// 柔道
|
|
||||||
case GamerRoleType.RouDao:
|
|
||||||
return NpkImagePath + "role_2_roudao.img";
|
|
||||||
// 气功
|
|
||||||
case GamerRoleType.QiGong:
|
|
||||||
return NpkImagePath + "role_3_qigong.img";
|
|
||||||
// 街霸
|
|
||||||
case GamerRoleType.JieBa:
|
|
||||||
return NpkImagePath + "role_4_jieba.img";
|
|
||||||
// 女漫游
|
|
||||||
case GamerRoleType.NvManYou:
|
|
||||||
return NpkImagePath + "role_5_nv_manyou.img";
|
|
||||||
// 女弹药
|
|
||||||
case GamerRoleType.NvDanYao:
|
|
||||||
return NpkImagePath + "role_6_nv_danyao.img";
|
|
||||||
// 女机械
|
|
||||||
case GamerRoleType.NvJiXie:
|
|
||||||
return NpkImagePath + "role_7_nv_jixie.img";
|
|
||||||
// 女枪炮
|
|
||||||
case GamerRoleType.NvQiangPao:
|
|
||||||
return NpkImagePath + "role_8_nv_qiangpao.img";
|
|
||||||
// 冰洁
|
|
||||||
case GamerRoleType.BingJie:
|
|
||||||
return NpkImagePath + "role_9_bingjie.img";
|
|
||||||
// 元素爆破
|
|
||||||
case GamerRoleType.YuanSuBaoPo:
|
|
||||||
return NpkImagePath + "role_10_yuasubaopo.img";
|
|
||||||
// 剑魔
|
|
||||||
case GamerRoleType.JianMo:
|
|
||||||
return NpkImagePath + "role_11_jianmo.img";
|
|
||||||
// 剑宗
|
|
||||||
case GamerRoleType.JianZong:
|
|
||||||
return NpkImagePath + "role_12_jianzong.img";
|
|
||||||
// 暗殿骑士
|
|
||||||
case GamerRoleType.AnDianQiShi:
|
|
||||||
return NpkImagePath + "role_13_andianqishi.img";
|
|
||||||
// 流浪骑士
|
|
||||||
case GamerRoleType.LiuLangQiShi:
|
|
||||||
return NpkImagePath + "role_14_liulangjianshi.img";
|
|
||||||
// 光枪
|
|
||||||
case GamerRoleType.GuangQiang:
|
|
||||||
return NpkImagePath + "role_15_guangqiang.img";
|
|
||||||
// 暗枪
|
|
||||||
case GamerRoleType.AnQiang:
|
|
||||||
return NpkImagePath + "role_16_anqiang.img";
|
|
||||||
// 女街霸
|
|
||||||
case GamerRoleType.NvJieBa:
|
|
||||||
return NpkImagePath + "role_17_nv_jieba.img";
|
|
||||||
// 女散打
|
|
||||||
case GamerRoleType.NvSanDa:
|
|
||||||
return NpkImagePath + "role_18_nv_sanda.img";
|
|
||||||
// 女气功
|
|
||||||
case GamerRoleType.NvQiGong:
|
|
||||||
return NpkImagePath + "role_19_nv_qigong.img";
|
|
||||||
// 女柔道
|
|
||||||
case GamerRoleType.NvRouDao:
|
|
||||||
return NpkImagePath + "role_20_nv_roudao.img";
|
|
||||||
// 弹药
|
|
||||||
case GamerRoleType.DanYao:
|
|
||||||
return NpkImagePath + "role_21_danyao.img";
|
|
||||||
// 枪炮
|
|
||||||
case GamerRoleType.QiangPao:
|
|
||||||
return NpkImagePath + "role_22_qiangpao.img";
|
|
||||||
// 机械
|
|
||||||
case GamerRoleType.JiXie:
|
|
||||||
return NpkImagePath + "role_23_jixie.img";
|
|
||||||
// 漫游
|
|
||||||
case GamerRoleType.ManYou:
|
|
||||||
return NpkImagePath + "role_24_manyou.img";
|
|
||||||
// 战法
|
|
||||||
case GamerRoleType.ZanFa:
|
|
||||||
return NpkImagePath + "role_25_zhanfa.img";
|
|
||||||
// 召唤
|
|
||||||
case GamerRoleType.ZhaoHuan:
|
|
||||||
return NpkImagePath + "role_26_zhaohuan.img";
|
|
||||||
// 魔道
|
|
||||||
case GamerRoleType.MoDao:
|
|
||||||
return NpkImagePath + "role_27_modao.img";
|
|
||||||
// 元素
|
|
||||||
case GamerRoleType.YuanSu:
|
|
||||||
return NpkImagePath + "role_28_yuansu.img";
|
|
||||||
// 复仇
|
|
||||||
case GamerRoleType.FuChou:
|
|
||||||
return NpkImagePath + "role_29_fuchou.img";
|
|
||||||
// 篮拳
|
|
||||||
case GamerRoleType.LanQuan:
|
|
||||||
return NpkImagePath + "role_30_lanquan.img";
|
|
||||||
// 圣骑
|
|
||||||
case GamerRoleType.ShenQi:
|
|
||||||
return NpkImagePath + "role_31_shenqi.img";
|
|
||||||
// 驱魔
|
|
||||||
case GamerRoleType.QuMo:
|
|
||||||
return NpkImagePath + "role_32_qumo.img";
|
|
||||||
// 狂战
|
|
||||||
case GamerRoleType.KuangZhan:
|
|
||||||
return NpkImagePath + "role_33_kuangzhan.img";
|
|
||||||
// 鬼泣
|
|
||||||
case GamerRoleType.GuiQi:
|
|
||||||
return NpkImagePath + "role_34_guiqi.img";
|
|
||||||
// 阿修罗
|
|
||||||
case GamerRoleType.AXiuLuo:
|
|
||||||
return NpkImagePath + "role_35_axiuluo.img";
|
|
||||||
// 剑魂
|
|
||||||
case GamerRoleType.JianHun:
|
|
||||||
return NpkImagePath + "role_36_jianhun.img";
|
|
||||||
// 刺客
|
|
||||||
case GamerRoleType.Cike:
|
|
||||||
return NpkImagePath + "role_37_ceke.img";
|
|
||||||
// 影武者
|
|
||||||
case GamerRoleType.YinWuZhe:
|
|
||||||
return NpkImagePath + "role_38_yinwuzhe.img";
|
|
||||||
// 忍者
|
|
||||||
case GamerRoleType.RenZhe:
|
|
||||||
return NpkImagePath + "role_39_renzhe.img";
|
|
||||||
// 死灵
|
|
||||||
case GamerRoleType.SiLin:
|
|
||||||
return NpkImagePath + "role_40_silin.img";
|
|
||||||
// 普通鬼剑士
|
|
||||||
case GamerRoleType.GuiJianShi:
|
|
||||||
return NpkImagePath + "role_41_guijian.img";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "150e386d-95e6-4ebc-af15-1ef927aa4788",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
Vec3,
|
Vec3,
|
||||||
} from "cc";
|
} from "cc";
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
import { NpkImage } from "../../Tool/NPKImage";
|
||||||
import { MapTileDirection } from "./MapTileType";
|
import { MapTileDirection } from "./MapTileData";
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
||||||
import { DiamondCheck, Point } from "./../Common/InDiamondCheck";
|
import { DiamondCheck, Point } from "./../Common/InDiamondCheck";
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,5 @@
|
||||||
/*
|
import { _decorator, Component, Node } from "cc";
|
||||||
* @Author: WoNiu
|
import { MapTileData, MapTileFactory, MapTileType } from "./MapTileData";
|
||||||
* @Date: 2024-03-16 16:34:19
|
|
||||||
* @LastEditTime: 2024-03-28 21:09:58
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 地图地块的行为控制器
|
|
||||||
*/
|
|
||||||
import { _decorator, Component, } from "cc";
|
|
||||||
import { MapTileData, MapTileType } from "./MapTileType";
|
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
@ccclass("MapTileController")
|
@ccclass("MapTileController")
|
||||||
|
|
@ -20,7 +13,7 @@ export class MapTileController extends Component {
|
||||||
private _tileType: MapTileType;
|
private _tileType: MapTileType;
|
||||||
set tileType(newType: MapTileType){
|
set tileType(newType: MapTileType){
|
||||||
this._tileType = newType;
|
this._tileType = newType;
|
||||||
this._tileData = MapTileData.getData(newType as MapTileType);
|
this._tileData = MapTileFactory.getData(newType as MapTileType);
|
||||||
};
|
};
|
||||||
get tileType(){ return this._tileType; };
|
get tileType(){ return this._tileType; };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,165 +1,155 @@
|
||||||
import { Vec2, v2 } from "cc";
|
import { Vec2, v2 } from "cc";
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
import { NpkImage } from "../../Tool/NPKImage";
|
||||||
|
/// 地块类型
|
||||||
//* ─── 地块类型 ────────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/** 地块类型 */
|
|
||||||
export enum MapTileType {
|
export enum MapTileType {
|
||||||
/** 赫顿玛尔 */
|
/// 赫顿玛尔
|
||||||
HeDunMaEr = 0,
|
HeDunMaEr = 0,
|
||||||
/** 时间广场 */
|
/// 时间广场
|
||||||
ShiJianGuangChang,
|
ShiJianGuangChang,
|
||||||
/** 兽人峡谷 */
|
/// 兽人峡谷
|
||||||
ShouRenXiaGu,
|
ShouRenXiaGu,
|
||||||
/** 超时空漩涡 */
|
/// 超时空漩涡
|
||||||
ChaoShiKongXuanWo,
|
ChaoShiKongXuanWo,
|
||||||
/** 恐怖的栖息地 */
|
/// 恐怖的栖息地
|
||||||
KongBuDeQiXiDi,
|
KongBuDeQiXiDi,
|
||||||
/** 红色魔女之森 */
|
/// 红色魔女之森
|
||||||
HongSeMoNvZhiSen,
|
HongSeMoNvZhiSen,
|
||||||
|
|
||||||
/** 月光酒馆 */
|
/// 月光酒馆
|
||||||
YueGuangJiuGuan,
|
YueGuangJiuGuan,
|
||||||
/** 亡命杀阵 */
|
/// 亡命杀阵
|
||||||
WangMingShaZhen,
|
WangMingShaZhen,
|
||||||
/** 皇家娱乐 */
|
/// 皇家娱乐
|
||||||
HuangJaiYuLe,
|
HuangJaiYuLe,
|
||||||
/** 黑暗都市 */
|
/// 黑暗都市
|
||||||
HeiAnDuShi,
|
HeiAnDuShi,
|
||||||
/** 哈林的命运硬币(左边) */
|
/// 哈林的命运硬币(左边)
|
||||||
HaLinMingYunYinBi,
|
HaLinMingYunYinBi,
|
||||||
/** 第九隔离区 */
|
/// 第九隔离区
|
||||||
DiJiuGeLiQu,
|
DiJiuGeLiQu,
|
||||||
|
|
||||||
/** 决斗场 */
|
/// 决斗场
|
||||||
JueDouChang,
|
JueDouChang,
|
||||||
/** 腐坏街道 */
|
/// 腐坏街道
|
||||||
FuHuaiJieDao,
|
FuHuaiJieDao,
|
||||||
/** 溢血的地下城 */
|
/// 溢血的地下城
|
||||||
YiXueDeDiXiaChen,
|
YiXueDeDiXiaChen,
|
||||||
/** 普雷·伊西斯 */
|
/// 普雷·伊西斯
|
||||||
PuLeiYiXiSi,
|
PuLeiYiXiSi,
|
||||||
/** 沉重的礼拜堂 */
|
/// 沉重的礼拜堂
|
||||||
ChenZhongDeLiBaiTang,
|
ChenZhongDeLiBaiTang,
|
||||||
/** 螺旋王国 */
|
/// 螺旋王国
|
||||||
LuoXuanWangGuo,
|
LuoXuanWangGuo,
|
||||||
|
|
||||||
/** 海上列车 */
|
/// 海上列车
|
||||||
HaiShangLieChe,
|
HaiShangLieChe,
|
||||||
/** 暗黑神殿 */
|
/// 暗黑神殿
|
||||||
AnHeiShenDian,
|
AnHeiShenDian,
|
||||||
/** 痛苦地下城 */
|
/// 痛苦地下城
|
||||||
TongKuDiXiaChen,
|
TongKuDiXiaChen,
|
||||||
/** 无底坑道 */
|
/// 无底坑道
|
||||||
WuDiKenDao,
|
WuDiKenDao,
|
||||||
/** 切斯特小镇的命运硬币(右边) */
|
/// 切斯特小镇的命运硬币(右边)
|
||||||
XiaoZhenMingYunYinBi,
|
XiaoZhenMingYunYinBi,
|
||||||
/** 记忆之地 */
|
/// 记忆之地
|
||||||
JiYiZhiDi,
|
JiYiZhiDi,
|
||||||
}
|
}
|
||||||
|
|
||||||
//* ─── 所有地块类型数组 ────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/** 所有地块类型数组 */
|
|
||||||
export const MapTileTypes = [
|
export const MapTileTypes = [
|
||||||
/** 赫顿玛尔 */
|
/// 赫顿玛尔
|
||||||
MapTileType.HeDunMaEr,
|
MapTileType.HeDunMaEr,
|
||||||
/** 时间广场 */
|
/// 时间广场
|
||||||
MapTileType.ShiJianGuangChang,
|
MapTileType.ShiJianGuangChang,
|
||||||
/** 兽人峡谷 */
|
/// 兽人峡谷
|
||||||
MapTileType.ShouRenXiaGu,
|
MapTileType.ShouRenXiaGu,
|
||||||
/** 超时空漩涡 */
|
/// 超时空漩涡
|
||||||
MapTileType.ChaoShiKongXuanWo,
|
MapTileType.ChaoShiKongXuanWo,
|
||||||
/** 恐怖的栖息地 */
|
/// 恐怖的栖息地
|
||||||
MapTileType.KongBuDeQiXiDi,
|
MapTileType.KongBuDeQiXiDi,
|
||||||
/** 红色魔女之森 */
|
/// 红色魔女之森
|
||||||
MapTileType.HongSeMoNvZhiSen,
|
MapTileType.HongSeMoNvZhiSen,
|
||||||
|
|
||||||
/** 月光酒馆 */
|
/// 月光酒馆
|
||||||
MapTileType.YueGuangJiuGuan,
|
MapTileType.YueGuangJiuGuan,
|
||||||
/** 亡命杀阵 */
|
/// 亡命杀阵
|
||||||
MapTileType.WangMingShaZhen,
|
MapTileType.WangMingShaZhen,
|
||||||
/** 皇家娱乐 */
|
/// 皇家娱乐
|
||||||
MapTileType.HuangJaiYuLe,
|
MapTileType.HuangJaiYuLe,
|
||||||
/** 黑暗都市 */
|
/// 黑暗都市
|
||||||
MapTileType.HeiAnDuShi,
|
MapTileType.HeiAnDuShi,
|
||||||
/** 哈林的命运硬币(左边) */
|
/// 哈林的命运硬币(左边)
|
||||||
MapTileType.HaLinMingYunYinBi,
|
MapTileType.HaLinMingYunYinBi,
|
||||||
/** 第九隔离区 */
|
/// 第九隔离区
|
||||||
MapTileType.DiJiuGeLiQu,
|
MapTileType.DiJiuGeLiQu,
|
||||||
|
|
||||||
/** 决斗场 */
|
/// 决斗场
|
||||||
MapTileType.JueDouChang,
|
MapTileType.JueDouChang,
|
||||||
/** 腐坏街道 */
|
/// 腐坏街道
|
||||||
MapTileType.FuHuaiJieDao,
|
MapTileType.FuHuaiJieDao,
|
||||||
/** 溢血的地下城 */
|
/// 溢血的地下城
|
||||||
MapTileType.YiXueDeDiXiaChen,
|
MapTileType.YiXueDeDiXiaChen,
|
||||||
/** 普雷·伊西斯 */
|
/// 普雷·伊西斯
|
||||||
MapTileType.PuLeiYiXiSi,
|
MapTileType.PuLeiYiXiSi,
|
||||||
/** 沉重的礼拜堂 */
|
/// 沉重的礼拜堂
|
||||||
MapTileType.ChenZhongDeLiBaiTang,
|
MapTileType.ChenZhongDeLiBaiTang,
|
||||||
/** 螺旋王国 */
|
/// 螺旋王国
|
||||||
MapTileType.LuoXuanWangGuo,
|
MapTileType.LuoXuanWangGuo,
|
||||||
|
|
||||||
/** 海上列车 */
|
/// 海上列车
|
||||||
MapTileType.HaiShangLieChe,
|
MapTileType.HaiShangLieChe,
|
||||||
/** 暗黑神殿 */
|
/// 暗黑神殿
|
||||||
MapTileType.AnHeiShenDian,
|
MapTileType.AnHeiShenDian,
|
||||||
/** 痛苦地下城 */
|
/// 痛苦地下城
|
||||||
MapTileType.TongKuDiXiaChen,
|
MapTileType.TongKuDiXiaChen,
|
||||||
/** 无底坑道 */
|
/// 无底坑道
|
||||||
MapTileType.WuDiKenDao,
|
MapTileType.WuDiKenDao,
|
||||||
/** 切斯特小镇的命运硬币(右边) */
|
/// 切斯特小镇的命运硬币(右边)
|
||||||
MapTileType.XiaoZhenMingYunYinBi,
|
MapTileType.XiaoZhenMingYunYinBi,
|
||||||
/** 记忆之地 */
|
/// 记忆之地
|
||||||
MapTileType.JiYiZhiDi,
|
MapTileType.JiYiZhiDi,
|
||||||
];
|
];
|
||||||
|
|
||||||
//* ─── 地块方向 ────────────────────────────────────────────────────────────────────
|
/// 地块方向
|
||||||
|
|
||||||
/** 地块方向 */
|
|
||||||
export enum MapTileDirection {
|
export enum MapTileDirection {
|
||||||
/** 横 */
|
/// 横
|
||||||
horizontal = 24,
|
horizontal = 24,
|
||||||
/** 竖 */
|
/// 竖
|
||||||
vertical = 25,
|
vertical = 25,
|
||||||
/** 角落 */
|
/// 角落
|
||||||
nook = 26,
|
nook = 26,
|
||||||
}
|
}
|
||||||
|
|
||||||
//* ─── 地块的数据 ───────────────────────────────────────────────────────────────────
|
/// 地块的数据
|
||||||
|
|
||||||
/** 地块的数据 */
|
|
||||||
export class MapTileData {
|
export class MapTileData {
|
||||||
/** 坐标 */
|
/// 坐标
|
||||||
location: Vec2;
|
location: Vec2;
|
||||||
/** npk路径 */
|
/// npk路径
|
||||||
npkPath: NpkImage;
|
npkPath: NpkImage;
|
||||||
/** 地块背景index */
|
/// 地块背景index
|
||||||
backgroundIndex: number;
|
backgroundIndex: number;
|
||||||
/** 地块方向 */
|
/// 地块方向
|
||||||
direction: MapTileDirection;
|
direction: MapTileDirection;
|
||||||
/** 怪物相关数据 */
|
/// 怪物相关数据
|
||||||
|
|
||||||
/** 列车选择许可 */
|
/// 列车选择许可
|
||||||
trainsSelectLicense: boolean;
|
trainsSelectLicense: boolean;
|
||||||
/** 决斗场选择许可 */
|
/// 决斗场选择许可
|
||||||
duelSelectLicense: boolean;
|
duelSelectLicense: boolean;
|
||||||
/** 占领许可 */
|
/// 占领许可
|
||||||
occupyLicense: boolean;
|
occupyLicense: boolean;
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
/** 坐标 */
|
/// 坐标
|
||||||
location,
|
location,
|
||||||
/** 背景index */
|
/// 背景index
|
||||||
backgroundIndex,
|
backgroundIndex,
|
||||||
/** 地块方向 */
|
/// 地块方向
|
||||||
direction,
|
direction,
|
||||||
/** 占领许可 */
|
/// 占领许可
|
||||||
occupyLicense,
|
occupyLicense,
|
||||||
/** 列车选择许可 */
|
/// 列车选择许可
|
||||||
trainsSelectLicense,
|
trainsSelectLicense,
|
||||||
/** 决斗场选择许可 */
|
/// 决斗场选择许可
|
||||||
duelSelectLicense,
|
duelSelectLicense,
|
||||||
}: {
|
}: {
|
||||||
location: Vec2;
|
location: Vec2;
|
||||||
|
|
@ -178,85 +168,87 @@ export class MapTileData {
|
||||||
this.duelSelectLicense = duelSelectLicense ?? true;
|
this.duelSelectLicense = duelSelectLicense ?? true;
|
||||||
this.occupyLicense = occupyLicense ?? true;
|
this.occupyLicense = occupyLicense ?? true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class MapTileFactory {
|
||||||
static getData(type: MapTileType): MapTileData {
|
static getData(type: MapTileType): MapTileData {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
/// 赫顿玛尔
|
/// 赫顿玛尔
|
||||||
case MapTileType.HeDunMaEr:
|
case MapTileType.HeDunMaEr:
|
||||||
return this.HeDunMaErData;
|
return MapTileFactory.HeDunMaErData;
|
||||||
/// 时间广场
|
/// 时间广场
|
||||||
case MapTileType.ShiJianGuangChang:
|
case MapTileType.ShiJianGuangChang:
|
||||||
return this.ShiJianGuangChangData;
|
return MapTileFactory.ShiJianGuangChangData;
|
||||||
/// 兽人峡谷
|
/// 兽人峡谷
|
||||||
case MapTileType.ShouRenXiaGu:
|
case MapTileType.ShouRenXiaGu:
|
||||||
return this.ShouRenXiaGuData;
|
return MapTileFactory.ShouRenXiaGuData;
|
||||||
/// 超时空漩涡
|
/// 超时空漩涡
|
||||||
case MapTileType.ChaoShiKongXuanWo:
|
case MapTileType.ChaoShiKongXuanWo:
|
||||||
return this.ChaoShiKongXuanWoData;
|
return MapTileFactory.ChaoShiKongXuanWoData;
|
||||||
/// 恐怖的栖息地
|
/// 恐怖的栖息地
|
||||||
case MapTileType.KongBuDeQiXiDi:
|
case MapTileType.KongBuDeQiXiDi:
|
||||||
return this.KongBuDeQiXiDiData;
|
return MapTileFactory.KongBuDeQiXiDiData;
|
||||||
/// 红色魔女之森
|
/// 红色魔女之森
|
||||||
case MapTileType.HongSeMoNvZhiSen:
|
case MapTileType.HongSeMoNvZhiSen:
|
||||||
return this.HongSeMoNvZhiSenData;
|
return MapTileFactory.HongSeMoNvZhiSenData;
|
||||||
/// 月光酒馆
|
/// 月光酒馆
|
||||||
case MapTileType.YueGuangJiuGuan:
|
case MapTileType.YueGuangJiuGuan:
|
||||||
return this.YueGuangJiuGuanData;
|
return MapTileFactory.YueGuangJiuGuanData;
|
||||||
/// 亡命杀镇子
|
/// 亡命杀镇子
|
||||||
case MapTileType.WangMingShaZhen:
|
case MapTileType.WangMingShaZhen:
|
||||||
return this.WangMingShaZhenData;
|
return MapTileFactory.WangMingShaZhenData;
|
||||||
/// 皇家娱乐
|
/// 皇家娱乐
|
||||||
case MapTileType.HuangJaiYuLe:
|
case MapTileType.HuangJaiYuLe:
|
||||||
return this.HuangJaiYuLeData;
|
return MapTileFactory.HuangJaiYuLeData;
|
||||||
/// 黑暗都市
|
/// 黑暗都市
|
||||||
case MapTileType.HeiAnDuShi:
|
case MapTileType.HeiAnDuShi:
|
||||||
return this.HeiAnDuShiData;
|
return MapTileFactory.HeiAnDuShiData;
|
||||||
/// 哈林的命运硬币(左边)
|
/// 哈林的命运硬币(左边)
|
||||||
case MapTileType.HaLinMingYunYinBi:
|
case MapTileType.HaLinMingYunYinBi:
|
||||||
return this.HaLinMingYunYinBiData;
|
return MapTileFactory.HaLinMingYunYinBiData;
|
||||||
/// 第九隔离区
|
/// 第九隔离区
|
||||||
case MapTileType.DiJiuGeLiQu:
|
case MapTileType.DiJiuGeLiQu:
|
||||||
return this.DiJiuGeLiQuData;
|
return MapTileFactory.DiJiuGeLiQuData;
|
||||||
/// 决斗场
|
/// 决斗场
|
||||||
case MapTileType.JueDouChang:
|
case MapTileType.JueDouChang:
|
||||||
return this.JueDouChangData;
|
return MapTileFactory.JueDouChangData;
|
||||||
/// 腐坏街道
|
/// 腐坏街道
|
||||||
case MapTileType.FuHuaiJieDao:
|
case MapTileType.FuHuaiJieDao:
|
||||||
return this.FuHuaiJieDaoData;
|
return MapTileFactory.FuHuaiJieDaoData;
|
||||||
/// 溢血的地下城
|
/// 溢血的地下城
|
||||||
case MapTileType.YiXueDeDiXiaChen:
|
case MapTileType.YiXueDeDiXiaChen:
|
||||||
return this.YiXueDeDiXiaChenData;
|
return MapTileFactory.YiXueDeDiXiaChenData;
|
||||||
/// 普雷·伊西斯
|
/// 普雷·伊西斯
|
||||||
case MapTileType.PuLeiYiXiSi:
|
case MapTileType.PuLeiYiXiSi:
|
||||||
return this.PuLeiYiXiSiData;
|
return MapTileFactory.PuLeiYiXiSiData;
|
||||||
/// 沉重的礼拜堂
|
/// 沉重的礼拜堂
|
||||||
case MapTileType.ChenZhongDeLiBaiTang:
|
case MapTileType.ChenZhongDeLiBaiTang:
|
||||||
return this.ChenZhongDeLiBaiTangData;
|
return MapTileFactory.ChenZhongDeLiBaiTangData;
|
||||||
/// 螺旋王国
|
/// 螺旋王国
|
||||||
case MapTileType.LuoXuanWangGuo:
|
case MapTileType.LuoXuanWangGuo:
|
||||||
return this.LuoXuanWangGuoData;
|
return MapTileFactory.LuoXuanWangGuoData;
|
||||||
/// 海上列车
|
/// 海上列车
|
||||||
case MapTileType.HaiShangLieChe:
|
case MapTileType.HaiShangLieChe:
|
||||||
return this.HaiShangLieCheData;
|
return MapTileFactory.HaiShangLieCheData;
|
||||||
/// 暗黑神殿
|
/// 暗黑神殿
|
||||||
case MapTileType.AnHeiShenDian:
|
case MapTileType.AnHeiShenDian:
|
||||||
return this.AnHeiShenDianData;
|
return MapTileFactory.AnHeiShenDianData;
|
||||||
/// 痛苦地下城
|
/// 痛苦地下城
|
||||||
case MapTileType.TongKuDiXiaChen:
|
case MapTileType.TongKuDiXiaChen:
|
||||||
return this.TongKuDiXiaChenData;
|
return MapTileFactory.TongKuDiXiaChenData;
|
||||||
/// 无底坑道
|
/// 无底坑道
|
||||||
case MapTileType.WuDiKenDao:
|
case MapTileType.WuDiKenDao:
|
||||||
return this.WuDiKenDaoData;
|
return MapTileFactory.WuDiKenDaoData;
|
||||||
/// 切斯特小镇的命运硬币(右边)
|
/// 切斯特小镇的命运硬币(右边)
|
||||||
case MapTileType.XiaoZhenMingYunYinBi:
|
case MapTileType.XiaoZhenMingYunYinBi:
|
||||||
return this.XiaoZhenMingYunYinBiData;
|
return MapTileFactory.XiaoZhenMingYunYinBiData;
|
||||||
/// 记忆之地
|
/// 记忆之地
|
||||||
case MapTileType.JiYiZhiDi:
|
case MapTileType.JiYiZhiDi:
|
||||||
return this.JiYiZhiDiData;
|
return MapTileFactory.JiYiZhiDiData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 赫顿玛尔 */
|
// 赫顿玛尔
|
||||||
private static HeDunMaErData = new MapTileData({
|
private static HeDunMaErData = new MapTileData({
|
||||||
location: v2(475, -448),
|
location: v2(475, -448),
|
||||||
direction: MapTileDirection.nook,
|
direction: MapTileDirection.nook,
|
||||||
|
|
@ -264,38 +256,38 @@ export class MapTileData {
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 时间广场 (55,34) */
|
/// 时间广场 (55,34)
|
||||||
private static ShiJianGuangChangData = new MapTileData({
|
private static ShiJianGuangChangData = new MapTileData({
|
||||||
location: v2(420, -414),
|
location: v2(420, -414),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 兽人峡谷 (52,34) */
|
/// 兽人峡谷 (52,34)
|
||||||
private static ShouRenXiaGuData = new MapTileData({
|
private static ShouRenXiaGuData = new MapTileData({
|
||||||
location: v2(368, -380),
|
location: v2(368, -380),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 超时空漩涡 (53,34) */
|
/// 超时空漩涡 (53,34)
|
||||||
private static ChaoShiKongXuanWoData = new MapTileData({
|
private static ChaoShiKongXuanWoData = new MapTileData({
|
||||||
location: v2(315, -346),
|
location: v2(315, -346),
|
||||||
backgroundIndex: 32,
|
backgroundIndex: 32,
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 恐怖的栖息地 (52,34) */
|
/// 恐怖的栖息地 (52,34)
|
||||||
private static KongBuDeQiXiDiData = new MapTileData({
|
private static KongBuDeQiXiDiData = new MapTileData({
|
||||||
location: v2(262, -312),
|
location: v2(262, -312),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 红色魔女之森 (52,34) */
|
/// 红色魔女之森 (52,34)
|
||||||
private static HongSeMoNvZhiSenData = new MapTileData({
|
private static HongSeMoNvZhiSenData = new MapTileData({
|
||||||
location: v2(209, -278),
|
location: v2(209, -278),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 月光酒馆(69,44) */
|
// 月光酒馆(69,44)
|
||||||
private static YueGuangJiuGuanData = new MapTileData({
|
private static YueGuangJiuGuanData = new MapTileData({
|
||||||
location: v2(140, -234),
|
location: v2(140, -234),
|
||||||
direction: MapTileDirection.nook,
|
direction: MapTileDirection.nook,
|
||||||
|
|
@ -303,24 +295,24 @@ export class MapTileData {
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 亡命杀镇 (53,34) */
|
/// 亡命杀镇 (53,34)
|
||||||
private static WangMingShaZhenData = new MapTileData({
|
private static WangMingShaZhenData = new MapTileData({
|
||||||
location: v2(209, -198),
|
location: v2(209, -198),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 皇家娱乐(53,34) */
|
/// 皇家娱乐(53,34)
|
||||||
private static HuangJaiYuLeData = new MapTileData({
|
private static HuangJaiYuLeData = new MapTileData({
|
||||||
location: v2(262, -164),
|
location: v2(262, -164),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 黑暗都市 */
|
/// 黑暗都市
|
||||||
private static HeiAnDuShiData = new MapTileData({
|
private static HeiAnDuShiData = new MapTileData({
|
||||||
location: v2(315, -130),
|
location: v2(315, -130),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
/** 哈林的命运硬币(左边) */
|
/// 哈林的命运硬币(左边)
|
||||||
private static HaLinMingYunYinBiData = new MapTileData({
|
private static HaLinMingYunYinBiData = new MapTileData({
|
||||||
location: v2(368, -96),
|
location: v2(368, -96),
|
||||||
backgroundIndex: 34,
|
backgroundIndex: 34,
|
||||||
|
|
@ -328,13 +320,13 @@ export class MapTileData {
|
||||||
duelSelectLicense: false,
|
duelSelectLicense: false,
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
/** 第九隔离区 */
|
/// 第九隔离区
|
||||||
private static DiJiuGeLiQuData = new MapTileData({
|
private static DiJiuGeLiQuData = new MapTileData({
|
||||||
location: v2(421, -62),
|
location: v2(421, -62),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 决斗场(54,44) */
|
// 决斗场(54,44)
|
||||||
private static JueDouChangData = new MapTileData({
|
private static JueDouChangData = new MapTileData({
|
||||||
location: v2(475, -18),
|
location: v2(475, -18),
|
||||||
direction: MapTileDirection.nook,
|
direction: MapTileDirection.nook,
|
||||||
|
|
@ -342,38 +334,38 @@ export class MapTileData {
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 腐坏街道(53,34) */
|
/// 腐坏街道(53,34)
|
||||||
private static FuHuaiJieDaoData = new MapTileData({
|
private static FuHuaiJieDaoData = new MapTileData({
|
||||||
location: v2(544, -62),
|
location: v2(544, -62),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 溢血的地下城(53,34) */
|
/// 溢血的地下城(53,34)
|
||||||
private static YiXueDeDiXiaChenData = new MapTileData({
|
private static YiXueDeDiXiaChenData = new MapTileData({
|
||||||
location: v2(597, -96),
|
location: v2(597, -96),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 普雷·伊西斯 */
|
/// 普雷·伊西斯
|
||||||
private static PuLeiYiXiSiData = new MapTileData({
|
private static PuLeiYiXiSiData = new MapTileData({
|
||||||
location: v2(650, -130),
|
location: v2(650, -130),
|
||||||
backgroundIndex: 33,
|
backgroundIndex: 33,
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 沉重的礼拜堂 */
|
/// 沉重的礼拜堂
|
||||||
private static ChenZhongDeLiBaiTangData = new MapTileData({
|
private static ChenZhongDeLiBaiTangData = new MapTileData({
|
||||||
location: v2(703, -164),
|
location: v2(703, -164),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 螺旋王国 */
|
/// 螺旋王国
|
||||||
private static LuoXuanWangGuoData = new MapTileData({
|
private static LuoXuanWangGuoData = new MapTileData({
|
||||||
location: v2(756, -198),
|
location: v2(756, -198),
|
||||||
direction: MapTileDirection.horizontal,
|
direction: MapTileDirection.horizontal,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 海上列车(69,44) */
|
// 海上列车(69,44)
|
||||||
private static HaiShangLieCheData = new MapTileData({
|
private static HaiShangLieCheData = new MapTileData({
|
||||||
location: v2(808, -234),
|
location: v2(808, -234),
|
||||||
direction: MapTileDirection.nook,
|
direction: MapTileDirection.nook,
|
||||||
|
|
@ -382,25 +374,25 @@ export class MapTileData {
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 暗黑神殿 */
|
/// 暗黑神殿
|
||||||
private static AnHeiShenDianData = new MapTileData({
|
private static AnHeiShenDianData = new MapTileData({
|
||||||
location: v2(756, -278),
|
location: v2(756, -278),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 痛苦地下城 */
|
/// 痛苦地下城
|
||||||
private static TongKuDiXiaChenData = new MapTileData({
|
private static TongKuDiXiaChenData = new MapTileData({
|
||||||
location: v2(703, -312),
|
location: v2(703, -312),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 无底坑道 */
|
/// 无底坑道
|
||||||
private static WuDiKenDaoData = new MapTileData({
|
private static WuDiKenDaoData = new MapTileData({
|
||||||
location: v2(650, -346),
|
location: v2(650, -346),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 切斯特小镇的命运硬币(右边) */
|
/// 切斯特小镇的命运硬币(右边)
|
||||||
private static XiaoZhenMingYunYinBiData = new MapTileData({
|
private static XiaoZhenMingYunYinBiData = new MapTileData({
|
||||||
location: v2(597, -380),
|
location: v2(597, -380),
|
||||||
backgroundIndex: 34,
|
backgroundIndex: 34,
|
||||||
|
|
@ -409,11 +401,9 @@ export class MapTileData {
|
||||||
occupyLicense: false,
|
occupyLicense: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 记忆之地 */
|
/// 记忆之地
|
||||||
private static JiYiZhiDiData = new MapTileData({
|
private static JiYiZhiDiData = new MapTileData({
|
||||||
location: v2(544, -414),
|
location: v2(544, -414),
|
||||||
direction: MapTileDirection.vertical,
|
direction: MapTileDirection.vertical,
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import { _decorator, Node } from "cc";
|
import { _decorator, Node } from "cc";
|
||||||
import { MapTileDirection, MapTileType } from "./MapTileType";
|
import {
|
||||||
|
MapTileDirection,
|
||||||
|
MapTileType,
|
||||||
|
} from "./MapTileData";
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
||||||
import { MapTileButtonComponent } from "./MapTileButtonComponent";
|
import { MapTileButtonComponent } from "./MapTileButtonComponent";
|
||||||
import { MapTileController } from "./MapTileController";
|
import { MapTileController } from "./MapTileController";
|
||||||
import { CloseButtonNode } from "../Common/CloseButtonNode";
|
|
||||||
import { MapTitleAction } from "./MapTitleAction";
|
|
||||||
import { LuckyType } from "../DialogRoot/LuckyCoinsNode";
|
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
/// 地块
|
/// 地块
|
||||||
|
|
@ -44,21 +44,16 @@ export class MapTileNode extends Node {
|
||||||
this.controller.tileType = type;
|
this.controller.tileType = type;
|
||||||
|
|
||||||
this.initNode();
|
this.initNode();
|
||||||
|
|
||||||
// todo 测试用按钮
|
|
||||||
this.initButton();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 测试使用按钮
|
/// 测试使用按钮
|
||||||
initButton() {
|
initButtons(){
|
||||||
const node = new CloseButtonNode(()=>{
|
|
||||||
MapTitleAction.lucky( LuckyType.GoThree );
|
|
||||||
})
|
|
||||||
this.addChild(node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initNode() {
|
initNode() {
|
||||||
//* 背景
|
|
||||||
|
/// 背景
|
||||||
if (this.controller.tileData.backgroundIndex) {
|
if (this.controller.tileData.backgroundIndex) {
|
||||||
const node = new Node();
|
const node = new Node();
|
||||||
this.addChild(node);
|
this.addChild(node);
|
||||||
|
|
@ -72,7 +67,7 @@ export class MapTileNode extends Node {
|
||||||
this.backgroundNode = node;
|
this.backgroundNode = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
//* 名称
|
/// 名称
|
||||||
const node = new Node();
|
const node = new Node();
|
||||||
this.addChild(node);
|
this.addChild(node);
|
||||||
|
|
||||||
|
|
@ -84,8 +79,8 @@ export class MapTileNode extends Node {
|
||||||
|
|
||||||
this.nameNode = node;
|
this.nameNode = node;
|
||||||
|
|
||||||
//* 红色边框
|
/// 决斗场选择后的红色边框
|
||||||
// 决斗场选择后的红色边框,四角和命运硬币 没有红框
|
// 四角和命运硬币 没有红框
|
||||||
if (
|
if (
|
||||||
this.controller.tileData.direction != MapTileDirection.nook &&
|
this.controller.tileData.direction != MapTileDirection.nook &&
|
||||||
this.controller.tileType !=
|
this.controller.tileType !=
|
||||||
|
|
@ -99,47 +94,46 @@ export class MapTileNode extends Node {
|
||||||
const bs = node.addComponent(BaseSprite);
|
const bs = node.addComponent(BaseSprite);
|
||||||
bs.updateSpriteFrame(
|
bs.updateSpriteFrame(
|
||||||
this.controller.tileData.npkPath,
|
this.controller.tileData.npkPath,
|
||||||
this.controller.tileData.direction == MapTileDirection.horizontal
|
this.controller.tileData.direction == MapTileDirection.horizontal ? 27 : 28
|
||||||
? 27
|
|
||||||
: 28
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.fightNode = node;
|
this.fightNode = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
//* 鼠标选择边框
|
if (this.controller.tileData.trainsSelectLicense){
|
||||||
|
// 鼠标选择边框
|
||||||
const bordeNode = new Node();
|
const bordeNode = new Node();
|
||||||
this.addChild(bordeNode);
|
this.addChild(bordeNode);
|
||||||
bordeNode.active = false;
|
bordeNode.active = false;
|
||||||
const bordeBC = bordeNode.addComponent(MapTileButtonComponent);
|
const bordeBC = bordeNode.addComponent(MapTileButtonComponent);
|
||||||
bordeBC.direction = this.controller.tileData.direction;
|
bordeBC.direction = this.controller.tileData.direction;
|
||||||
this.borderNode = bordeNode;
|
this.borderNode = bordeNode;
|
||||||
|
}
|
||||||
|
|
||||||
//* 禁止选择node
|
|
||||||
|
/// 禁止选择
|
||||||
const disableNode = new Node();
|
const disableNode = new Node();
|
||||||
this.addChild(disableNode);
|
this.addChild(disableNode);
|
||||||
disableNode.active = false;
|
disableNode.active = false;
|
||||||
const disableBS = disableNode.addComponent(BaseSprite);
|
const disableBS = disableNode.addComponent(BaseSprite);
|
||||||
disableBS.updateSpriteFrame(
|
disableBS.updateSpriteFrame(this.controller.tileData.npkPath,this.controller.tileData.direction + 5)
|
||||||
this.controller.tileData.npkPath,
|
|
||||||
this.controller.tileData.direction + 5
|
|
||||||
);
|
|
||||||
this.disableNode = disableNode;
|
this.disableNode = disableNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//* 显示海上列车选择
|
|
||||||
shwTrainsSelect(show: boolean) {
|
/// 显示海上列车选择
|
||||||
if (this.borderNode) {
|
shwTrainsSelect(show: boolean){
|
||||||
//* 许可选择
|
if (this.borderNode){
|
||||||
if (this.controller.tileData.trainsSelectLicense) {
|
/// 许可选择
|
||||||
|
if (this.controller.tileData.trainsSelectLicense){
|
||||||
this.borderNode.active = show;
|
this.borderNode.active = show;
|
||||||
} else {
|
}else{
|
||||||
this.disableNode.active = true;
|
this.disableNode.active = true;
|
||||||
}
|
}
|
||||||
} else {
|
}else{
|
||||||
this.disableNode.active = false;
|
this.disableNode.active = false;
|
||||||
this.borderNode.active = false;
|
this.borderNode.active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-26 11:36:36
|
|
||||||
* @LastEditTime: 2024-03-29 14:03:36
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { LuckyCoinsNode, LuckyType } from "../DialogRoot/LuckyCoinsNode";
|
|
||||||
import { GameRootSingleton } from "../GameRootController";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 地图事件
|
|
||||||
*/
|
|
||||||
export class MapTitleAction {
|
|
||||||
// ─── 特殊事件 ────────────────────────────────────────────────────────────
|
|
||||||
//* 月光酒馆
|
|
||||||
//* 决斗场
|
|
||||||
//* 海上列车
|
|
||||||
//* 幸运硬币
|
|
||||||
/**
|
|
||||||
* @description: 幸运硬币事件
|
|
||||||
*/
|
|
||||||
static lucky(type: LuckyType) {
|
|
||||||
// 将幸运硬币动画节点添加到 Dialog 层
|
|
||||||
const node = new LuckyCoinsNode(type, () => {
|
|
||||||
LuckyAction.Action(type);
|
|
||||||
});
|
|
||||||
GameRootSingleton.getInstance().DialogRootNode.addChild(node);
|
|
||||||
}
|
|
||||||
// ─── 怪物事件 ────────────────────────────────────────────────────────────────────
|
|
||||||
/**
|
|
||||||
* @description: 怪物事件
|
|
||||||
*/
|
|
||||||
static monsterAction() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 幸运硬币事件
|
|
||||||
*/
|
|
||||||
export class LuckyAction {
|
|
||||||
static Action(type: LuckyType) {
|
|
||||||
const lucky = new LuckyAction();
|
|
||||||
switch (type) {
|
|
||||||
case LuckyType.GoThree:
|
|
||||||
lucky.GoThreeAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.YeGuangJiuGuan:
|
|
||||||
lucky.YeGuangJiuGuanAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.JueDouChang:
|
|
||||||
lucky.JueDouChangAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.HaiShangLieChe:
|
|
||||||
lucky.HaiShangLieCheAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.Double:
|
|
||||||
lucky.DoubleAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.Halve:
|
|
||||||
lucky.HalveAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.HorseCombat:
|
|
||||||
lucky.HorseCombatAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.Servicing:
|
|
||||||
lucky.ServicingAction();
|
|
||||||
break;
|
|
||||||
case LuckyType.Charge:
|
|
||||||
lucky.ChargeAction();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 前进三格
|
|
||||||
GoThreeAction() {}
|
|
||||||
// 移动到月光酒馆
|
|
||||||
YeGuangJiuGuanAction() {}
|
|
||||||
// 移动到决斗场
|
|
||||||
JueDouChangAction() {}
|
|
||||||
// 移动到海上列车
|
|
||||||
HaiShangLieCheAction() {}
|
|
||||||
// 我要双倍,点数x2
|
|
||||||
DoubleAction() {}
|
|
||||||
// 这是我的钱,点数减半
|
|
||||||
HalveAction() {}
|
|
||||||
// 骑士马战 ,点数+2w
|
|
||||||
HorseCombatAction() {}
|
|
||||||
// 装备修理, 点数-2w
|
|
||||||
ServicingAction() {}
|
|
||||||
// 收取费用,夺取其他人 2w 点数
|
|
||||||
ChargeAction() {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "38b0fe6c-2083-4510-92d6-8f50384fac2c",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-27 15:20:29
|
|
||||||
* @LastEditTime: 2024-03-28 21:15:43
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import { MapTileType, MapTileTypes } from "./MapTileType";
|
|
||||||
import { MapTitleModel } from "./MapTitleModel";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 地图数据的单例
|
|
||||||
*/
|
|
||||||
export class MapTitleDatelSingleton {
|
|
||||||
private static readonly _instance: MapTitleDatelSingleton =
|
|
||||||
new MapTitleDatelSingleton();
|
|
||||||
|
|
||||||
//* 地块nodeMap
|
|
||||||
mapModMap: Map<MapTileType, MapTitleModel> = new Map<
|
|
||||||
MapTileType,
|
|
||||||
MapTitleModel
|
|
||||||
>();
|
|
||||||
|
|
||||||
private constructor() {
|
|
||||||
|
|
||||||
MapTileTypes.forEach((type) => {
|
|
||||||
const mod = new MapTitleModel(type);
|
|
||||||
this.mapModMap.set(type, mod);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getInstance(): MapTitleDatelSingleton {
|
|
||||||
return MapTitleDatelSingleton._instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "de311b7f-a77a-4109-aefe-81e8f4d5740f",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-26 11:12:32
|
|
||||||
* @LastEditTime: 2024-03-27 15:16:42
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import { _decorator } from "cc";
|
|
||||||
|
|
||||||
import { MapTileType } from "./MapTileType";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 地图数据模型
|
|
||||||
*/
|
|
||||||
export class MapTitleModel {
|
|
||||||
//* 地块类型
|
|
||||||
type: MapTileType;
|
|
||||||
|
|
||||||
//* 地块占领状态(是谁占领的,)
|
|
||||||
occupState: string;
|
|
||||||
|
|
||||||
//* 占领等级
|
|
||||||
occupyLevel: 0 | 1 | 2 | 3;
|
|
||||||
|
|
||||||
//* 决斗场等级
|
|
||||||
fightLevel: 0 | 2 | 4 | 8;
|
|
||||||
|
|
||||||
constructor(type: MapTileType) {
|
|
||||||
this.type = type;
|
|
||||||
this.occupState = "";
|
|
||||||
this.occupyLevel = 0;
|
|
||||||
this.fightLevel = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "5597e322-7749-48fe-98d4-bb4294ab1a10",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { BaseSprite } from '../../GlobalScript/CommonComponent/BaseSprite';
|
||||||
import { NpkImage } from '../../Tool/NPKImage';
|
import { NpkImage } from '../../Tool/NPKImage';
|
||||||
import { BaseButton } from '../../GlobalScript/CommonComponent/BaseButton';
|
import { BaseButton } from '../../GlobalScript/CommonComponent/BaseButton';
|
||||||
import { AnimationNode } from '../../GlobalScript/Animation/AnimationNode';
|
import { AnimationNode } from '../../GlobalScript/Animation/AnimationNode';
|
||||||
|
import { UIRoot } from '../UIRoot';
|
||||||
import {CloseButtonNode } from '../Common/CloseButtonNode';
|
import {CloseButtonNode } from '../Common/CloseButtonNode';
|
||||||
import { GameRootSingleton } from '../GameRootController';
|
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
/// 开始游戏按钮界面
|
/// 开始游戏按钮界面
|
||||||
|
|
@ -12,7 +12,18 @@ const { ccclass } = _decorator;
|
||||||
export class StartGameUINode extends Node {
|
export class StartGameUINode extends Node {
|
||||||
|
|
||||||
/// 玩法介绍
|
/// 玩法介绍
|
||||||
private pressenNode: Node;
|
private _pressenNode: Node;
|
||||||
|
|
||||||
|
set pressenNode(node: Node){
|
||||||
|
if (this._pressenNode){
|
||||||
|
this._pressenNode.destroy();
|
||||||
|
this._pressenNode = null;
|
||||||
|
}
|
||||||
|
this._pressenNode = node;
|
||||||
|
}
|
||||||
|
get pressenNode(): Node{
|
||||||
|
return this._pressenNode;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(){
|
constructor(){
|
||||||
super();
|
super();
|
||||||
|
|
@ -59,7 +70,11 @@ export class StartGameUINode extends Node {
|
||||||
|
|
||||||
/// 给节点添加 button 组件
|
/// 给节点添加 button 组件
|
||||||
const buttonComponent = startButtonNode.addComponent( BaseButton );
|
const buttonComponent = startButtonNode.addComponent( BaseButton );
|
||||||
buttonComponent.init(NpkImage.main,1);
|
buttonComponent.ImgPath = NpkImage.main;
|
||||||
|
buttonComponent.NormalImgIndex = 1;
|
||||||
|
buttonComponent.HoverImgIndex = 2;
|
||||||
|
buttonComponent.PressImgIndex = 3;
|
||||||
|
buttonComponent.DisableImgIndex = 4;
|
||||||
|
|
||||||
startButtonNode.addComponent( Button)
|
startButtonNode.addComponent( Button)
|
||||||
startButtonNode.on(Button.EventType.CLICK,this.startOnTouchEnd,this);
|
startButtonNode.on(Button.EventType.CLICK,this.startOnTouchEnd,this);
|
||||||
|
|
@ -88,7 +103,11 @@ export class StartGameUINode extends Node {
|
||||||
|
|
||||||
/// 给节点添加 button 组件
|
/// 给节点添加 button 组件
|
||||||
const buttonComponent = pressenButtonNode.addComponent( BaseButton );
|
const buttonComponent = pressenButtonNode.addComponent( BaseButton );
|
||||||
buttonComponent.init(NpkImage.main,9);
|
buttonComponent.ImgPath = NpkImage.main;
|
||||||
|
buttonComponent.NormalImgIndex = 9;
|
||||||
|
buttonComponent.HoverImgIndex = 10;
|
||||||
|
buttonComponent.PressImgIndex = 11;
|
||||||
|
buttonComponent.DisableImgIndex = 12;
|
||||||
|
|
||||||
pressenButtonNode.on(Node.EventType.MOUSE_UP,this.pressenOnTouchEnd,this);
|
pressenButtonNode.on(Node.EventType.MOUSE_UP,this.pressenOnTouchEnd,this);
|
||||||
|
|
||||||
|
|
@ -137,7 +156,7 @@ export class StartGameUINode extends Node {
|
||||||
|
|
||||||
/// 开始游戏
|
/// 开始游戏
|
||||||
startOnTouchEnd(event:Event){
|
startOnTouchEnd(event:Event){
|
||||||
const uiroot = GameRootSingleton.getInstance().UIRoot;
|
const uiroot = this.parent.getComponent( UIRoot );
|
||||||
uiroot.initGameUI();
|
uiroot.initGameUI();
|
||||||
|
|
||||||
/// 一帧结束之后销毁
|
/// 一帧结束之后销毁
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
import { _decorator, EventMouse, Node } from 'cc';
|
||||||
|
import { BaseSprite } from '../../GlobalScript/CommonComponent/BaseSprite';
|
||||||
|
import { NpkImage } from '../../Tool/NPKImage';
|
||||||
|
import { BaseButton, BaseButtonState } from '../../GlobalScript/CommonComponent/BaseButton';
|
||||||
|
import { BaseButtonAction } from '../../GlobalScript/CommonComponent/BaseButtonAction';
|
||||||
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
|
|
||||||
|
/// 投骰子按钮的整个节点
|
||||||
|
@ccclass('DiceButtonNode')
|
||||||
|
export class DiceButtonNode extends Node {
|
||||||
|
|
||||||
|
winButtonComponent: BaseButton;
|
||||||
|
spaceButtonComponent: BaseButton;
|
||||||
|
|
||||||
|
winButtonBlock: Function;
|
||||||
|
spaceDownBlock: Function;
|
||||||
|
spaceUpBlock: Function;
|
||||||
|
|
||||||
|
constructor(){
|
||||||
|
super();
|
||||||
|
|
||||||
|
const backgroundNode = new Node();
|
||||||
|
const bs = backgroundNode.addComponent( BaseSprite );
|
||||||
|
bs.updateSpriteFrame(NpkImage.ingame,7);
|
||||||
|
this.addChild(backgroundNode);
|
||||||
|
|
||||||
|
/// 其他获胜条件
|
||||||
|
const winButtonNode = new Node();
|
||||||
|
this.addChild(winButtonNode);
|
||||||
|
winButtonNode.setPosition(20.5,-123);
|
||||||
|
|
||||||
|
const winBa = winButtonNode.addComponent(BaseButtonAction);
|
||||||
|
winBa.onMouseUp = this.winOnMouseUp.bind(this);
|
||||||
|
|
||||||
|
this.winButtonComponent = winButtonNode.addComponent( BaseButton );
|
||||||
|
this.winButtonComponent.ButtonState = BaseButtonState.Disable;
|
||||||
|
this.winButtonComponent.ImgPath = NpkImage.ingame;
|
||||||
|
this.winButtonComponent.NormalImgIndex = 58;
|
||||||
|
this.winButtonComponent.HoverImgIndex = 59;
|
||||||
|
this.winButtonComponent.PressImgIndex = 60;
|
||||||
|
this.winButtonComponent.DisableImgIndex = 61;
|
||||||
|
|
||||||
|
|
||||||
|
/// space
|
||||||
|
const spaceButtonNode = new Node();
|
||||||
|
this.addChild(spaceButtonNode);
|
||||||
|
spaceButtonNode.setPosition(89,-57);
|
||||||
|
|
||||||
|
const spaceBc = spaceButtonNode.addComponent( BaseButtonAction);
|
||||||
|
spaceBc.onMouseLeftDown = this.spaceOnMouseDown.bind(this);
|
||||||
|
spaceBc.onMouseLeftUp = this.spaceOnMouseUp.bind(this);
|
||||||
|
|
||||||
|
this.spaceButtonComponent = spaceButtonNode.addComponent( BaseButton );
|
||||||
|
this.spaceButtonComponent.ButtonState = BaseButtonState.Disable;
|
||||||
|
this.spaceButtonComponent.ImgPath = NpkImage.ingame;
|
||||||
|
this.spaceButtonComponent.NormalImgIndex = 8;
|
||||||
|
this.spaceButtonComponent.HoverImgIndex = 9;
|
||||||
|
this.spaceButtonComponent.PressImgIndex = 10;
|
||||||
|
this.spaceButtonComponent.DisableImgIndex = 11;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 其他获胜条件
|
||||||
|
private winOnMouseUp(event:EventMouse){
|
||||||
|
if (this.winButtonComponent.ButtonState == BaseButtonState.Disable ) return;
|
||||||
|
if (this.winButtonBlock) this.winButtonBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 投骰子
|
||||||
|
private spaceOnMouseDown(event:EventMouse){
|
||||||
|
if (this.spaceButtonComponent.ButtonState == BaseButtonState.Disable ) return;
|
||||||
|
if (this.spaceDownBlock) this.spaceDownBlock();
|
||||||
|
}
|
||||||
|
private spaceOnMouseUp(event: EventMouse){
|
||||||
|
if (this.spaceButtonComponent.ButtonState == BaseButtonState.Disable ) return;
|
||||||
|
if (this.spaceUpBlock) this.spaceUpBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,23 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-09 17:02:06
|
|
||||||
* @LastEditTime: 2024-03-27 16:11:51
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import { _decorator, Color, Label, Node, Size, Sprite, SpriteFrame, tween, UITransform, VerticalTextAlignment } from 'cc';
|
import { _decorator, Color, Label, Node, Size, Sprite, SpriteFrame, tween, UITransform, VerticalTextAlignment } from 'cc';
|
||||||
import { BaseSprite } from '../../GlobalScript/CommonComponent/BaseSprite';
|
import { BaseSprite } from '../../GlobalScript/CommonComponent/BaseSprite';
|
||||||
import { NpkImage } from '../../Tool/NPKImage';
|
import { NpkImage } from '../../Tool/NPKImage';
|
||||||
import { BaseSpriteFrame } from '../../GlobalScript/CommonComponent/BaseSpriteFrame';
|
import { BaseSpriteFrame } from '../../GlobalScript/CommonComponent/BaseSpriteFrame';
|
||||||
import { GamerRoleType } from './GamerRoleType';
|
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
|
/// 玩家角色类型
|
||||||
|
export enum CharacterType{
|
||||||
|
/// 剑魂
|
||||||
|
JianHun = 0,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 玩家Node封装
|
/// 玩家Node封装
|
||||||
@ccclass('GamerCardNode')
|
@ccclass('Gamer')
|
||||||
export class GamerCardNode extends Node {
|
export class GamerNode extends Node {
|
||||||
|
|
||||||
/// 玩家角色类型
|
/// 玩家角色类型
|
||||||
private _characterType : GamerRoleType;
|
private _characterType : CharacterType;
|
||||||
|
|
||||||
/// 玩家名称
|
/// 玩家名称
|
||||||
private GamerNameLabel : Label;
|
private GamerNameLabel : Label;
|
||||||
|
|
@ -37,7 +34,7 @@ export class GamerCardNode extends Node {
|
||||||
|
|
||||||
private blue = new Color('00baff');
|
private blue = new Color('00baff');
|
||||||
|
|
||||||
set charchterType(type:GamerRoleType){
|
set charchterType(type:CharacterType){
|
||||||
if(!this.getChildByName('GamerCharacterNode')){
|
if(!this.getChildByName('GamerCharacterNode')){
|
||||||
this._characterType = type;
|
this._characterType = type;
|
||||||
this.initCharacterNode();
|
this.initCharacterNode();
|
||||||
|
|
@ -149,7 +146,7 @@ export class GamerCardNode extends Node {
|
||||||
|
|
||||||
/// 添加 baseSprite 组件
|
/// 添加 baseSprite 组件
|
||||||
const backgroundComponent = node.addComponent( BaseSprite );
|
const backgroundComponent = node.addComponent( BaseSprite );
|
||||||
backgroundComponent.updateSpriteFrame(NpkImage.ingame,53);
|
backgroundComponent.updateSpriteFrame(NpkImage.ingame,51);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,157 @@
|
||||||
|
import {
|
||||||
|
_decorator,
|
||||||
|
Component,
|
||||||
|
Director,
|
||||||
|
director,
|
||||||
|
Node,
|
||||||
|
UITransform,
|
||||||
|
} from "cc";
|
||||||
|
import { CharacterType, GamerNode } from "./UINode/GamerNode";
|
||||||
|
import { BaseSprite } from "../GlobalScript/CommonComponent/BaseSprite";
|
||||||
|
import { NpkImage } from "../Tool/NPKImage";
|
||||||
|
import { AnimationNode } from "../GlobalScript/Animation/AnimationNode";
|
||||||
|
import { BaseButtonState } from "../GlobalScript/CommonComponent/BaseButton";
|
||||||
|
import { DiceButtonNode } from "./UINode/DiceButtonNode";
|
||||||
|
import { OtherWinNode, otherWinType } from "./UINode/OtherWinNode";
|
||||||
|
import { BoardRoot } from "./BoardRoot";
|
||||||
|
import { StartGameUINode } from "./StartGameNode/StartGameUINode";
|
||||||
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
|
@ccclass("UIRoot")
|
||||||
|
export class UIRoot extends Component {
|
||||||
|
/// 等待玩家
|
||||||
|
private awaitGamerNode: Node;
|
||||||
|
/// 玩家一
|
||||||
|
private gamerOne: GamerNode;
|
||||||
|
/// 玩家二
|
||||||
|
private gamerTwo: GamerNode;
|
||||||
|
/// 玩家三
|
||||||
|
private gamerThree: GamerNode;
|
||||||
|
/// 投骰子按钮
|
||||||
|
private diceButton: DiceButtonNode;
|
||||||
|
/// 其他胜利条件
|
||||||
|
private otherWinNode: OtherWinNode;
|
||||||
|
|
||||||
|
/// 初始化开始游戏界面的UI
|
||||||
|
initStartGameUI() {
|
||||||
|
const startGameUINode = new StartGameUINode();
|
||||||
|
startGameUINode.addComponent(UITransform).setContentSize(1067, 600);
|
||||||
|
this.node.addChild(startGameUINode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化游戏界面UI
|
||||||
|
initGameUI() {
|
||||||
|
/// 玩家UI
|
||||||
|
this.initGamerUI();
|
||||||
|
/// 右下骰子操作按钮
|
||||||
|
this.initDiceButton();
|
||||||
|
/// 等待玩家加载
|
||||||
|
this.initAwaitGamerUI();
|
||||||
|
/// 其他胜利条件
|
||||||
|
this.initOtherNode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化玩家UI
|
||||||
|
initGamerUI() {
|
||||||
|
this.gamerOne = new GamerNode("玩家一");
|
||||||
|
this.gamerOne.setPosition(0, -540);
|
||||||
|
this.gamerOne.charchterType = CharacterType.JianHun;
|
||||||
|
this.node.addChild(this.gamerOne);
|
||||||
|
|
||||||
|
this.gamerTwo = new GamerNode("");
|
||||||
|
this.gamerTwo.setPosition(877, 0);
|
||||||
|
this.node.addChild(this.gamerTwo);
|
||||||
|
|
||||||
|
this.gamerThree = new GamerNode("");
|
||||||
|
this.node.addChild(this.gamerThree);
|
||||||
|
|
||||||
|
this.initDiceButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化等待玩家加载UI
|
||||||
|
initAwaitGamerUI() {
|
||||||
|
const node = new Node();
|
||||||
|
node.setPosition(177.5, -244.5);
|
||||||
|
this.node.addChild(node);
|
||||||
|
|
||||||
|
const spr = node.addComponent(BaseSprite);
|
||||||
|
spr.updateSpriteFrame(NpkImage.loading_loop, 0);
|
||||||
|
|
||||||
|
const ani = new AnimationNode("ani/loading_loop01.ani");
|
||||||
|
ani.setPosition(350, -110);
|
||||||
|
node.addChild(ani);
|
||||||
|
|
||||||
|
this.awaitGamerNode = node;
|
||||||
|
|
||||||
|
/// 2秒后 结束加载
|
||||||
|
setTimeout(() => {
|
||||||
|
/// 这一帧结束之后销毁
|
||||||
|
director.once(Director.EVENT_END_FRAME, () => {
|
||||||
|
// 销毁
|
||||||
|
this.awaitGamerNode.destroy();
|
||||||
|
|
||||||
|
/// 初始化开始倒计时动画
|
||||||
|
// this.initCountFontAni(5);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.aniDone();
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化倒计时动画
|
||||||
|
initCountFontAni(index: number) {
|
||||||
|
const ani = new AnimationNode("ani/dnf_quiz_" + index + ".ani", () => {
|
||||||
|
director.once(Director.EVENT_END_FRAME, () => {
|
||||||
|
ani.destroy();
|
||||||
|
});
|
||||||
|
if (index > 1) {
|
||||||
|
this.initCountFontAni(index - 1);
|
||||||
|
} else {
|
||||||
|
/// 动画结束
|
||||||
|
this.aniDone();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ani.setPosition(420, -180);
|
||||||
|
|
||||||
|
this.node.addChild(ani);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化投骰子按钮
|
||||||
|
initDiceButton() {
|
||||||
|
this.diceButton = new DiceButtonNode();
|
||||||
|
this.diceButton.setPosition(849, -453);
|
||||||
|
this.node.addChild(this.diceButton);
|
||||||
|
|
||||||
|
/// 显示其他胜利条件
|
||||||
|
this.diceButton.winButtonBlock = () => {
|
||||||
|
this.otherWinNode.active = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化其他胜利条件
|
||||||
|
initOtherNode() {
|
||||||
|
this.otherWinNode = new OtherWinNode(otherWinType.longRun);
|
||||||
|
this.node.addChild(this.otherWinNode);
|
||||||
|
|
||||||
|
this.otherWinNode.active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 动画结束
|
||||||
|
aniDone() {
|
||||||
|
/// 恢复其他胜利按钮的状态
|
||||||
|
this.diceButton.winButtonComponent.ButtonState = BaseButtonState.Normal;
|
||||||
|
/// 显示其他胜利条件
|
||||||
|
this.otherWinNode.active = true;
|
||||||
|
const boardNode = this.node.parent.getChildByName("BoardRoot");
|
||||||
|
/// 显示最底层的地图块
|
||||||
|
const board = boardNode.getComponent(BoardRoot);
|
||||||
|
board.initMapTile();
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
this.node.addComponent(UITransform).setContentSize(1067, 600);
|
||||||
|
this.initStartGameUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
update(deltaTime: number) {}
|
||||||
|
}
|
||||||
|
|
@ -1,271 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-13 12:19:50
|
|
||||||
* @LastEditTime: 2024-03-29 13:01:41
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-13 12:19:50
|
|
||||||
* @LastEditTime: 2024-03-25 14:19:53
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
EventMouse,
|
|
||||||
Node,
|
|
||||||
Sprite,
|
|
||||||
SpriteFrame,
|
|
||||||
Texture2D,
|
|
||||||
UITransform,
|
|
||||||
v2,
|
|
||||||
} from "cc";
|
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
|
||||||
import { NpkImage, NpkImageTool } from "../../Tool/NPKImage";
|
|
||||||
import {
|
|
||||||
BaseButton,
|
|
||||||
BaseButtonState,
|
|
||||||
} from "../../GlobalScript/CommonComponent/BaseButton";
|
|
||||||
import { BaseButtonAction } from "../../GlobalScript/CommonComponent/BaseButtonAction";
|
|
||||||
import { ImagePack } from "../../GlobalScript/ImagePack/ImagePack";
|
|
||||||
import { GameState } from "../../GlobalScript/GlobalGameState/GameState";
|
|
||||||
import { ImgInfo } from "../../GlobalScript/GlobalInterface/GlobalInterface";
|
|
||||||
import { GamerRoleAni, GamerRoleType } from "../Gamer/GamerRoleType";
|
|
||||||
const { ccclass } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("DiceButtonNode")
|
|
||||||
/**
|
|
||||||
* @description: 投骰子按钮的整个节点
|
|
||||||
*/
|
|
||||||
export class DiceButtonNode extends Node {
|
|
||||||
winButtonComponent: BaseButton;
|
|
||||||
diceButtonComponent: BaseButton;
|
|
||||||
|
|
||||||
winButtonBlock: Function;
|
|
||||||
diceDownBlock: Function;
|
|
||||||
diceUpBlock: Function;
|
|
||||||
|
|
||||||
gaugeAnimation: GaugeAnimation;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.initBackgroundNode();
|
|
||||||
this.initOtherWinButtonNode();
|
|
||||||
this.initdiceButtonNode();
|
|
||||||
this.initdiceDiceAniNode();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 背景节点
|
|
||||||
private initBackgroundNode(){
|
|
||||||
const backgroundNode = new Node();
|
|
||||||
const bs = backgroundNode.addComponent(BaseSprite);
|
|
||||||
bs.updateSpriteFrame(NpkImage.ingame, 7);
|
|
||||||
this.addChild(backgroundNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 其他获胜条件按钮节点
|
|
||||||
private initOtherWinButtonNode() {
|
|
||||||
/// 其他获胜条件
|
|
||||||
const winButtonNode = new Node();
|
|
||||||
this.addChild(winButtonNode);
|
|
||||||
winButtonNode.setPosition(20.5, -123);
|
|
||||||
|
|
||||||
const winBa = winButtonNode.addComponent(BaseButtonAction);
|
|
||||||
winBa.onMouseUp = this.winOnMouseUp.bind(this);
|
|
||||||
|
|
||||||
this.winButtonComponent = winButtonNode.addComponent(BaseButton);
|
|
||||||
this.winButtonComponent.init(NpkImage.ingame, 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 骰子按钮节点
|
|
||||||
private initdiceButtonNode() {
|
|
||||||
/// dice 按钮
|
|
||||||
const diceButtonNode = new Node('diceButton');
|
|
||||||
this.addChild(diceButtonNode);
|
|
||||||
diceButtonNode.setPosition(89, -57);
|
|
||||||
|
|
||||||
const diceBc = diceButtonNode.addComponent(BaseButtonAction);
|
|
||||||
diceBc.onMouseLeftDown = this.diceOnMouseDown.bind(this);
|
|
||||||
diceBc.onMouseLeftUp = this.diceOnMouseUp.bind(this);
|
|
||||||
|
|
||||||
this.diceButtonComponent = diceButtonNode.addComponent(BaseButton);
|
|
||||||
this.diceButtonComponent.init(NpkImage.ingame, 8);
|
|
||||||
this.diceButtonComponent.ButtonState = BaseButtonState.Disable;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 播放动画节点
|
|
||||||
private initdiceDiceAniNode() {
|
|
||||||
const node = new Node();
|
|
||||||
this.addChild(node);
|
|
||||||
node.setPosition(45, -15);
|
|
||||||
|
|
||||||
//设置节点锚点为左上角
|
|
||||||
node.addComponent(UITransform).anchorPoint = v2(0, 1);
|
|
||||||
this.gaugeAnimation = node.addComponent(GaugeAnimation);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 其他获胜条件
|
|
||||||
private winOnMouseUp(event: EventMouse) {
|
|
||||||
if (this.winButtonComponent.ButtonState == BaseButtonState.Disable) return;
|
|
||||||
if (this.winButtonBlock) this.winButtonBlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 投骰子
|
|
||||||
private diceOnMouseDown(event: EventMouse) {
|
|
||||||
console.log('diceOnMouseDown');
|
|
||||||
if (this.diceButtonComponent.ButtonState == BaseButtonState.Disable)
|
|
||||||
return;
|
|
||||||
if (this.diceDownBlock) this.diceDownBlock();
|
|
||||||
this.gaugeAnimation.updatePlayState(PlayAniState.playing);
|
|
||||||
}
|
|
||||||
private diceOnMouseUp(event: EventMouse) {
|
|
||||||
console.log('diceOnMouseUp');
|
|
||||||
if (this.diceButtonComponent.ButtonState == BaseButtonState.Disable)
|
|
||||||
return;
|
|
||||||
if (this.diceUpBlock) this.diceUpBlock();
|
|
||||||
this.gaugeAnimation.updatePlayState(PlayAniState.pause);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//* ─── 动画播放 ────────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
export enum PlayAniState {
|
|
||||||
//未播放
|
|
||||||
unplayed,
|
|
||||||
//播放中
|
|
||||||
playing,
|
|
||||||
//倒放
|
|
||||||
reversed,
|
|
||||||
//暂停
|
|
||||||
pause,
|
|
||||||
//播放完成
|
|
||||||
done,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 骰子按钮动画
|
|
||||||
*/
|
|
||||||
export class GaugeAnimation extends Component {
|
|
||||||
// 所有精灵帧缓存
|
|
||||||
private frameMap: Map<number, SpriteFrame> = new Map<number, SpriteFrame>();
|
|
||||||
|
|
||||||
// 精灵帧的数量
|
|
||||||
private frameCount: number = 100;
|
|
||||||
|
|
||||||
// 精灵帧初始化状态
|
|
||||||
private InitState: boolean = false;
|
|
||||||
|
|
||||||
// 总的播放时间
|
|
||||||
private aniTime: number = 1;
|
|
||||||
|
|
||||||
// 当前帧显示时间
|
|
||||||
private nowFrameTime: number = 0;
|
|
||||||
|
|
||||||
// 每一帧需要显示的时间
|
|
||||||
private frameShowTime: number = 0;
|
|
||||||
|
|
||||||
// 当前帧
|
|
||||||
private nowFrameIndex: number = -1;
|
|
||||||
|
|
||||||
//* 动画状态
|
|
||||||
private playState: PlayAniState = PlayAniState.unplayed;
|
|
||||||
|
|
||||||
// 节点的精灵
|
|
||||||
private sprite: Sprite;
|
|
||||||
|
|
||||||
onLoad() {
|
|
||||||
if (!this.node.getComponent(Sprite)) {
|
|
||||||
this.sprite = this.node.addComponent(Sprite);
|
|
||||||
} else {
|
|
||||||
this.sprite = this.node.getComponent(Sprite);
|
|
||||||
}
|
|
||||||
|
|
||||||
//设置类型
|
|
||||||
this.sprite.sizeMode = Sprite.SizeMode.RAW;
|
|
||||||
//设置
|
|
||||||
this.sprite.trim = false;
|
|
||||||
|
|
||||||
NpkImageTool.GetNpkImageAll(NpkImage.gauge, (count,frameMap)=>{
|
|
||||||
this.frameMap = frameMap;
|
|
||||||
this.frameCount = count;
|
|
||||||
this.InitState = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 刷新动画状态
|
|
||||||
* @param {PlayAniState} palyState: 动画状态
|
|
||||||
* @param {number} aniTime:播放动画时需要传入 动画的播放时间
|
|
||||||
*/
|
|
||||||
updatePlayState(palyState: PlayAniState, aniTime?: number) {
|
|
||||||
this.playState = palyState;
|
|
||||||
|
|
||||||
// 数据的初始化
|
|
||||||
if (this.playState == PlayAniState.unplayed) {
|
|
||||||
this.sprite.spriteFrame = null;
|
|
||||||
this.nowFrameIndex = -1;
|
|
||||||
} else if (
|
|
||||||
this.playState == (PlayAniState.playing || PlayAniState.reversed)
|
|
||||||
) {
|
|
||||||
this.aniTime = aniTime ?? this.aniTime;
|
|
||||||
// 单帧显示时间
|
|
||||||
this.frameShowTime = this.aniTime * 1000 / this.frameCount;
|
|
||||||
// this.frameShowTime = this.frameShowTime / this.frameCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 精灵帧的初始化
|
|
||||||
if (this.playState == PlayAniState.playing) {
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(0);
|
|
||||||
} else if (this.playState == PlayAniState.reversed) {
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(this.frameCount - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
update(dt: number) {
|
|
||||||
|
|
||||||
//如果游戏世界处于暂停的模式下 不再继续播放
|
|
||||||
if (GameState.getInstance().IsPauseState()) return;
|
|
||||||
//如果初始化未完成,不播放
|
|
||||||
if (!this.InitState) return;
|
|
||||||
//如果不在播放中
|
|
||||||
if (this.playState != PlayAniState.playing && this.playState != PlayAniState.reversed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
//每帧增加过去的时间 取千分之一秒为单位
|
|
||||||
this.nowFrameTime += Math.trunc(dt * 1000);
|
|
||||||
|
|
||||||
// 计算当前加减帧数
|
|
||||||
const index = Math.trunc(this.nowFrameTime / this.frameShowTime);
|
|
||||||
// 当前帧时间不足 一帧显示就跳过
|
|
||||||
if (index < 1) return;
|
|
||||||
|
|
||||||
// 将多余的时间 重新赋值回去
|
|
||||||
this.nowFrameTime = this.nowFrameTime % this.frameShowTime;
|
|
||||||
|
|
||||||
if (this.playState == PlayAniState.playing) {
|
|
||||||
this.nowFrameIndex += index
|
|
||||||
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(this.nowFrameIndex);
|
|
||||||
|
|
||||||
// 播放到最后一帧 修改播放状态 为倒放
|
|
||||||
if (this.nowFrameIndex >= this.frameCount - 1) {
|
|
||||||
this.playState = PlayAniState.reversed;
|
|
||||||
}
|
|
||||||
} else if (this.playState == PlayAniState.reversed) {
|
|
||||||
this.nowFrameIndex -= index;
|
|
||||||
|
|
||||||
this.sprite.spriteFrame = this.frameMap.get(this.nowFrameIndex);
|
|
||||||
|
|
||||||
// 播放到第一帧 修改播放状态 为倒放
|
|
||||||
if (this.nowFrameIndex <= 0) {
|
|
||||||
this.playState = PlayAniState.playing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-29 13:20:16
|
|
||||||
* @LastEditTime: 2024-03-29 14:16:51
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 游戏匹配过程控制
|
|
||||||
*/
|
|
||||||
import { _decorator, Component, Director, director, Node } from "cc";
|
|
||||||
import { UIRoot } from "./UIRoot";
|
|
||||||
import { GameRootSingleton } from "./../GameRootController";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("GameMatchingProcessControl")
|
|
||||||
/**
|
|
||||||
* @description: 游戏匹配过程控制
|
|
||||||
*/
|
|
||||||
export class GameMatchingProcessControl extends Component {
|
|
||||||
/** UIRoot 节点的 UI节点 */
|
|
||||||
uiRoot: UIRoot;
|
|
||||||
|
|
||||||
start() {
|
|
||||||
this.uiRoot = GameRootSingleton.getInstance().UIRoot;
|
|
||||||
|
|
||||||
this.countDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
//todo 自动跳过,接入网络后修改
|
|
||||||
/** 匹配加载动画控制 */
|
|
||||||
countDown() {
|
|
||||||
|
|
||||||
// 1秒后 结束加载
|
|
||||||
setTimeout(() => {
|
|
||||||
/// 这一帧结束之后销毁
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
// 销毁
|
|
||||||
this.uiRoot.awaitGamerNode.destroy();
|
|
||||||
|
|
||||||
// todo 开发时跳过倒计时动画
|
|
||||||
/// 初始化开始倒计时动画
|
|
||||||
// this.initCountDownFontAni(5);
|
|
||||||
});
|
|
||||||
|
|
||||||
// todo 开发时跳过倒计时动画
|
|
||||||
this.uiRoot.countDownAniDone();
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "79e2c1f6-7206-4356-82a5-09f3d1039dff",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-29 14:04:56
|
|
||||||
* @LastEditTime: 2024-03-29 14:14:48
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 玩家角色控制
|
|
||||||
*/
|
|
||||||
import { _decorator, Component, Node } from "cc";
|
|
||||||
import { GamerRoleNode } from "../Gamer/GamerRoleNode";
|
|
||||||
import { GamerRoleType } from "../Gamer/GamerRoleType";
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("GameRoleController")
|
|
||||||
/**
|
|
||||||
* @description: 玩家角色控制
|
|
||||||
*/
|
|
||||||
export class GameRoleController extends Component {
|
|
||||||
/** 玩家 1 角色 */
|
|
||||||
oneRole: GamerRoleNode;
|
|
||||||
/** 玩家 2 角色 */
|
|
||||||
twoRole: GamerRoleNode;
|
|
||||||
/** 玩家 3 角色 */
|
|
||||||
threeRole: GamerRoleNode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 初始化角色
|
|
||||||
* @param oneRoleType : 玩家 1
|
|
||||||
* @param twoRoleType : 玩家 2
|
|
||||||
* @param threeRoleType : 玩家 3
|
|
||||||
*/
|
|
||||||
initRole(
|
|
||||||
oneRoleType: GamerRoleType,
|
|
||||||
twoRoleType: GamerRoleType,
|
|
||||||
threeRoleType: GamerRoleType
|
|
||||||
) {
|
|
||||||
this.oneRole = new GamerRoleNode(oneRoleType);
|
|
||||||
this.twoRole = new GamerRoleNode(twoRoleType);
|
|
||||||
this.threeRole = new GamerRoleNode(threeRoleType);
|
|
||||||
|
|
||||||
this.node.addChild(this.oneRole);
|
|
||||||
this.node.addChild(this.twoRole);
|
|
||||||
this.node.addChild(this.threeRole);
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "80141aea-c2a5-4eab-8430-59484a333bf1",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,178 +0,0 @@
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Director,
|
|
||||||
director,
|
|
||||||
Node,
|
|
||||||
UITransform,
|
|
||||||
} from "cc";
|
|
||||||
import { GamerCardNode } from "./../Gamer/GamerCardNode";
|
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
|
||||||
import { AnimationNode } from "../../GlobalScript/Animation/AnimationNode";
|
|
||||||
import { BaseButtonState } from "../../GlobalScript/CommonComponent/BaseButton";
|
|
||||||
import { DiceButtonNode } from "../UIRoot/DiceButtonNode";
|
|
||||||
import { OtherWinNode, otherWinType } from "../UIRoot/OtherWinNode";
|
|
||||||
import { BoardRoot } from "../BoardRoot";
|
|
||||||
import { StartGameUINode } from "../StartGameNode/StartGameUINode";
|
|
||||||
import { GamerRoleType } from "../Gamer/GamerRoleType";
|
|
||||||
import { SelectNumberNode } from "../DialogRoot/SelectNumberNode";
|
|
||||||
const { ccclass } = _decorator;
|
|
||||||
|
|
||||||
@ccclass("UIRoot")
|
|
||||||
/**
|
|
||||||
* @description: UIRoot节点的 UI 初始化
|
|
||||||
*/
|
|
||||||
export class UIRoot extends Component {
|
|
||||||
/** 玩家一 */
|
|
||||||
private gamerCardOne: GamerCardNode;
|
|
||||||
/** 玩家二 */
|
|
||||||
private gamerCardTwo: GamerCardNode;
|
|
||||||
/** 玩家三 */
|
|
||||||
private gamerCardThree: GamerCardNode;
|
|
||||||
|
|
||||||
/** 等待玩家 */
|
|
||||||
awaitGamerNode: Node;
|
|
||||||
/** 投骰子按钮 */
|
|
||||||
diceButton: DiceButtonNode;
|
|
||||||
/** 其他胜利条件 */
|
|
||||||
otherWinNode: OtherWinNode;
|
|
||||||
|
|
||||||
// ─── 初始化ui ───────────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/** 初始化开始游戏界面的UI */
|
|
||||||
initStartGameUI() {
|
|
||||||
const startGameUINode = new StartGameUINode();
|
|
||||||
startGameUINode.addComponent(UITransform).setContentSize(1067, 600);
|
|
||||||
this.node.addChild(startGameUINode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化游戏界面UI */
|
|
||||||
initGameUI() {
|
|
||||||
/// 玩家UI
|
|
||||||
this.initGamerUI();
|
|
||||||
/// 右下骰子操作按钮
|
|
||||||
this.initDiceButton();
|
|
||||||
/// 等待玩家加载
|
|
||||||
this.initAwaitGamerUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化玩家卡片 UI */
|
|
||||||
private initGamerUI() {
|
|
||||||
this.gamerCardOne = new GamerCardNode("玩家一");
|
|
||||||
this.gamerCardOne.setPosition(0, -540);
|
|
||||||
this.gamerCardOne.charchterType = GamerRoleType.JianHun;
|
|
||||||
this.node.addChild(this.gamerCardOne);
|
|
||||||
|
|
||||||
this.gamerCardTwo = new GamerCardNode("");
|
|
||||||
this.gamerCardTwo.setPosition(877, 0);
|
|
||||||
this.node.addChild(this.gamerCardTwo);
|
|
||||||
|
|
||||||
this.gamerCardThree = new GamerCardNode("");
|
|
||||||
this.node.addChild(this.gamerCardThree);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化骰子节点 */
|
|
||||||
private initDiceButton() {
|
|
||||||
this.diceButton = new DiceButtonNode();
|
|
||||||
this.diceButton.setPosition(849, -453);
|
|
||||||
this.node.addChild(this.diceButton);
|
|
||||||
|
|
||||||
/// 显示其他胜利条件
|
|
||||||
this.diceButton.winButtonBlock = () => {
|
|
||||||
this.otherWinNode.active = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.diceButton.diceUpBlock = () => {};
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化其他胜利条件 */
|
|
||||||
initOtherWinNode(type: otherWinType) {
|
|
||||||
if (!this.otherWinNode) {
|
|
||||||
this.otherWinNode = new OtherWinNode(type);
|
|
||||||
this.node.addChild(this.otherWinNode);
|
|
||||||
|
|
||||||
this.otherWinNode.active = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化并显示顺序选择node */
|
|
||||||
initSelectNumberNode(): SelectNumberNode {
|
|
||||||
const selectNode = new SelectNumberNode();
|
|
||||||
this.node.addChild(selectNode);
|
|
||||||
return selectNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── 动画初始化 ──────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
/** 初始化等待玩家加载UI */
|
|
||||||
initAwaitGamerUI() {
|
|
||||||
const node = new Node();
|
|
||||||
node.setPosition(177.5, -244.5);
|
|
||||||
this.node.addChild(node);
|
|
||||||
|
|
||||||
const spr = node.addComponent(BaseSprite);
|
|
||||||
spr.updateSpriteFrame(NpkImage.loading_loop, 0);
|
|
||||||
|
|
||||||
const ani = new AnimationNode("ani/loading_loop01.ani");
|
|
||||||
ani.setPosition(350, -110);
|
|
||||||
node.addChild(ani);
|
|
||||||
|
|
||||||
this.awaitGamerNode = node;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 初始化倒计时动画 */
|
|
||||||
initCountDownFontAni(index: number) {
|
|
||||||
const ani = new AnimationNode("ani/count_font.ani", () => {
|
|
||||||
/// 这一帧结束之后销毁
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
// 销毁
|
|
||||||
ani.destroy();
|
|
||||||
});
|
|
||||||
/// 动画结束
|
|
||||||
this.countDownAniDone();
|
|
||||||
});
|
|
||||||
ani.setPosition(500, -200);
|
|
||||||
|
|
||||||
this.node.addChild(ani);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 倒计时动画结束 */
|
|
||||||
countDownAniDone() {
|
|
||||||
/// 恢复其他胜利按钮的状态
|
|
||||||
this.diceButton.winButtonComponent.ButtonState = BaseButtonState.Normal;
|
|
||||||
|
|
||||||
/// 显示其他胜利条件
|
|
||||||
this.otherWinNode.active = true;
|
|
||||||
const boardNode = this.node.parent.getChildByName("BoardRoot");
|
|
||||||
|
|
||||||
/// 显示最底层的地图块
|
|
||||||
const board = boardNode.getComponent(BoardRoot);
|
|
||||||
board.initMapTile();
|
|
||||||
|
|
||||||
// 1秒后自动关闭胜利条件显示,并显示顺序选择
|
|
||||||
setTimeout(() => {
|
|
||||||
// 隐藏其他胜利条件 node
|
|
||||||
this.otherWinNode.active = false;
|
|
||||||
|
|
||||||
const select = this.initSelectNumberNode();
|
|
||||||
|
|
||||||
select.doneFunc = () => {
|
|
||||||
// todo 开发阶段在选择顺序结束后,恢复骰子按钮状态
|
|
||||||
this.diceButton.diceButtonComponent.ButtonState =
|
|
||||||
BaseButtonState.Normal;
|
|
||||||
};
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── 生命周期 ────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
start() {
|
|
||||||
this.node.addComponent(UITransform).setContentSize(1067, 600);
|
|
||||||
|
|
||||||
/// 初始化 开始游戏 的 UI
|
|
||||||
this.initStartGameUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,145 +0,0 @@
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-21 13:44:57
|
|
||||||
* @LastEditTime: 2024-03-25 19:42:52
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-21 13:44:57
|
|
||||||
* @LastEditTime: 2024-03-23 12:57:36
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description: 倒计时进度
|
|
||||||
*/
|
|
||||||
import {
|
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Director,
|
|
||||||
director,
|
|
||||||
Node,
|
|
||||||
ProgressBar,
|
|
||||||
Sprite,
|
|
||||||
tween,
|
|
||||||
UITransform,
|
|
||||||
v2,
|
|
||||||
} from "cc";
|
|
||||||
import { BaseSprite } from "../../GlobalScript/CommonComponent/BaseSprite";
|
|
||||||
import { NpkImage } from "../../Tool/NPKImage";
|
|
||||||
import { LocationImportComponent } from "../../GlobalScript/CommonComponent/LocationImportComponent";
|
|
||||||
const { ccclass } = _decorator;
|
|
||||||
|
|
||||||
/// 倒计时时间进度Node
|
|
||||||
@ccclass("TimingProgressBar")
|
|
||||||
export class TimingProgressBar extends Node {
|
|
||||||
//* 进度条bar
|
|
||||||
progressBar: ProgressBar;
|
|
||||||
//* 进度条精灵
|
|
||||||
barSprite: Sprite;
|
|
||||||
|
|
||||||
//* 缓动控制
|
|
||||||
timingComponent: TimingComponent;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.setPosition(353.5, -355);
|
|
||||||
this.addComponent(UITransform).anchorPoint = v2(0, 1);
|
|
||||||
|
|
||||||
this.timingComponent = this.addComponent(TimingComponent);
|
|
||||||
|
|
||||||
this.initBackgrund();
|
|
||||||
this.initBarSprite();
|
|
||||||
this.initProgressBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
//* 倒计时缓动开始
|
|
||||||
/**
|
|
||||||
* @description:
|
|
||||||
* @param {number} time: 时间
|
|
||||||
* @param {Function} back: 缓动完成回调
|
|
||||||
*/
|
|
||||||
tweenerStart(time:number,back:Function){
|
|
||||||
this.timingComponent.tweenerStart(time,back);
|
|
||||||
}
|
|
||||||
|
|
||||||
initBackgrund() {
|
|
||||||
const bs = this.addComponent(BaseSprite);
|
|
||||||
bs.updateSpriteFrame(NpkImage.ingame, 43);
|
|
||||||
}
|
|
||||||
|
|
||||||
initProgressBar() {
|
|
||||||
const progressBar = this.addComponent(ProgressBar);
|
|
||||||
progressBar.barSprite = this.barSprite;
|
|
||||||
progressBar.mode = ProgressBar.Mode.FILLED;
|
|
||||||
progressBar.totalLength = 280;
|
|
||||||
progressBar.progress = 1;
|
|
||||||
this.progressBar = progressBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
initBarSprite() {
|
|
||||||
const node = new Node();
|
|
||||||
this.addChild(node);
|
|
||||||
node.setPosition(60, -22);
|
|
||||||
|
|
||||||
const barNode = new Node();
|
|
||||||
node.addChild(barNode);
|
|
||||||
this.barSprite = barNode.addComponent(Sprite);
|
|
||||||
|
|
||||||
const bs = barNode.addComponent(BaseSprite);
|
|
||||||
bs.updateSpriteFrame(NpkImage.ingame, 45);
|
|
||||||
|
|
||||||
this.barSprite = bs.SpriteObj;
|
|
||||||
this.barSprite.spriteFrame = bs.SpriteObj.spriteFrame;
|
|
||||||
this.barSprite.type = Sprite.Type.FILLED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ccclass("TimingComponent")
|
|
||||||
export class TimingComponent extends Component {
|
|
||||||
|
|
||||||
|
|
||||||
obj = { progress: 1};
|
|
||||||
|
|
||||||
onCompleteBack: Function;
|
|
||||||
|
|
||||||
start() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
tweenerStart(time:number,back:Function){
|
|
||||||
|
|
||||||
this.onCompleteBack = back;
|
|
||||||
|
|
||||||
tween(this.obj)
|
|
||||||
.to(
|
|
||||||
time,
|
|
||||||
{ progress: 0 },
|
|
||||||
{
|
|
||||||
easing: "linear",
|
|
||||||
onUpdate: this.onUpdate.bind(this),
|
|
||||||
onComplete: this.onComplete.bind(this),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
//* 缓动进度
|
|
||||||
onUpdate(target: any, ratio: number){
|
|
||||||
const timingProgressBar: TimingProgressBar = this.node as TimingProgressBar;
|
|
||||||
timingProgressBar.progressBar.progress = this.obj.progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
//* 缓动完成
|
|
||||||
onComplete(){
|
|
||||||
this.obj.progress = 1;
|
|
||||||
this.onCompleteBack();
|
|
||||||
/// 这一帧结束之后销毁
|
|
||||||
director.once(Director.EVENT_END_FRAME, () => {
|
|
||||||
// 销毁
|
|
||||||
this.node.destroy();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
update(deltaTime: number) {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "4.0.23",
|
|
||||||
"importer": "typescript",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "f93a24df-e11c-4c40-a67f-9d1e61d67547",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
|
|
@ -5,9 +5,6 @@ import { BaseButtonAction } from '../../GlobalScript/CommonComponent/BaseButtonA
|
||||||
const { ccclass } = _decorator;
|
const { ccclass } = _decorator;
|
||||||
|
|
||||||
@ccclass('CloseButtonNode')
|
@ccclass('CloseButtonNode')
|
||||||
/**
|
|
||||||
* @description: x按钮node
|
|
||||||
*/
|
|
||||||
export class CloseButtonNode extends Node {
|
export class CloseButtonNode extends Node {
|
||||||
|
|
||||||
constructor(onMouseLeftUp?:Function){
|
constructor(onMouseLeftUp?:Function){
|
||||||
|
|
@ -15,7 +12,11 @@ export class CloseButtonNode extends Node {
|
||||||
|
|
||||||
/// 给节点添加 button 组件
|
/// 给节点添加 button 组件
|
||||||
const buttonComponent = this.addComponent( BaseButton );
|
const buttonComponent = this.addComponent( BaseButton );
|
||||||
buttonComponent.init(NpkImage.ingame,39);
|
buttonComponent.ImgPath = NpkImage.ingame;
|
||||||
|
buttonComponent.NormalImgIndex = 39;
|
||||||
|
buttonComponent.HoverImgIndex = 40;
|
||||||
|
buttonComponent.PressImgIndex = 41;
|
||||||
|
buttonComponent.DisableImgIndex = 42;
|
||||||
|
|
||||||
/// 添加点击事件
|
/// 添加点击事件
|
||||||
const bba = this.addComponent( BaseButtonAction );
|
const bba = this.addComponent( BaseButtonAction );
|
||||||
|
|
|
||||||
|
|
@ -1,121 +1,45 @@
|
||||||
/*
|
const path = 'interface2/event/chn_event_2020/200922_dnf_marble/'
|
||||||
* @Author: WoNiu
|
|
||||||
* @Date: 2024-03-10 20:00:57
|
|
||||||
* @LastEditTime: 2024-03-29 12:57:23
|
|
||||||
* @LastEditors: WoNiu
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { SpriteFrame, Texture2D, v2 } from "cc";
|
|
||||||
import { ImagePack } from "../GlobalScript/ImagePack/ImagePack";
|
|
||||||
import { ImgInfo } from "../GlobalScript/GlobalInterface/GlobalInterface";
|
|
||||||
|
|
||||||
/** interface2/event/chn_event_2020/200922_dnf_marble/ */
|
|
||||||
export const NpkImagePath =
|
|
||||||
"interface2/event/chn_event_2020/200922_dnf_marble/";
|
|
||||||
|
|
||||||
export enum NpkImage {
|
export enum NpkImage {
|
||||||
main = NpkImagePath + "00_main.img",
|
main = path + '00_main.img',
|
||||||
ingame = NpkImagePath + "01_ingame.img",
|
ingame = path + '01_ingame.img',
|
||||||
board = NpkImagePath + "02_board.img",
|
board = path + '02_board.img',
|
||||||
gauge = NpkImagePath + "03_gauge.img",
|
gauge = path + '03_gauge.img',
|
||||||
character_sd = NpkImagePath + "04_character_sd.img",
|
character_sd = path + '04_character_sd.img',
|
||||||
monsternotice = NpkImagePath + "05_monsternotice.img",
|
monsternotice = path + '05_monsternotice.img',
|
||||||
specialplace = NpkImagePath + "06_specialplace.img",
|
specialplace = path + '06_specialplace.img',
|
||||||
conditionsofvictory = NpkImagePath + "07_conditionsofvictory.img",
|
conditionsofvictory = path + '07_conditionsofvictory.img',
|
||||||
calendar = NpkImagePath + "08_calendar.img",
|
calendar = path + '08_calendar.img',
|
||||||
bankruptcy = NpkImagePath + "bankruptcy.img",
|
bankruptcy = path + 'bankruptcy.img',
|
||||||
character_loop = NpkImagePath + "character_loop.img",
|
character_loop = path + 'character_loop.img',
|
||||||
count_font = NpkImagePath + "count_font.img",
|
count_font = path + 'count_font.img',
|
||||||
dice_1x1_db = NpkImagePath + "dice_1x1_db.img",
|
dice_1x1_db = path + 'dice_1x1_db.img',
|
||||||
dice_1x2 = NpkImagePath + "dice_1x2.img",
|
dice_1x2 = path + 'dice_1x2.img',
|
||||||
dice_1x3 = NpkImagePath + "dice_1x3.img",
|
dice_1x3 = path + 'dice_1x3.img',
|
||||||
dice_2x2_db = NpkImagePath + "dice_2x2_db.img",
|
dice_2x2_db = path + 'dice_2x2_db.img',
|
||||||
dice_2x3 = NpkImagePath + "dice_2x3.img",
|
dice_2x3 = path + 'dice_2x3.img',
|
||||||
dice_2x4 = NpkImagePath + "dice_2x4.img",
|
dice_2x4 = path + 'dice_2x4.img',
|
||||||
dice_3x3_db = NpkImagePath + "dice_3x3_db.img",
|
dice_3x3_db = path + 'dice_3x3_db.img',
|
||||||
dice_3x4 = NpkImagePath + "dice_3x4.img",
|
dice_3x4 = path + 'dice_3x4.img',
|
||||||
dice_3x5 = NpkImagePath + "dice_3x5.img",
|
dice_3x5 = path + 'dice_3x5.img',
|
||||||
dice_4x4_db = NpkImagePath + "dice_4x4_db.img",
|
dice_4x4_db = path + 'dice_4x4_db.img',
|
||||||
dice_4x5 = NpkImagePath + "dice_4x5.img",
|
dice_4x5 = path + 'dice_4x5.img',
|
||||||
dice_4x6 = NpkImagePath + "dice_4x6.img",
|
dice_4x6 = path + 'dice_4x6.img',
|
||||||
dice_5x5 = NpkImagePath + "dice_5x5.img",
|
dice_5x5 = path + 'dice_5x5.img',
|
||||||
dice_5x6 = NpkImagePath + "dice_5x6.img",
|
dice_5x6 = path + 'dice_5x6.img',
|
||||||
dice_6x6_db = NpkImagePath + "dice_6x6_db.img",
|
dice_6x6_db = path + 'dice_6x6_db.img',
|
||||||
dice_font = NpkImagePath + "dice_font.img",
|
dice_font = path + 'dice_font.img',
|
||||||
dungeonbg = NpkImagePath + "dungeonbg.img",
|
dungeonbg = path + 'dungeonbg.img',
|
||||||
fire_loop = NpkImagePath + "fire_loop.img",
|
fire_loop = path + 'fire_loop.img',
|
||||||
light01 = NpkImagePath + "light01.img",
|
light01 = path + 'light01.img',
|
||||||
light02 = NpkImagePath + "light02.img",
|
light02 = path + 'light02.img',
|
||||||
loading_loop = NpkImagePath + "loading_loop.img",
|
loading_loop = path + 'loading_loop.img',
|
||||||
luckycoin = NpkImagePath + "luckycoin.img",
|
luckycoin = path + 'luckycoin.img',
|
||||||
luckycoin_bg = NpkImagePath + "luckycoin_bg.img",
|
luckycoin_bg = path + 'luckycoin_bg.img',
|
||||||
point_loop = NpkImagePath + "point_loop.img",
|
point_loop = path + 'point_loop.img',
|
||||||
table_back = NpkImagePath + "table_back.img",
|
table_back = path + 'table_back.img',
|
||||||
table_dodge = NpkImagePath + "table_dodge.img",
|
table_dodge = path + 'table_dodge.img',
|
||||||
table_front = NpkImagePath + "table_front.img",
|
table_front = path + 'table_front.img',
|
||||||
title_loop = NpkImagePath + "title_loop.img",
|
title_loop = path + 'title_loop.img',
|
||||||
win = NpkImagePath + "win.img",
|
win = path + 'win.img',
|
||||||
}
|
};
|
||||||
|
|
||||||
interface NpkImageCallback{
|
|
||||||
/**
|
|
||||||
* @param {number} frameCount:精灵帧总数量
|
|
||||||
* @param {Map<number, SpriteFrame>} frameMap:所有精灵帧Map
|
|
||||||
*/
|
|
||||||
(frameCount: number, frameMap: Map<number, SpriteFrame>): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class NpkImageTool {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 获取Npk path路径下的所有 图片
|
|
||||||
* @param {string} path:读取路径
|
|
||||||
* @param {Function} callBack:回调((frameCount, frameMap)(number, Map<number, SpriteFrame>)
|
|
||||||
*/
|
|
||||||
static GetNpkImageAll(path: string, callBack: NpkImageCallback) {
|
|
||||||
// 精灵帧总数
|
|
||||||
let frameCount = 0;
|
|
||||||
// 精灵帧缓存
|
|
||||||
let frameMap: Map<number, SpriteFrame> = new Map<number, SpriteFrame>();
|
|
||||||
|
|
||||||
ImagePack.getInstance().ReadNpkTable(
|
|
||||||
"sprite/" + path.toLocaleLowerCase(),
|
|
||||||
(ImgObj: { Png_List: [ImgInfo]; Png_Count: number; }) => {
|
|
||||||
const Pngs = ImgObj.Png_List;
|
|
||||||
// 总数量
|
|
||||||
frameCount = ImgObj.Png_Count;
|
|
||||||
|
|
||||||
for (let i = 0; i < Pngs.length; i++) {
|
|
||||||
const png = Pngs[i];
|
|
||||||
const spriteFrame = NpkImageTool.initSpriteFrame(png);
|
|
||||||
frameMap.set(i, spriteFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
callBack(frameCount, frameMap);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description:根据拿到的数据 初始化精灵帧
|
|
||||||
* @param {ImgInfo} Png: 动画数据
|
|
||||||
*/
|
|
||||||
static initSpriteFrame(Png: ImgInfo): SpriteFrame {
|
|
||||||
const spriteFrame = new SpriteFrame();
|
|
||||||
let tex = new Texture2D();
|
|
||||||
tex.reset({
|
|
||||||
width: Png.Width,
|
|
||||||
height: Png.Height,
|
|
||||||
format: Texture2D.PixelFormat.RGBA8888,
|
|
||||||
mipmapLevel: 0,
|
|
||||||
});
|
|
||||||
tex.uploadData(Png.PNGdata);
|
|
||||||
// 更新 0 级 Mipmap。
|
|
||||||
tex.updateImage();
|
|
||||||
spriteFrame.texture = tex;
|
|
||||||
spriteFrame.offset = v2(Png.Xpos, -Png.Ypos);
|
|
||||||
|
|
||||||
return spriteFrame;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { _decorator, Component, director } from 'cc';
|
import { _decorator, Component, director, instantiate, Node, Prefab, resources, Scene } from 'cc';
|
||||||
import { GlobalAudio } from '../../GlobalScript/GlobalAudio/GlobalAudio';
|
import { GlobalAudio } from '../../GlobalScript/GlobalAudio/GlobalAudio';
|
||||||
import { ImagePack } from '../../GlobalScript/ImagePack/ImagePack';
|
import { ImagePack } from '../../GlobalScript/ImagePack/ImagePack';
|
||||||
import { GameScript } from '../../GlobalScript/GameScript/GameScript';
|
import { GameScript } from '../../GlobalScript/GameScript/GameScript';
|
||||||
|
import { UIRoot } from '../../Script/UIRoot';
|
||||||
|
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,7 @@
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [],
|
"_components": [],
|
||||||
"_prefab": {
|
"_prefab": null,
|
||||||
"__id__": 19
|
|
||||||
},
|
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
|
|
@ -54,7 +52,7 @@
|
||||||
},
|
},
|
||||||
"autoReleaseAssets": false,
|
"autoReleaseAssets": false,
|
||||||
"_globals": {
|
"_globals": {
|
||||||
"__id__": 20
|
"__id__": 25
|
||||||
},
|
},
|
||||||
"_id": "efb7fd68-0786-4a0e-8e5d-46841ad6023c"
|
"_id": "efb7fd68-0786-4a0e-8e5d-46841ad6023c"
|
||||||
},
|
},
|
||||||
|
|
@ -78,21 +76,27 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 11
|
"__id__": 11
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 18
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 15
|
"__id__": 21
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 16
|
"__id__": 22
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 17
|
"__id__": 23
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 18
|
"__id__": 24
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": null,
|
"_prefab": null,
|
||||||
|
|
@ -184,7 +188,7 @@
|
||||||
"_priority": 0,
|
"_priority": 0,
|
||||||
"_fov": 45,
|
"_fov": 45,
|
||||||
"_fovAxis": 0,
|
"_fovAxis": 0,
|
||||||
"_orthoHeight": 473.21751412429376,
|
"_orthoHeight": 346.1673212882954,
|
||||||
"_near": 0,
|
"_near": 0,
|
||||||
"_far": 1000,
|
"_far": 1000,
|
||||||
"_color": {
|
"_color": {
|
||||||
|
|
@ -558,6 +562,250 @@
|
||||||
"__prefab": null,
|
"__prefab": null,
|
||||||
"_id": "feJdyZgTlBtLnL5U4x8Hwh"
|
"_id": "feJdyZgTlBtLnL5U4x8Hwh"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "Label",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"_parent": {
|
||||||
|
"__id__": 2
|
||||||
|
},
|
||||||
|
"_children": [],
|
||||||
|
"_active": false,
|
||||||
|
"_components": [
|
||||||
|
{
|
||||||
|
"__id__": 16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 17
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_prefab": null,
|
||||||
|
"_lpos": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 460.781,
|
||||||
|
"y": -273,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_lrot": {
|
||||||
|
"__type__": "cc.Quat",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0,
|
||||||
|
"w": 1
|
||||||
|
},
|
||||||
|
"_lscale": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 1,
|
||||||
|
"y": 1,
|
||||||
|
"z": 1
|
||||||
|
},
|
||||||
|
"_mobility": 0,
|
||||||
|
"_layer": 33554432,
|
||||||
|
"_euler": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_id": "9bDuMqKd9OhYCo2Brm7XBF"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.UITransform",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 15
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_contentSize": {
|
||||||
|
"__type__": "cc.Size",
|
||||||
|
"width": 59.05815762192456,
|
||||||
|
"height": 54.39999999999999
|
||||||
|
},
|
||||||
|
"_anchorPoint": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
},
|
||||||
|
"_id": "1cDddsfIpJWLM7qjX4jUZl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Label",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 15
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_customMaterial": null,
|
||||||
|
"_srcBlendFactor": 2,
|
||||||
|
"_dstBlendFactor": 4,
|
||||||
|
"_color": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_string": "加载中...",
|
||||||
|
"_horizontalAlign": 1,
|
||||||
|
"_verticalAlign": 1,
|
||||||
|
"_actualFontSize": 16.10637300843486,
|
||||||
|
"_fontSize": 13.5,
|
||||||
|
"_fontFamily": "Arial",
|
||||||
|
"_lineHeight": 40,
|
||||||
|
"_overflow": 0,
|
||||||
|
"_enableWrapText": true,
|
||||||
|
"_font": {
|
||||||
|
"__uuid__": "5ebfd5b0-a054-4349-b69f-f850a1e1fbcd",
|
||||||
|
"__expectedType__": "cc.TTFFont"
|
||||||
|
},
|
||||||
|
"_isSystemFontUsed": false,
|
||||||
|
"_spacingX": 0,
|
||||||
|
"_isItalic": false,
|
||||||
|
"_isBold": false,
|
||||||
|
"_isUnderline": false,
|
||||||
|
"_underlineHeight": 2,
|
||||||
|
"_cacheMode": 0,
|
||||||
|
"_enableOutline": true,
|
||||||
|
"_outlineColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 0,
|
||||||
|
"g": 0,
|
||||||
|
"b": 0,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_outlineWidth": 2,
|
||||||
|
"_enableShadow": false,
|
||||||
|
"_shadowColor": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 0,
|
||||||
|
"g": 0,
|
||||||
|
"b": 0,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_shadowOffset": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 2,
|
||||||
|
"y": 2
|
||||||
|
},
|
||||||
|
"_shadowBlur": 2,
|
||||||
|
"_id": "9bskEfsttFSpkYFl+TK+Ql"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "nowloading",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"_parent": {
|
||||||
|
"__id__": 2
|
||||||
|
},
|
||||||
|
"_children": [],
|
||||||
|
"_active": false,
|
||||||
|
"_components": [
|
||||||
|
{
|
||||||
|
"__id__": 19
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 20
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_prefab": null,
|
||||||
|
"_lpos": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 448.781,
|
||||||
|
"y": -270,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_lrot": {
|
||||||
|
"__type__": "cc.Quat",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0,
|
||||||
|
"w": 1
|
||||||
|
},
|
||||||
|
"_lscale": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 1,
|
||||||
|
"y": 1,
|
||||||
|
"z": 1
|
||||||
|
},
|
||||||
|
"_mobility": 0,
|
||||||
|
"_layer": 33554432,
|
||||||
|
"_euler": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_id": "01u0WBtzJETpNAzZw8pQB3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.UITransform",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 18
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_contentSize": {
|
||||||
|
"__type__": "cc.Size",
|
||||||
|
"width": 170,
|
||||||
|
"height": 30
|
||||||
|
},
|
||||||
|
"_anchorPoint": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
},
|
||||||
|
"_id": "70lYqn5O1DBbchN/agLNK+"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Sprite",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 18
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_customMaterial": null,
|
||||||
|
"_srcBlendFactor": 2,
|
||||||
|
"_dstBlendFactor": 4,
|
||||||
|
"_color": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_spriteFrame": {
|
||||||
|
"__uuid__": "235eaff0-b052-4034-aabc-b9023743f51c@f9941",
|
||||||
|
"__expectedType__": "cc.SpriteFrame"
|
||||||
|
},
|
||||||
|
"_type": 0,
|
||||||
|
"_fillType": 0,
|
||||||
|
"_sizeMode": 1,
|
||||||
|
"_fillCenter": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"_fillStart": 0,
|
||||||
|
"_fillRange": 0,
|
||||||
|
"_isTrimmedMode": true,
|
||||||
|
"_useGrayscale": false,
|
||||||
|
"_atlas": null,
|
||||||
|
"_id": "99S3MSERxLIYPo/qGECCpu"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UITransform",
|
"__type__": "cc.UITransform",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
|
|
@ -638,40 +886,32 @@
|
||||||
"__prefab": null,
|
"__prefab": null,
|
||||||
"_id": "26OkVwPkVC07BRPXJ50ncp"
|
"_id": "26OkVwPkVC07BRPXJ50ncp"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "cc.PrefabInfo",
|
|
||||||
"root": null,
|
|
||||||
"asset": null,
|
|
||||||
"fileId": "efb7fd68-0786-4a0e-8e5d-46841ad6023c",
|
|
||||||
"instance": null,
|
|
||||||
"targetOverrides": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.SceneGlobals",
|
"__type__": "cc.SceneGlobals",
|
||||||
"ambient": {
|
"ambient": {
|
||||||
"__id__": 21
|
|
||||||
},
|
|
||||||
"shadows": {
|
|
||||||
"__id__": 22
|
|
||||||
},
|
|
||||||
"_skybox": {
|
|
||||||
"__id__": 23
|
|
||||||
},
|
|
||||||
"fog": {
|
|
||||||
"__id__": 24
|
|
||||||
},
|
|
||||||
"octree": {
|
|
||||||
"__id__": 25
|
|
||||||
},
|
|
||||||
"skin": {
|
|
||||||
"__id__": 26
|
"__id__": 26
|
||||||
},
|
},
|
||||||
"lightProbeInfo": {
|
"shadows": {
|
||||||
"__id__": 27
|
"__id__": 27
|
||||||
},
|
},
|
||||||
"postSettings": {
|
"_skybox": {
|
||||||
"__id__": 28
|
"__id__": 28
|
||||||
},
|
},
|
||||||
|
"fog": {
|
||||||
|
"__id__": 29
|
||||||
|
},
|
||||||
|
"octree": {
|
||||||
|
"__id__": 30
|
||||||
|
},
|
||||||
|
"skin": {
|
||||||
|
"__id__": 31
|
||||||
|
},
|
||||||
|
"lightProbeInfo": {
|
||||||
|
"__id__": 32
|
||||||
|
},
|
||||||
|
"postSettings": {
|
||||||
|
"__id__": 33
|
||||||
|
},
|
||||||
"bakedWithStationaryMainLight": false,
|
"bakedWithStationaryMainLight": false,
|
||||||
"bakedWithHighpLightmap": false
|
"bakedWithHighpLightmap": false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [],
|
"_components": [],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 16
|
"__id__": 19
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
},
|
},
|
||||||
"autoReleaseAssets": false,
|
"autoReleaseAssets": false,
|
||||||
"_globals": {
|
"_globals": {
|
||||||
"__id__": 17
|
"__id__": 20
|
||||||
},
|
},
|
||||||
"_id": "f713b5ea-a70f-486c-8260-0338f089a5b8"
|
"_id": "f713b5ea-a70f-486c-8260-0338f089a5b8"
|
||||||
},
|
},
|
||||||
|
|
@ -77,13 +77,13 @@
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 13
|
"__id__": 16
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 14
|
"__id__": 17
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 15
|
"__id__": 18
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": null,
|
"_prefab": null,
|
||||||
|
|
@ -175,7 +175,7 @@
|
||||||
"_priority": 0,
|
"_priority": 0,
|
||||||
"_fov": 45,
|
"_fov": 45,
|
||||||
"_fovAxis": 0,
|
"_fovAxis": 0,
|
||||||
"_orthoHeight": 477.2642163661581,
|
"_orthoHeight": 509.95129375951296,
|
||||||
"_near": 0,
|
"_near": 0,
|
||||||
"_far": 1000,
|
"_far": 1000,
|
||||||
"_color": {
|
"_color": {
|
||||||
|
|
@ -220,10 +220,10 @@
|
||||||
"__id__": 6
|
"__id__": 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 9
|
"__id__": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 11
|
"__id__": 13
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
|
|
@ -232,7 +232,7 @@
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": -533.5,
|
"x": -533.5,
|
||||||
"y": 300,
|
"y": -300.00000000000006,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
|
|
@ -274,13 +274,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 8
|
"__id__": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 9
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": null,
|
"_prefab": null,
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 600,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
|
|
@ -342,6 +345,18 @@
|
||||||
"ImgIndex": 0,
|
"ImgIndex": 0,
|
||||||
"_id": "fc2gTwXM1Lq68bZxSz8rQ1"
|
"_id": "fc2gTwXM1Lq68bZxSz8rQ1"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "51518t/LCBGQZ6rvzL2I2e5",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 6
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_id": "5c+WvJW35JkYzLE6SY7Dmz"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Node",
|
"__type__": "cc.Node",
|
||||||
"_name": "UIRoot",
|
"_name": "UIRoot",
|
||||||
|
|
@ -354,14 +369,17 @@
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 10
|
"__id__": 11
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": null,
|
"_prefab": null,
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 600,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
|
|
@ -393,7 +411,7 @@
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"__editorExtras__": {},
|
"__editorExtras__": {},
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 9
|
"__id__": 10
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": null,
|
"__prefab": null,
|
||||||
|
|
@ -409,6 +427,18 @@
|
||||||
},
|
},
|
||||||
"_id": "6cbBeNcXdJr6bJDAOt5tLP"
|
"_id": "6cbBeNcXdJr6bJDAOt5tLP"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "a578c1qrTRIdaMFhEtim8LM",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 10
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_id": "6clS3n6E1O3Ir6YO9pV5rA"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Node",
|
"__type__": "cc.Node",
|
||||||
"_name": "DialogRoot",
|
"_name": "DialogRoot",
|
||||||
|
|
@ -421,14 +451,17 @@
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 12
|
"__id__": 14
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 15
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": null,
|
"_prefab": null,
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 600,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
|
|
@ -460,7 +493,7 @@
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"__editorExtras__": {},
|
"__editorExtras__": {},
|
||||||
"node": {
|
"node": {
|
||||||
"__id__": 11
|
"__id__": 13
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": null,
|
"__prefab": null,
|
||||||
|
|
@ -476,6 +509,18 @@
|
||||||
},
|
},
|
||||||
"_id": "28/iYuYk1JyqaQ0l2uDYPY"
|
"_id": "28/iYuYk1JyqaQ0l2uDYPY"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "11718UDzs1Cra3Z5OOr4Z4r",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 13
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": null,
|
||||||
|
"_id": "d79jn93oZBELG9gxMlR3iL"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UITransform",
|
"__type__": "cc.UITransform",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
|
|
@ -555,29 +600,29 @@
|
||||||
{
|
{
|
||||||
"__type__": "cc.SceneGlobals",
|
"__type__": "cc.SceneGlobals",
|
||||||
"ambient": {
|
"ambient": {
|
||||||
"__id__": 18
|
|
||||||
},
|
|
||||||
"shadows": {
|
|
||||||
"__id__": 19
|
|
||||||
},
|
|
||||||
"_skybox": {
|
|
||||||
"__id__": 20
|
|
||||||
},
|
|
||||||
"fog": {
|
|
||||||
"__id__": 21
|
"__id__": 21
|
||||||
},
|
},
|
||||||
"octree": {
|
"shadows": {
|
||||||
"__id__": 22
|
"__id__": 22
|
||||||
},
|
},
|
||||||
"skin": {
|
"_skybox": {
|
||||||
"__id__": 23
|
"__id__": 23
|
||||||
},
|
},
|
||||||
"lightProbeInfo": {
|
"fog": {
|
||||||
"__id__": 24
|
"__id__": 24
|
||||||
},
|
},
|
||||||
"postSettings": {
|
"octree": {
|
||||||
"__id__": 25
|
"__id__": 25
|
||||||
},
|
},
|
||||||
|
"skin": {
|
||||||
|
"__id__": 26
|
||||||
|
},
|
||||||
|
"lightProbeInfo": {
|
||||||
|
"__id__": 27
|
||||||
|
},
|
||||||
|
"postSettings": {
|
||||||
|
"__id__": 28
|
||||||
|
},
|
||||||
"bakedWithStationaryMainLight": false,
|
"bakedWithStationaryMainLight": false,
|
||||||
"bakedWithHighpLightmap": false
|
"bakedWithHighpLightmap": false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,5 @@
|
||||||
"width": 1067,
|
"width": 1067,
|
||||||
"height": 600
|
"height": 600
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"custom_joint_texture_layouts": []
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue