Commit bf03933e authored by spc's avatar spc

1

parent 6a5972ed
This diff is collapsed.
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "fbacf0e6-8508-4b2c-a549-b16565465d93",
"files": [],
"subMetas": {},
"userData": {}
}
[
{
"__type__": "cc.Prefab",
"_name": "卡A",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡A",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -62,
"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": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5642TlQL1CK4ABo3qDa+2a"
},
{
"__type__": "cc.Sprite",
"_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
},
"_spriteFrame": {
"__uuid__": "c6b39193-6b92-404d-b4d1-c3a9cc8b0f80@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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "afHtW6TeRC4q8TNa1K0hop"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "46Rpq6Y0NL+bdngJRKYFsc",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "1a1ee9df-0637-4a3b-bac1-5bf21366600d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡A"
}
}
[
{
"__type__": "cc.Prefab",
"_name": "卡B",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡B",
"_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": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6c81ev881EFb0eViEGD3dC"
},
{
"__type__": "cc.Sprite",
"_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
},
"_spriteFrame": {
"__uuid__": "a4050df6-9647-4152-ad4b-20e2878a272e@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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "edCi47OidDDJiqOkO/Jm+F"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "baGm5VSc5I3Iv3pjwhR/Ee",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e61990c1-7e66-4f38-9579-8d37500e8cfe",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡B"
}
}
[
{
"__type__": "cc.Prefab",
"_name": "卡C",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡C",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 62,
"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": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1f0liy8jdOzY21EnW9lveu"
},
{
"__type__": "cc.Sprite",
"_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
},
"_spriteFrame": {
"__uuid__": "20710d44-64c2-4fc5-9736-896ca6e505d9@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": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5fhJR3XJJLV5NSZtJtHaDU"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c2Ft7FcclOpaw6rqMoweol",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "492d9db9-cc02-4806-9b44-880aecb2d6aa",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡C"
}
}
import { _decorator, Component, easing, Graphics, Label, Animation, misc, Node, Tween, tween, v3, UIOpacity } from "cc"; import { _decorator, Component, easing, Graphics, Label, Animation, misc, Node, Tween, tween, v3, UIOpacity } from "cc";
import { Global } from "../Global"; import { Global } from "../Global";
import Svga from "../../../../Component/Svga/Svga"; import Svga from "../../../../Component/Svga/Svga";
import { ECard } from "../Common/Enums";
const { ccclass, property, executeInEditMode } = _decorator; const { ccclass, property, executeInEditMode } = _decorator;
...@@ -34,6 +35,8 @@ export class Target extends Component { ...@@ -34,6 +35,8 @@ export class Target extends Component {
@property(Node) topCard: Node = null; @property(Node) topCard: Node = null;
@property(Node) topCardList: Node = null;
constructor() { constructor() {
super(); super();
Target._ins = this; Target._ins = this;
...@@ -122,13 +125,23 @@ export class Target extends Component { ...@@ -122,13 +125,23 @@ export class Target extends Component {
} }
showTopCard() { showTopCard() {
this.topCard.active = true; if (!this.topCard.active) {
this.top.active = false; this.topCard.active = true;
this.top.active = false;
}
} }
showTop() { showTop() {
this.top.active = true; if (!this.top.active) {
this.topCard.active = false this.top.active = true;
this.topCard.active = false
}
}
updateCard(type: ECard) {
this.showTopCard()
this.topCardList.addChild()
} }
private _cd = 0; private _cd = 0;
......
...@@ -5,8 +5,9 @@ import { ...@@ -5,8 +5,9 @@ import {
import { Snake } from "./Snake"; import { Snake } from "./Snake";
import { Joystick } from "./Components/Joystick"; import { Joystick } from "./Components/Joystick";
import { FastBtn } from "./Components/FastBtn"; import { FastBtn } from "./Components/FastBtn";
import { Events } from "./Common/Enums"; import { ECard, Events } from "./Common/Enums";
import gameStore from "../../store/gameStore"; import gameStore from "../../store/gameStore";
import { Target } from "./Components/Target";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -48,8 +49,8 @@ export class Player extends Snake { ...@@ -48,8 +49,8 @@ export class Player extends Snake {
gameStore.gameInfo.luckNum = value; gameStore.gameInfo.luckNum = value;
} }
checkCard() { checkCard(type:ECard) {
console.warn("xxxx", this.cardMap) Target.ins.updateCard(type);
} }
onLoad() { onLoad() {
......
...@@ -194,7 +194,7 @@ export class Snake extends Component { ...@@ -194,7 +194,7 @@ export class Snake extends Component {
} }
setSkin(skinName: string) { setSkin(skinName: string) {
const skin = assetManager.getBundle("MainGame").get(`skin/${skinName}`, SpriteAtlas); const skin = assetManager.getBundle("MainGame").get(`skin/${skinName}`, SpriteAtlas);
this.imgHead = skin.getSpriteFrame("head"); this.imgHead = skin.getSpriteFrame("head");
let bodyIndex = 1; let bodyIndex = 1;
...@@ -282,10 +282,10 @@ export class Snake extends Component { ...@@ -282,10 +282,10 @@ export class Snake extends Component {
this.cardMap.set(type, 0); this.cardMap.set(type, 0);
} }
this.cardMap.set(type, this.cardMap.get(type) + 1); this.cardMap.set(type, this.cardMap.get(type) + 1);
this.checkCard(); this.checkCard(type);
} }
checkCard() { checkCard(type: ECard) {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment