Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FT_12
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
FT_12
Commits
d7651dfb
Commit
d7651dfb
authored
Dec 25, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉本地资源
parent
856618f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
198 deletions
+6
-198
ItemAnswer.js
play/assets/tmpGame/script/ItemAnswer.js
+4
-4
ItemQuestion.js
play/assets/tmpGame/script/ItemQuestion.js
+0
-183
ItemQuestion.js.meta
play/assets/tmpGame/script/ItemQuestion.js.meta
+0
-9
Scene.js
play/assets/tmpGame/script/Scene.js
+2
-2
No files found.
play/assets/tmpGame/script/ItemAnswer.js
View file @
d7651dfb
...
...
@@ -103,9 +103,9 @@ cc.Class({
// imageUrl = 'http://127.0.0.1/NewProject_2_tex.png';
// skeUrl = 'http://127.0.0.1/NewProject_2_ske.json';
// atlasUrl = 'http://127.0.0.1/NewProject_2_tex.json';
imageUrl
=
'
http://127.0.0.1/walkingfish_tex.png
'
;
skeUrl
=
'
http://127.0.0.1/walkingfish_ske.json
'
;
atlasUrl
=
'
http://127.0.0.1/walkingfish_tex.json
'
;
//
imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
//
skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
//
atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
cc
.
assetManager
.
loadAny
([{
url
:
atlasUrl
,
ext
:
'
.txt
'
},
{
url
:
skeUrl
,
ext
:
'
.txt
'
}],
(
error
,
assets
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
...
...
@@ -303,7 +303,7 @@ cc.Class({
playAudioOption
(
cb1
,
cb2
)
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
optionAudio
;
url
=
'
http://127.0.0.1/iamflying.mp3
'
;
//
url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
...
...
play/assets/tmpGame/script/ItemQuestion.js
deleted
100644 → 0
View file @
856618f1
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
nodBg1
:
cc
.
Node
,
nodBg2
:
cc
.
Node
,
dragonBone
:
dragonBones
.
ArmatureDisplay
,
labQuestion1
:
cc
.
Label
,
labQuestion2
:
cc
.
Label
,
labQuestion3
:
cc
.
Label
,
},
// onLoad () {},
start
()
{
},
onEnable
()
{
this
.
node
.
on
(
'
touchstart
'
,
this
.
onTouchStart
,
this
);
},
onDisable
()
{
this
.
node
.
off
(
'
touchstart
'
,
this
.
onTouchStart
,
this
);
},
setInfo
(
data
,
index
,
scene
)
{
this
.
scene
=
scene
;
this
.
data
=
data
;
this
.
index
=
index
;
this
.
updateLabels
();
this
.
loadDragonBone
();
},
loadDragonBone
()
{
this
.
dragonBone
.
dragonAtlasAsset
=
null
;
this
.
dragonBone
.
dragonAsset
=
null
;
this
.
dragonBone
.
armatureName
=
''
;
var
imageUrl
=
this
.
data
.
optionDragonBone
.
texPngData
.
url
;
var
skeUrl
=
this
.
data
.
optionDragonBone
.
skeJsonData
.
url
;
var
atlasUrl
=
this
.
data
.
optionDragonBone
.
texJsonData
.
url
;
// imageUrl = 'http://127.0.0.1/NewProject_2_tex.png';
// skeUrl = 'http://127.0.0.1/NewProject_2_ske.json';
// atlasUrl = 'http://127.0.0.1/NewProject_2_tex.json';
// imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
// skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
// atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
cc
.
assetManager
.
loadAny
([{
url
:
atlasUrl
,
ext
:
'
.txt
'
},
{
url
:
skeUrl
,
ext
:
'
.txt
'
}],
(
error
,
assets
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
cc
.
assetManager
.
loadRemote
(
imageUrl
,
(
error
,
texture
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
var
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
_uuid
=
atlasUrl
;
atlas
.
atlasJson
=
assets
[
0
];
atlas
.
texture
=
texture
;
var
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
_uuid
=
skeUrl
;
asset
.
dragonBonesJson
=
assets
[
1
];
this
.
dragonBone
.
dragonAtlasAsset
=
atlas
;
this
.
dragonBone
.
dragonAsset
=
asset
;
let
data
=
asset
.
_dragonBonesJsonData
.
armature
[
0
];
if
(
!
data
)
{
return
;
}
this
.
dragonBone
.
armatureName
=
data
.
name
;
this
.
animationName
=
data
.
animation
[
0
].
name
;
// this.dragonBone.premultipliedAlpha = true;
// atlas.texture.setPremultiplyAlpha(true);
}
});
}
});
},
updateLabels
()
{
this
.
labQuestion1
.
string
=
this
.
data
.
text
;
this
.
labQuestion2
.
string
=
this
.
data
.
text
;
this
.
labQuestion3
.
string
=
this
.
data
.
text
;
this
.
labQuestion1
.
_forceUpdateRenderData
();
this
.
labQuestion2
.
_forceUpdateRenderData
();
this
.
labQuestion3
.
_forceUpdateRenderData
();
if
(
this
.
labQuestion1
.
node
.
width
>
145
)
{
this
.
labQuestion1
.
node
.
scale
=
145
/
this
.
labQuestion1
.
node
.
width
;
this
.
labQuestion2
.
node
.
scale
=
145
/
this
.
labQuestion1
.
node
.
width
;
this
.
labQuestion3
.
node
.
scale
=
145
/
this
.
labQuestion1
.
node
.
width
;
}
},
setChooseRight
(
dragonBone
,
animationName
)
{
this
.
isRight
=
true
;
this
.
animationName2
=
animationName
;
this
.
nodBg1
.
active
=
false
;
this
.
nodBg2
.
active
=
true
;
this
.
labQuestion1
.
node
.
parent
.
active
=
false
;
this
.
labQuestion2
.
node
.
parent
.
active
=
false
;
this
.
labQuestion3
.
node
.
active
=
true
;
this
.
nodDragonBone2
=
cc
.
instantiate
(
dragonBone
.
node
);
this
.
nodDragonBone2
.
parent
=
this
.
node
;
this
.
nodDragonBone2
.
x
=
40
;
this
.
nodDragonBone2
.
y
=
this
.
dragonBone
.
node
.
y
;
this
.
dragonBone
.
node
.
x
=
-
40
;
this
.
playAudioOption
(
true
);
this
.
dragonBone
.
playAnimation
(
this
.
animationName
,
0
);
this
.
nodDragonBone2
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
animationName
,
0
);
},
stopRightAnimation
()
{
this
.
dragonBone
.
playAnimation
(
this
.
animationName
,
1
);
this
.
nodDragonBone2
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
this
.
animationName2
,
1
);
},
setGray
()
{
this
.
isGray
=
true
;
this
.
labQuestion1
.
node
.
parent
.
active
=
false
;
this
.
labQuestion2
.
node
.
parent
.
active
=
false
;
this
.
nodBg1
.
color
=
new
cc
.
Color
().
fromHEX
(
'
#7E7E7E
'
);
this
.
dragonBone
.
node
.
color
=
new
cc
.
Color
().
fromHEX
(
'
#7E7E7E
'
);
},
setNormal
()
{
this
.
isGray
=
false
;
this
.
nodBg1
.
color
=
new
cc
.
Color
().
fromHEX
(
'
#ffffff
'
);
this
.
dragonBone
.
node
.
color
=
new
cc
.
Color
().
fromHEX
(
'
#ffffff
'
);
},
onTouchStart
()
{
if
(
GameData
.
isMoving
)
{
return
;
}
if
(
this
.
isRight
)
{
return
;
}
if
(
this
.
isGray
)
{
return
;
}
if
(
GameData
.
audioCount
!=
0
)
{
return
;
}
this
.
showQipao
();
this
.
playAudioOption
();
},
showQipao
()
{
if
(
this
.
index
==
3
)
{
this
.
labQuestion1
.
node
.
parent
.
active
=
false
;
this
.
labQuestion2
.
node
.
parent
.
active
=
true
;
}
else
{
this
.
labQuestion1
.
node
.
parent
.
active
=
true
;
this
.
labQuestion2
.
node
.
parent
.
active
=
false
;
}
},
playAudioOption
(
showNext
)
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
optionAudio
;
// url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
return
;
}
let
id
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
if
(
!
cc
.
isValid
(
this
)){
return
;
}
GameData
.
audioCount
--
;
if
(
showNext
)
{
this
.
scene
.
showNext
(
this
.
index
);
}
})
});
},
// update (dt) {},
});
play/assets/tmpGame/script/ItemQuestion.js.meta
deleted
100644 → 0
View file @
856618f1
{
"ver": "1.0.8",
"uuid": "801cd7c3-d02a-4ae9-8bd2-42c13f8f7456",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/script/Scene.js
View file @
d7651dfb
...
...
@@ -215,7 +215,7 @@ cc.Class({
playAudioQuestion
(
isBtn
)
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
questionList
[
GameData
.
questionIndex
].
questionAudio
;
url
=
'
http://127.0.0.1/iamflying.mp3
'
;
//
url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
...
...
@@ -465,7 +465,7 @@ cc.Class({
playAudio
(
cb
)
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
optionAudio
;
url
=
'
http://127.0.0.1/iamflying.mp3
'
;
//
url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
...
...
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