Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
bdf9beb9
Commit
bdf9beb9
authored
Sep 21, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
6a87293d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
25 deletions
+89
-25
resCanvasList.js
project/src/canvas/game/resCanvasList.js
+12
-12
resLottieList.js
project/src/canvas/game/resLottieList.js
+4
-4
Enum.ts
project/src/canvas/game/src/Enum.ts
+16
-0
Cat.ts
project/src/canvas/game/src/cat/Cat.ts
+30
-5
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+0
-1
MainSceneBtnUi.ts
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
+27
-3
No files found.
project/src/canvas/game/resCanvasList.js
View file @
bdf9beb9
...
...
@@ -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-e792e48700e
0'
:
{
'
72987d74-2fa7-49b9-865d-a0d80c6ed22
0'
:
{
name
:
'OrengeCatTexture'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/OrengeCatTexture.
3c7d51810caa1db0ff2d371c86ff5e5b877fe506
.png'
,
uuid
:
'
8d158036-37a0-4c5c-b4bf-e792e48700e
0'
url
:
'//yun.duiba.com.cn/spark/assets/OrengeCatTexture.
c0e942ac2dfbbe36c60acd9cd66b6800e34ab7e7
.png'
,
uuid
:
'
72987d74-2fa7-49b9-865d-a0d80c6ed22
0'
},
'
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
;
project/src/canvas/game/resLottieList.js
View file @
bdf9beb9
...
...
@@ -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-e792e48700e
0"
].
url
,
imgUrl
:
resCanvasList
[
"
72987d74-2fa7-49b9-865d-a0d80c6ed22
0"
].
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
}
}
...
...
project/src/canvas/game/src/Enum.ts
View file @
bdf9beb9
...
...
@@ -28,4 +28,20 @@ export enum CATTYPE{
SANHUA
,
/**暹罗 */
XIANLUO
}
/**猫咪互动动作 */
export
enum
CAT_ACTTYPEP
{
/**睡觉 */
SLEEP
,
/**说话 */
TALK
,
/**梳毛 */
CLEAR
,
/**撸猫 */
RUA
,
/**玩耍 */
PLAY
,
/**摸头杀 */
TOUCH
}
\ No newline at end of file
project/src/canvas/game/src/cat/Cat.ts
View file @
bdf9beb9
...
...
@@ -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
{
...
...
@@ -31,7 +31,7 @@ export class Cat extends Module {
super
(
data
);
this
.
catType
=
data
.
type
;
}
catType
:
any
;
cat_sleep
:
FYGE
.
Lottie
;
//睡觉
cat_talk
:
FYGE
.
Lottie
;
//说话
...
...
@@ -46,9 +46,8 @@ export class Cat extends Module {
this
.
initCatLottieArr
();
console
.
log
(
this
.
catLottieArr
);
this
.
initCat
();
this
.
setCatAnimShow
(
1
,()
=>
{
this
.
setCatAnimShow
(
0
);
});
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
;
}
}
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
bdf9beb9
...
...
@@ -83,7 +83,6 @@ export class MainScene extends Scene{
break
;
}
that
.
mainUi
.
changeBtnByUiType
(
type
);
}
...
...
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
View file @
bdf9beb9
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没有被创建封装 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment