修复分享问题
This commit is contained in:
parent
830158fbbb
commit
2af3e2b674
|
|
@ -25933,6 +25933,9 @@
|
||||||
"avatarUI": {
|
"avatarUI": {
|
||||||
"__uuid__": "fd85df88-648f-4407-bab2-da4f15478fb9"
|
"__uuid__": "fd85df88-648f-4407-bab2-da4f15478fb9"
|
||||||
},
|
},
|
||||||
|
"icon": {
|
||||||
|
"__uuid__": "9f535aaa-49fd-42b8-ae6c-4ab4467f503f"
|
||||||
|
},
|
||||||
"level": {
|
"level": {
|
||||||
"__id__": 328
|
"__id__": 328
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ export default class JiaZai extends cc.Component {
|
||||||
private passCheckNode: cc.Node | null = null;
|
private passCheckNode: cc.Node | null = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property(cc.EditBox)
|
@property(cc.EditBox)
|
||||||
custom: cc.EditBox = null;
|
custom: cc.EditBox = null;
|
||||||
|
|
||||||
|
|
@ -66,6 +67,9 @@ export default class JiaZai extends cc.Component {
|
||||||
@property(cc.SpriteAtlas)
|
@property(cc.SpriteAtlas)
|
||||||
avatarUI: cc.SpriteAtlas = null;
|
avatarUI: cc.SpriteAtlas = null;
|
||||||
|
|
||||||
|
@property(cc.Prefab)
|
||||||
|
icon: cc.Prefab = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property(cc.Node)
|
@property(cc.Node)
|
||||||
|
|
@ -137,6 +141,10 @@ export default class JiaZai extends cc.Component {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
// this.createIcon();
|
||||||
|
|
||||||
|
|
||||||
cc.fx.GameConfig.GM_INFO.sceneValue = "HomeScene";
|
cc.fx.GameConfig.GM_INFO.sceneValue = "HomeScene";
|
||||||
initProvinceLocator();
|
initProvinceLocator();
|
||||||
// this.RankNode = null;
|
// this.RankNode = null;
|
||||||
|
|
@ -359,8 +367,55 @@ export default class JiaZai extends cc.Component {
|
||||||
|
|
||||||
this.onGames();
|
this.onGames();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createIcon() {
|
||||||
|
if (!this.icon) return;
|
||||||
|
|
||||||
|
// 获取屏幕中心点
|
||||||
|
const screenCenter = cc.v2(cc.winSize.width / 2, cc.winSize.height / 2);
|
||||||
|
const iconWidth = 130;
|
||||||
|
const iconHeight = 130;
|
||||||
|
|
||||||
|
// 创建五圈icon
|
||||||
|
for (let circle = 0; circle < 4; circle++) {
|
||||||
|
// 计算当前圈的icon数量(中心为1个,第1圈8个,第2圈16个,第3圈24个,第4圈32个)
|
||||||
|
const iconCount = circle === 0 ? 1 : circle * 8;
|
||||||
|
|
||||||
|
// 计算当前圈的半径(中心圈半径为0,其他圈按间距递增)
|
||||||
|
const radius = circle === 0 ? 0 : circle * (iconWidth + 20);
|
||||||
|
|
||||||
|
for (let i = 0; i < iconCount; i++) {
|
||||||
|
let iconNode = cc.instantiate(this.icon);
|
||||||
|
iconNode.parent = this.node.getChildByName("action");
|
||||||
|
|
||||||
|
// 计算每个icon的位置
|
||||||
|
let position: cc.Vec2;
|
||||||
|
|
||||||
|
if (circle === 0) {
|
||||||
|
// 中心点
|
||||||
|
position = screenCenter;
|
||||||
|
} else {
|
||||||
|
// 计算角度(均匀分布)
|
||||||
|
const angle = (i / iconCount) * 2 * Math.PI;
|
||||||
|
|
||||||
|
// 计算位置坐标
|
||||||
|
const x = screenCenter.x + radius * Math.cos(angle);
|
||||||
|
const y = screenCenter.y + radius * Math.sin(angle);
|
||||||
|
position = cc.v2(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置icon位置
|
||||||
|
iconNode.setPosition(position);
|
||||||
|
|
||||||
|
// 设置icon尺寸
|
||||||
|
iconNode.width = iconWidth;
|
||||||
|
iconNode.height = iconHeight;
|
||||||
|
iconNode.zIndex = -iconNode.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//监听后台
|
//监听后台
|
||||||
onGames() {
|
onGames() {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
|
|
|
||||||
|
|
@ -483,14 +483,7 @@ export default class MapConroler extends cc.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
initMap() {
|
initMap() {
|
||||||
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
|
||||||
this.node.parent.getChildByName("Top").getChildByName("shareBtn").active = false;
|
|
||||||
this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.node.parent.getChildByName("Top").getChildByName("shareBtn").active = true;
|
|
||||||
this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = true;
|
|
||||||
}
|
|
||||||
if (cc.fx.GameConfig.GM_INFO.winStreak < 10 || cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
if (cc.fx.GameConfig.GM_INFO.winStreak < 10 || cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
||||||
if (this.winStreakBtn.node) {
|
if (this.winStreakBtn.node) {
|
||||||
this.winStreakBtn.node.active = false;
|
this.winStreakBtn.node.active = false;
|
||||||
|
|
@ -3142,15 +3135,7 @@ export default class MapConroler extends cc.Component {
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Time").active = true;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Time").active = true;
|
||||||
this.revive.getComponent("Revive").init();
|
this.revive.getComponent("Revive").init();
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Boom").active = false;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Boom").active = false;
|
||||||
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
|
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("share").active = true;
|
|
||||||
}, 350);
|
|
||||||
}
|
|
||||||
if (type) {
|
if (type) {
|
||||||
if (type == "time") {
|
if (type == "time") {
|
||||||
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Time").active = true;
|
this.node.parent.parent.getChildByName("Lose").getChildByName("lose").getChildByName("Time").active = true;
|
||||||
|
|
@ -5211,15 +5196,15 @@ export default class MapConroler extends cc.Component {
|
||||||
endlessLevelShow() {
|
endlessLevelShow() {
|
||||||
// console.log("刷新关卡等级", cc.fx.GameTool.maxLevel(), cc.fx.GameConfig.GM_INFO.endLevelNum);
|
// console.log("刷新关卡等级", cc.fx.GameTool.maxLevel(), cc.fx.GameConfig.GM_INFO.endLevelNum);
|
||||||
let top = this.node.parent.getChildByName("Top");
|
let top = this.node.parent.getChildByName("Top");
|
||||||
top.getChildByName("shareBtn").active = true;
|
|
||||||
this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = true;
|
|
||||||
if (cc.fx.GameTool.maxLevel()) {
|
if (cc.fx.GameTool.maxLevel()) {
|
||||||
let endlessNode = top.getChildByName("endlessNode");
|
let endlessNode = top.getChildByName("endlessNode");
|
||||||
endlessNode.active = true;
|
endlessNode.active = true;
|
||||||
top.getChildByName("shareBtn").active = false;
|
|
||||||
top.getChildByName("level").active = false;
|
top.getChildByName("level").active = false;
|
||||||
top.getChildByName("difficultySpr").active = false;
|
top.getChildByName("difficultySpr").active = false;
|
||||||
this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = false;
|
|
||||||
let endNode = endlessNode.getChildByName("endNode");
|
let endNode = endlessNode.getChildByName("endNode");
|
||||||
let levelNum = endNode.getChildByName("levelNum");
|
let levelNum = endNode.getChildByName("levelNum");
|
||||||
let level_x = endNode.getChildByName("level_x");
|
let level_x = endNode.getChildByName("level_x");
|
||||||
|
|
|
||||||
|
|
@ -443,8 +443,8 @@ var GameTool = {
|
||||||
//关卡上限
|
//关卡上限
|
||||||
maxLevel() {
|
maxLevel() {
|
||||||
let jg = false;
|
let jg = false;
|
||||||
if (cc.fx.GameConfig.GM_INFO.level > 1049) {
|
if (cc.fx.GameConfig.GM_INFO.level > 1019) {
|
||||||
cc.fx.GameConfig.GM_INFO.level = 1050;
|
cc.fx.GameConfig.GM_INFO.level = 1020;
|
||||||
jg = true;
|
jg = true;
|
||||||
}
|
}
|
||||||
return jg;
|
return jg;
|
||||||
|
|
|
||||||
236
assets/prefab/prop/icon.prefab
Normal file
236
assets/prefab/prop/icon.prefab
Normal file
|
|
@ -0,0 +1,236 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"__type__": "cc.Prefab",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_native": "",
|
||||||
|
"data": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"optimizationPolicy": 0,
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"readonly": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "icon",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_parent": null,
|
||||||
|
"_children": [
|
||||||
|
{
|
||||||
|
"__id__": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_active": true,
|
||||||
|
"_components": [
|
||||||
|
{
|
||||||
|
"__id__": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_prefab": {
|
||||||
|
"__id__": 6
|
||||||
|
},
|
||||||
|
"_opacity": 255,
|
||||||
|
"_color": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_contentSize": {
|
||||||
|
"__type__": "cc.Size",
|
||||||
|
"width": 170,
|
||||||
|
"height": 170
|
||||||
|
},
|
||||||
|
"_anchorPoint": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
},
|
||||||
|
"_trs": {
|
||||||
|
"__type__": "TypedArray",
|
||||||
|
"ctor": "Float64Array",
|
||||||
|
"array": [
|
||||||
|
-86.138,
|
||||||
|
427.25,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"_eulerAngles": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_skewX": 0,
|
||||||
|
"_skewY": 0,
|
||||||
|
"_is3DNode": false,
|
||||||
|
"_groupIndex": 0,
|
||||||
|
"groupIndex": 0,
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "skeleton",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"_parent": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"_children": [],
|
||||||
|
"_active": true,
|
||||||
|
"_components": [
|
||||||
|
{
|
||||||
|
"__id__": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_prefab": {
|
||||||
|
"__id__": 4
|
||||||
|
},
|
||||||
|
"_opacity": 255,
|
||||||
|
"_color": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_contentSize": {
|
||||||
|
"__type__": "cc.Size",
|
||||||
|
"width": 180,
|
||||||
|
"height": 180
|
||||||
|
},
|
||||||
|
"_anchorPoint": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
},
|
||||||
|
"_trs": {
|
||||||
|
"__type__": "TypedArray",
|
||||||
|
"ctor": "Float64Array",
|
||||||
|
"array": [
|
||||||
|
4.112,
|
||||||
|
3.084,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"_eulerAngles": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"_skewX": 0,
|
||||||
|
"_skewY": 0,
|
||||||
|
"_is3DNode": false,
|
||||||
|
"_groupIndex": 0,
|
||||||
|
"groupIndex": 0,
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "sp.Skeleton",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"node": {
|
||||||
|
"__id__": 2
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"_materials": [
|
||||||
|
{
|
||||||
|
"__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paused": false,
|
||||||
|
"defaultSkin": "default",
|
||||||
|
"defaultAnimation": "18",
|
||||||
|
"_preCacheMode": 0,
|
||||||
|
"_cacheMode": 0,
|
||||||
|
"loop": true,
|
||||||
|
"premultipliedAlpha": true,
|
||||||
|
"timeScale": 1,
|
||||||
|
"_accTime": 0,
|
||||||
|
"_playCount": 0,
|
||||||
|
"_frameCache": null,
|
||||||
|
"_curFrame": null,
|
||||||
|
"_skeletonCache": null,
|
||||||
|
"_animationName": "18",
|
||||||
|
"_animationQueue": [],
|
||||||
|
"_headAniInfo": null,
|
||||||
|
"_playTimes": 0,
|
||||||
|
"_isAniComplete": true,
|
||||||
|
"_N$skeletonData": null,
|
||||||
|
"_N$_defaultCacheMode": 0,
|
||||||
|
"_N$debugSlots": false,
|
||||||
|
"_N$debugBones": false,
|
||||||
|
"_N$debugMesh": false,
|
||||||
|
"_N$useTint": false,
|
||||||
|
"_N$enableBatch": false,
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.PrefabInfo",
|
||||||
|
"root": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"__id__": 0
|
||||||
|
},
|
||||||
|
"fileId": "76puEJXNVMCZyBrSro19oY",
|
||||||
|
"sync": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Sprite",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"node": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"_materials": [
|
||||||
|
{
|
||||||
|
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_srcBlendFactor": 770,
|
||||||
|
"_dstBlendFactor": 771,
|
||||||
|
"_spriteFrame": null,
|
||||||
|
"_type": 0,
|
||||||
|
"_sizeMode": 0,
|
||||||
|
"_fillType": 0,
|
||||||
|
"_fillCenter": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"_fillStart": 0,
|
||||||
|
"_fillRange": 0,
|
||||||
|
"_isTrimmedMode": true,
|
||||||
|
"_atlas": null,
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.PrefabInfo",
|
||||||
|
"root": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"__id__": 0
|
||||||
|
},
|
||||||
|
"fileId": "",
|
||||||
|
"sync": false
|
||||||
|
}
|
||||||
|
]
|
||||||
9
assets/prefab/prop/icon.prefab.meta
Normal file
9
assets/prefab/prop/icon.prefab.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"ver": "1.3.2",
|
||||||
|
"uuid": "9f535aaa-49fd-42b8-ae6c-4ab4467f503f",
|
||||||
|
"importer": "prefab",
|
||||||
|
"optimizationPolicy": "AUTO",
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"readonly": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user