自动旋转和小游戏中也可以点击屏幕停止滚动
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m14s

This commit is contained in:
TJH 2025-12-31 12:22:48 +08:00
parent 80057d6957
commit 1b33734c39
6 changed files with 254 additions and 394 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "6433b29b-f544-440f-8be6-477a5c024f7c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,146 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "readyHand",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "readyHand",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 149.36000061035156,
"height": 721.510009765625
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49377343129770096,
"y": 0.49974359668460616
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b1mehXP45KqZ5ylDhnzjMj"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "c540ca75-7466-4e9a-aa3f-f1d031999a27",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "readyHand_01",
"_premultipliedAlpha": true,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "092Em93rtLuav6edDSYQF4"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e8VoLh3KlENrVZJLIIITZJ",
"targetOverrides": null
}
]

View File

@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f6c8dc7d-3478-495c-a358-5abb883f7aab",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "readyHand"
}
}

View File

@ -266,12 +266,19 @@ export class SlotBar extends Component {
}); });
} }
allowClickManualStop(bl: boolean) {
this.hasClickSpin = bl;
this.manualStopNode.active = bl
}
notAllowClickManualStop(bl: boolean) {
this.hasClickManualStop = bl;
}
onBtnSpin() { onBtnSpin() {
// 第一次点击 旋转 // 第一次点击 旋转
if (!this.hasClickSpin && !this.hasClickManualStop) { if (!this.hasClickSpin && !this.hasClickManualStop) {
AudioManager.instance.playSFX("Spin_Button_Click"); AudioManager.instance.playSFX("Spin_Button_Click");
this.hasClickSpin = true;
this.manualStopNode.active = true
this.node.emit(SLOT_BAR_EVENT.ON_SPIN_CLICK); this.node.emit(SLOT_BAR_EVENT.ON_SPIN_CLICK);
this.spinAni.startSpin(); this.spinAni.startSpin();
@ -290,8 +297,8 @@ export class SlotBar extends Component {
// 第一次点击 旋转 // 第一次点击 旋转
if (!this.hasClickSpin && !this.hasClickManualStop) { if (!this.hasClickSpin && !this.hasClickManualStop) {
// AudioManager.instance.playSFX('Spin_Button_Click'); // AudioManager.instance.playSFX('Spin_Button_Click');
this.hasClickSpin = true;
this.manualStopNode.active = true
this.setBtnEnable(this.subBtn, false); this.setBtnEnable(this.subBtn, false);
this.setBtnEnable(this.addBtn, false); this.setBtnEnable(this.addBtn, false);
@ -308,7 +315,7 @@ export class SlotBar extends Component {
onBtnTestSpin(event, args) { onBtnTestSpin(event, args) {
// 第一次点击 旋转 // 第一次点击 旋转
if (!this.hasClickSpin && !this.hasClickManualStop) { if (!this.hasClickSpin && !this.hasClickManualStop) {
this.hasClickSpin = true; // this.hasClickSpin = true;
this.node.emit(SLOT_BAR_EVENT.ON_TEST_SPIN_CLICK, args); this.node.emit(SLOT_BAR_EVENT.ON_TEST_SPIN_CLICK, args);
this.setBtnEnable(this.subBtn, false); this.setBtnEnable(this.subBtn, false);
@ -329,7 +336,7 @@ export class SlotBar extends Component {
} }
manualStop() { manualStop() {
this.hasClickManualStop = true; this.notAllowClickManualStop(true)
this.spinAni.stopSpin(); this.spinAni.stopSpin();
this.setBtnEnable(this.spinBtn, false); this.setBtnEnable(this.spinBtn, false);
} }
@ -613,9 +620,10 @@ export class SlotBar extends Component {
} }
resetAllState() { resetAllState() {
this.hasClickSpin = false; this.allowClickManualStop(false)
this.hasClickManualStop = false; this.notAllowClickManualStop(false)
this.manualStopNode.active = false
this.isAuto = false; this.isAuto = false;
this.setBtnVisible(this.spinBtn, true); this.setBtnVisible(this.spinBtn, true);
this.spinAni.stopSpin(); this.spinAni.stopSpin();

View File

@ -323,7 +323,8 @@ export class SlotScene extends Component {
} }
if (!this.gameState.isDebug) { if (!this.gameState.isDebug) {
this.spinInfo = await callGameApi("spin", msg); this.spinInfo = await callGameApi("spin", msg);
this.slotBar.allowClickManualStop(true)
this.slotBar.notAllowClickManualStop(false)
if (this.spinInfo.Frb.Ongoing) { if (this.spinInfo.Frb.Ongoing) {
if (!isFreeSpin) { if (!isFreeSpin) {
let count = this.spinInfo.Frb.Ongoing.Frn; let count = this.spinInfo.Frb.Ongoing.Frn;
@ -385,9 +386,9 @@ export class SlotScene extends Component {
if (!this.isReceiveMsg) return; if (!this.isReceiveMsg) return;
// 免费游戏不能手动停止 // 免费游戏不能手动停止
if (this.gameState.isInFreeSpin) { // if (this.gameState.isInFreeSpin) {
return; // return;
} // }
// 滚轮没有开始旋转的时候不能停止 // 滚轮没有开始旋转的时候不能停止
if (!this.slotGame.isScroll()) return; if (!this.slotGame.isScroll()) return;