Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
elephant
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
elephant
Commits
d4e105db
Commit
d4e105db
authored
Jun 13, 2022
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
c07d7564
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
27 deletions
+29
-27
changeSkin.ts
assets/elephant/scene/changeSkin.ts
+17
-15
elephant.fire
assets/elephant/scene/elephant.fire
+10
-10
pg.ts
assets/elephant/scene/pg.ts
+2
-2
No files found.
assets/elephant/scene/changeSkin.ts
View file @
d4e105db
...
@@ -32,27 +32,29 @@ export default class ChangeItemAnimation extends cc.Component {
...
@@ -32,27 +32,29 @@ export default class ChangeItemAnimation extends cc.Component {
}
}
changeSkin
(
data
)
{
changeSkin
(
data
)
{
pg
.
view
.
setNetImg
(
this
.
node
,
data
.
itemImage
,
true
);
pg
.
view
.
setNetImg
(
this
.
node
,
data
.
itemImage
,
false
).
then
(()
=>
{
let
{
x
,
y
,
width
,
height
}
=
this
.
node
;
if
(
data
.
rect
)
{
x
=
data
.
rect
.
x
;
y
=
data
.
rect
.
y
;
width
=
data
.
rect
.
width
;
height
=
data
.
rect
.
height
;
this
.
node
.
x
=
x
;
this
.
node
.
y
=
y
;
this
.
node
.
width
=
width
;
this
.
node
.
height
=
height
;
}
user
.
updateFurniture
(
data
,
{
x
,
y
,
width
,
height
});
});
if
(
!
this
.
animNode
)
{
if
(
!
this
.
animNode
)
{
return
;
return
;
}
}
this
.
animNode
.
active
=
true
;
this
.
animNode
.
active
=
true
;
cc
.
audioEngine
.
play
(
this
.
starPopAudio
,
false
,
1
);
cc
.
audioEngine
.
play
(
this
.
starPopAudio
,
false
,
1
);
this
.
armatureDisplay
.
playAnimation
(
"
newAnimation
"
,
1
);
this
.
armatureDisplay
.
playAnimation
(
"
newAnimation
"
,
1
);
let
{
x
,
y
,
width
,
height
}
=
this
.
node
;
if
(
data
.
rect
)
{
x
=
data
.
rect
.
x
;
y
=
data
.
rect
.
y
;
width
=
data
.
rect
.
width
;
height
=
data
.
rect
.
height
;
this
.
node
.
x
=
x
;
this
.
node
.
y
=
y
;
this
.
node
.
width
=
width
;
this
.
node
.
height
=
height
;
}
user
.
updateFurniture
(
data
,
{
x
,
y
,
width
,
height
});
}
}
OnCallAnimationPlayComplete
()
{
OnCallAnimationPlayComplete
()
{
console
.
log
(
1111
);
console
.
log
(
1111
);
...
...
assets/elephant/scene/elephant.fire
View file @
d4e105db
...
@@ -1605,7 +1605,7 @@
...
@@ -1605,7 +1605,7 @@
"__id__": 30
"__id__": 30
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 33
"__id__": 33
...
@@ -1890,7 +1890,7 @@
...
@@ -1890,7 +1890,7 @@
"__id__": 39
"__id__": 39
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 42
"__id__": 42
...
@@ -2382,7 +2382,7 @@
...
@@ -2382,7 +2382,7 @@
"__id__": 56
"__id__": 56
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 59
"__id__": 59
...
@@ -2918,7 +2918,7 @@
...
@@ -2918,7 +2918,7 @@
"__id__": 69
"__id__": 69
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 72
"__id__": 72
...
@@ -3203,7 +3203,7 @@
...
@@ -3203,7 +3203,7 @@
"__id__": 78
"__id__": 78
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 81
"__id__": 81
...
@@ -3488,7 +3488,7 @@
...
@@ -3488,7 +3488,7 @@
"__id__": 87
"__id__": 87
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 90
"__id__": 90
...
@@ -3773,7 +3773,7 @@
...
@@ -3773,7 +3773,7 @@
"__id__": 96
"__id__": 96
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 99
"__id__": 99
...
@@ -4058,7 +4058,7 @@
...
@@ -4058,7 +4058,7 @@
"__id__": 105
"__id__": 105
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 108
"__id__": 108
...
@@ -4343,7 +4343,7 @@
...
@@ -4343,7 +4343,7 @@
"__id__": 114
"__id__": 114
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 117
"__id__": 117
...
@@ -4628,7 +4628,7 @@
...
@@ -4628,7 +4628,7 @@
"__id__": 123
"__id__": 123
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 126
"__id__": 126
...
...
assets/elephant/scene/pg.ts
View file @
d4e105db
...
@@ -148,8 +148,8 @@ let pg = {
...
@@ -148,8 +148,8 @@ let pg = {
if
(
!
cc
.
isValid
(
node
))
return
pg
.
logger
.
i
(
"
节点已销毁
"
);
if
(
!
cc
.
isValid
(
node
))
return
pg
.
logger
.
i
(
"
节点已销毁
"
);
let
nw
=
node
.
width
=
texture
.
width
;
let
nw
=
node
.
width
=
texture
.
width
;
let
nh
=
node
.
height
=
texture
.
height
;
let
nh
=
node
.
height
=
texture
.
height
;
let
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
);
let
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
);
node
.
net_spriteFrame
node
.
net_url
=
res
;
node
.
net_url
=
res
;
const
cover
=
node
.
getChildByName
(
'
cover
'
);
const
cover
=
node
.
getChildByName
(
'
cover
'
);
if
(
cover
)
{
if
(
cover
)
{
...
@@ -312,7 +312,7 @@ let pg = {
...
@@ -312,7 +312,7 @@ let pg = {
})
})
})
})
},
},
loadNetImg
:
function
(
url
)
{
loadNetImg
:
async
function
(
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
loader
.
load
({
url
},
(
err
,
texture
)
=>
{
cc
.
loader
.
load
({
url
},
(
err
,
texture
)
=>
{
if
(
err
&&
!
texture
)
return
resolve
(
pg
.
logger
.
w
(
'
loading loadRes warn->
'
+
texture
));
if
(
err
&&
!
texture
)
return
resolve
(
pg
.
logger
.
w
(
'
loading loadRes warn->
'
+
texture
));
...
...
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