Commit bdf9beb9 authored by Edwise's avatar Edwise 🍷

123

parent 6a87293d
......@@ -605,29 +605,29 @@ const resCanvasList = {
url: '//yun.duiba.com.cn/spark/assets/选择猫咪背景.380e7b102d2288cfd03900177d662d8f5f38f400.png',
uuid: 'db53267d-4141-4d3e-afda-9b523c89be3e'
},
'1e663b9f-cca2-4e5e-a7d5-d2eb6bd6b3aa': {
'a7dc39fa-5f6d-4e94-8979-81c4a4aa183f': {
name: 'BlueCatTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/BlueCatTexture.5cafc98c235a09ef5207b52aadbfb7278d0b5a05.png',
uuid: '1e663b9f-cca2-4e5e-a7d5-d2eb6bd6b3aa'
url: '//yun.duiba.com.cn/spark/assets/BlueCatTexture.4cb32c2577f51d8c63e894bd662518d3c7cc1f69.png',
uuid: 'a7dc39fa-5f6d-4e94-8979-81c4a4aa183f'
},
'8d158036-37a0-4c5c-b4bf-e792e48700e0': {
'72987d74-2fa7-49b9-865d-a0d80c6ed220': {
name: 'OrengeCatTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/OrengeCatTexture.3c7d51810caa1db0ff2d371c86ff5e5b877fe506.png',
uuid: '8d158036-37a0-4c5c-b4bf-e792e48700e0'
url: '//yun.duiba.com.cn/spark/assets/OrengeCatTexture.c0e942ac2dfbbe36c60acd9cd66b6800e34ab7e7.png',
uuid: '72987d74-2fa7-49b9-865d-a0d80c6ed220'
},
'd10c8371-7326-45cf-b3f4-bd81569a4e87': {
'75320997-b466-4161-abab-b03a51ec522b': {
name: 'SanhuaCatTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/SanhuaCatTexture.ccc3ead1ca6f7ee0478660219c168b48fc8e7d02.png',
uuid: 'd10c8371-7326-45cf-b3f4-bd81569a4e87'
url: '//yun.duiba.com.cn/spark/assets/SanhuaCatTexture.48eb7ebfe58570de3ef9369112e8cff7da9d7143.png',
uuid: '75320997-b466-4161-abab-b03a51ec522b'
},
'e90852de-0b38-44f8-ac8c-6eacdcc08001': {
'de2d1dca-ed1c-4fe0-93ef-684f4b96c87e': {
name: 'XianluoCatTexture',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/XianluoCatTexture.7a41e13c71fdec1757c57440faecf6c9d3ae0e9c.png',
uuid: 'e90852de-0b38-44f8-ac8c-6eacdcc08001'
url: '//yun.duiba.com.cn/spark/assets/XianluoCatTexture.5ddac07bcc3d692773d464ddace1879e95c9605f.png',
uuid: 'de2d1dca-ed1c-4fe0-93ef-684f4b96c87e'
}
};
export default resCanvasList;
......@@ -5,19 +5,19 @@ const SanhuaCatTexture = require("./src/lottieSrc/lottieTextureJson/SanhuaCatTex
const XianluoCatTexture = require("./src/lottieSrc/lottieTextureJson/XianluoCatTexture.json")
const resLottieList = {
"blueCat":{
imgUrl:resCanvasList["1e663b9f-cca2-4e5e-a7d5-d2eb6bd6b3aa"].url,
imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
json:BlueCatTexture
},
"orengeCat":{
imgUrl:resCanvasList["8d158036-37a0-4c5c-b4bf-e792e48700e0"].url,
imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
json:OrengeCatTexture
},
"sanhuaCat":{
imgUrl:resCanvasList["d10c8371-7326-45cf-b3f4-bd81569a4e87"].url,
imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
json:SanhuaCatTexture
},
"xianluoCat":{
imgUrl:resCanvasList["e90852de-0b38-44f8-ac8c-6eacdcc08001"].url,
imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
json:XianluoCatTexture
}
}
......
......@@ -29,3 +29,19 @@ export enum CATTYPE{
/**暹罗 */
XIANLUO
}
/**猫咪互动动作 */
export enum CAT_ACTTYPEP{
/**睡觉 */
SLEEP,
/**说话 */
TALK,
/**梳毛 */
CLEAR,
/**撸猫 */
RUA,
/**玩耍 */
PLAY,
/**摸头杀 */
TOUCH
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ import { xianluo05motou } from "../lottieSrc/lottieTs/xianluoCat/xianluo05motou"
import { xianluolumao } from "../lottieSrc/lottieTs/xianluoCat/xianluolumao";
import { xianluomao01 } from "../lottieSrc/lottieTs/xianluoCat/xianluomao01";
import { xianluoshuohua } from "../lottieSrc/lottieTs/xianluoCat/xianluoshuohua";
import { CATTYPE, MSG } from "../Enum";
import { CATTYPE, MSG,CAT_ACTTYPEP } from "../Enum";
import { Ins } from "../Ins";
export class Cat extends Module {
......@@ -46,9 +46,8 @@ export class Cat extends Module {
this.initCatLottieArr();
console.log(this.catLottieArr);
this.initCat();
this.setCatAnimShow(1,()=>{
this.setCatAnimShow(0);
});
this.initEvents();
}
/**初始化猫咪Lottie数据组 */
......@@ -125,7 +124,9 @@ export class Cat extends Module {
if (i == index) {
this.catAnimArr[i].visible = true;
let loop = callback ? 1 : 0;
console.log("hahaha",loop)
this.catAnimArr[i].play(loop, callback)
console.log("播放",index)
} else {
this.catAnimArr[i].visible = false;
this.catAnimArr[i].stop();
......@@ -135,6 +136,30 @@ export class Cat extends Module {
/**猫咪互动 */
catAct(e){
var that = this;
let actType = e.data;
console.log(actType);
// switch(actType){
// case CAT_ACTTYPEP.SLEEP:
// break;
// case CAT_ACTTYPEP.TALK:
// break;
// case CAT_ACTTYPEP.CLEAR:
// break;
// case CAT_ACTTYPEP.RUA:
// break;
// case CAT_ACTTYPEP.PLAY:
// break;
// case CAT_ACTTYPEP.TOUCH:
// break;
// }
switch(actType){
case CAT_ACTTYPEP.SLEEP:
break;
default:
that.setCatAnimShow(actType,()=>{that.setCatAnimShow(0)});
break;
}
}
......
......@@ -83,7 +83,6 @@ export class MainScene extends Scene{
break;
}
that.mainUi.changeBtnByUiType(type);
}
......
import { Module } from "../../module/views/Module";
import { MSG, SCENETYPE } from "../Enum";
import { CATTYPE, CAT_ACTTYPEP, MSG, SCENETYPE } from "../Enum";
import resCanvasList from "../../../game/resCanvasList"
import { RES } from "../../module/RES";
import { Ins } from "../Ins";
......@@ -184,7 +184,26 @@ export class MainSceneBtnUi extends Module{
/**玩耍 */
catPlay(){
console.log("玩耍");
console.log("点击玩耍");
FYGE.GDispatcher.dispatchEvent(MSG.CAT_ACT,CAT_ACTTYPEP.PLAY);
}
/**梳毛 */
catClear(){
console.log("点击梳毛");
FYGE.GDispatcher.dispatchEvent(MSG.CAT_ACT,CAT_ACTTYPEP.CLEAR);
}
/**撸猫 */
catRua(){
console.log("点击撸猫")
FYGE.GDispatcher.dispatchEvent(MSG.CAT_ACT,CAT_ACTTYPEP.RUA);
}
/**摸头杀 */
catTouch(){
console.log("点击摸头杀")
FYGE.GDispatcher.dispatchEvent(MSG.CAT_ACT,CAT_ACTTYPEP.TOUCH);
}
/**打开攻略 */
......@@ -205,7 +224,12 @@ export class MainSceneBtnUi extends Module{
that.addEvent(that.energyBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.returnBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.strategyBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.prizeBtn,FYGE.MouseEvent.CLICK,that.touchHandler)
that.addEvent(that.prizeBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.playBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.catBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.combingBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
that.addEvent(that.touchHeadBtn,FYGE.MouseEvent.CLICK,that.touchHandler);
}
/**添加事件,为了防止obj没有被创建封装 */
......
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