1 修改更换NPK

2 修改baseButton 的问题
3 修改更换NPK导致的index错误问题
This commit is contained in:
DESKTOP-J7I1C4E\a9350 2024-03-22 15:48:09 +08:00
parent 82192ff664
commit 3accbc5f3a
8 changed files with 84 additions and 299 deletions

View File

@ -120,6 +120,7 @@ export class BaseButton extends Component {
}
OnHever(event) {
if (this.ButtonState == BaseButtonState.Disable) return;
this.ButtonState = BaseButtonState.Hover;
}
OnEnd(event: EventMouse) {
if (this.ButtonState == BaseButtonState.Disable) return;

View File

@ -2,7 +2,7 @@
"ver": "1.0.3",
"importer": "buffer",
"imported": true,
"uuid": "dc61d9f4-8a5e-4540-8a2c-dc318bb9f198",
"uuid": "d3385675-1bcd-4592-b0f0-bf716f181429",
"files": [
".bin",
".json"

View File

@ -12,7 +12,7 @@ export class DiceButtonNode extends Node {
winButtonComponent: BaseButton;
spaceButtonComponent: BaseButton;
winButtonBlock: Function;
spaceDownBlock: Function;
spaceUpBlock: Function;
@ -32,16 +32,16 @@ export class DiceButtonNode extends Node {
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;
this.winButtonComponent.NormalImgIndex = 60;
this.winButtonComponent.HoverImgIndex = 61;
this.winButtonComponent.PressImgIndex = 62;
this.winButtonComponent.DisableImgIndex = 63;
/// space
const spaceButtonNode = new Node();
this.addChild(spaceButtonNode);

View File

@ -8,7 +8,7 @@ const { ccclass } = _decorator;
export enum CharacterType{
/// 剑魂
JianHun = 0,
}
@ -57,7 +57,7 @@ export class GamerNode extends Node {
}},).start();
}
}
/// 设置玩家名称
@ -97,7 +97,7 @@ export class GamerNode extends Node {
}
}
constructor(gamerName:string){
super();
@ -146,7 +146,7 @@ export class GamerNode extends Node {
/// 添加 baseSprite 组件
const backgroundComponent = node.addComponent( BaseSprite );
backgroundComponent.updateSpriteFrame(NpkImage.ingame,51);
backgroundComponent.updateSpriteFrame(NpkImage.ingame,53);
}

View File

@ -1,8 +1,7 @@
import { _decorator, Component, director, instantiate, Node, Prefab, resources, Scene } from 'cc';
import { _decorator, Component, director } from 'cc';
import { GlobalAudio } from '../../GlobalScript/GlobalAudio/GlobalAudio';
import { ImagePack } from '../../GlobalScript/ImagePack/ImagePack';
import { GameScript } from '../../GlobalScript/GameScript/GameScript';
import { UIRoot } from '../../Script/UIRoot';
const { ccclass, property } = _decorator;

View File

@ -22,7 +22,9 @@
],
"_active": true,
"_components": [],
"_prefab": null,
"_prefab": {
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
@ -52,7 +54,7 @@
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 25
"__id__": 20
},
"_id": "efb7fd68-0786-4a0e-8e5d-46841ad6023c"
},
@ -76,27 +78,21 @@
},
{
"__id__": 11
},
{
"__id__": 15
},
{
"__id__": 18
}
],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 15
},
{
"__id__": 22
"__id__": 16
},
{
"__id__": 23
"__id__": 17
},
{
"__id__": 24
"__id__": 18
}
],
"_prefab": null,
@ -188,7 +184,7 @@
"_priority": 0,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 346.1673212882954,
"_orthoHeight": 473.21751412429376,
"_near": 0,
"_far": 1000,
"_color": {
@ -562,250 +558,6 @@
"__prefab": null,
"_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",
"_name": "",
@ -886,31 +638,39 @@
"__prefab": null,
"_id": "26OkVwPkVC07BRPXJ50ncp"
},
{
"__type__": "cc.PrefabInfo",
"root": null,
"asset": null,
"fileId": "efb7fd68-0786-4a0e-8e5d-46841ad6023c",
"instance": null,
"targetOverrides": null
},
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 26
"__id__": 21
},
"shadows": {
"__id__": 27
"__id__": 22
},
"_skybox": {
"__id__": 28
"__id__": 23
},
"fog": {
"__id__": 29
"__id__": 24
},
"octree": {
"__id__": 30
"__id__": 25
},
"skin": {
"__id__": 31
"__id__": 26
},
"lightProbeInfo": {
"__id__": 32
"__id__": 27
},
"postSettings": {
"__id__": 33
"__id__": 28
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false

View File

@ -23,7 +23,7 @@
"_active": true,
"_components": [],
"_prefab": {
"__id__": 19
"__id__": 20
},
"_lpos": {
"__type__": "cc.Vec3",
@ -54,7 +54,7 @@
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 20
"__id__": 21
},
"_id": "f713b5ea-a70f-486c-8260-0338f089a5b8"
},
@ -76,14 +76,14 @@
],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 17
},
{
"__id__": 18
},
{
"__id__": 19
}
],
"_prefab": null,
@ -175,7 +175,7 @@
"_priority": 0,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 509.95129375951296,
"_orthoHeight": 473.21751412429376,
"_near": 0,
"_far": 1000,
"_color": {
@ -227,12 +227,16 @@
}
],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 16
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -533.5,
"y": -300.00000000000006,
"y": 300,
"z": 0
},
"_lrot": {
@ -283,7 +287,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 600,
"y": 0,
"z": 0
},
"_lrot": {
@ -379,7 +383,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 600,
"y": 0,
"z": 0
},
"_lrot": {
@ -461,7 +465,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 600,
"y": 0,
"z": 0
},
"_lrot": {
@ -521,6 +525,27 @@
"__prefab": null,
"_id": "d79jn93oZBELG9gxMlR3iL"
},
{
"__type__": "949ea2Dmw5CAoAHxQqyzu61",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 5
},
"_enabled": true,
"__prefab": null,
"boardRootNode": {
"__id__": 6
},
"UIRootNode": {
"__id__": 10
},
"DialogRootNode": {
"__id__": 13
},
"_id": "86lITimcpDHppWjrM888+a"
},
{
"__type__": "cc.UITransform",
"_name": "",
@ -600,29 +625,29 @@
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 21
},
"shadows": {
"__id__": 22
},
"_skybox": {
"shadows": {
"__id__": 23
},
"fog": {
"_skybox": {
"__id__": 24
},
"octree": {
"fog": {
"__id__": 25
},
"skin": {
"octree": {
"__id__": 26
},
"lightProbeInfo": {
"skin": {
"__id__": 27
},
"postSettings": {
"lightProbeInfo": {
"__id__": 28
},
"postSettings": {
"__id__": 29
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false
},