Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
2
241106_yogurt_snake
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
241106_yogurt_snake
Commits
52a37745
Commit
52a37745
authored
Nov 06, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
d5dfa462
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
37 deletions
+37
-37
README.md
README.md
+0
-12
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+4
-1
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+21
-20
CinestationBrain.ts
assets/cinestation/runtime/CinestationBrain.ts
+12
-4
No files found.
README.md
View file @
52a37745
# 免费登录页-正式
# https://activity.m.duiba.com.cn/customShare/share?id=Did1NTc3NTE
### 免费登录页-测试
### https://activity.m.duiba.com.cn/customShare/share?id=Did1NTc1OTk
assets/Bundles/MainGame/MainGame.scene
View file @
52a37745
...
...
@@ -1168,7 +1168,7 @@
"__id__": 31
},
"debugMaterial": null,
"_id": "
0170hzm29NjqN8GPRvbRKp
"
"_id": "
9d+RdU59dPA41uxbCiVcAe
"
},
{
"__type__": "CinestationBlendDefinition",
...
...
@@ -3040,6 +3040,9 @@
"player": {
"__id__": 54
},
"camera": {
"__id__": 28
},
"initWall": {
"__id__": 33
},
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
52a37745
...
...
@@ -2,20 +2,22 @@ import {
_decorator
,
Collider
,
Color
,
easing
,
EPhysicsDrawFlags
,
game
,
easing
,
ICollisionEvent
,
Input
,
input
,
instantiate
,
ITriggerEvent
,
Label
,
lerp
,
Light
,
MeshRenderer
,
Label
,
lerp
,
Light
,
MeshRenderer
,
Node
,
ParticleSystem
,
ParticleSystemComponent
,
ParticleSystem
,
PhysicsSystem
,
PointToPointConstraint
,
Prefab
,
RigidBody
,
Texture2D
,
RigidBody
,
Tween
,
tween
,
v3
,
...
...
@@ -28,7 +30,7 @@ import GameMgr from "../../GameMgr";
import
{
AudioMgr
}
from
"../../../core_tgx/base/AudioMgr"
;
import
{
BgAndColor
}
from
"./BgAndColor"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"MainGame"
)
...
...
@@ -44,7 +46,6 @@ export class MainGame extends Scene {
playerBody
:
RigidBody
=
null
;
playerConstraint
:
PointToPointConstraint
=
null
;
@
property
(
Node
)
initWall
:
Node
=
null
;
@
property
(
Prefab
)
wallPrefab
:
Prefab
=
null
;
...
...
@@ -54,11 +55,11 @@ export class MainGame extends Scene {
@
property
(
Light
)
light
:
Light
=
null
;
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Node
,
group
:
"UI"
})
hitTip
:
Node
=
null
;
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Node
,
group
:
"UI"
})
hitTip
:
Node
=
null
;
@
property
({
type
:
Node
})
bg
:
Node
=
null
;
@
property
({
type
:
[
BgAndColor
],
visible
:
true
,
displayName
:
`背景和颜色`
})
@
property
({
type
:
Node
})
bg
:
Node
=
null
;
@
property
({
type
:
[
BgAndColor
],
visible
:
true
,
displayName
:
`背景和颜色`
})
private
bgAndColor
:
BgAndColor
[]
=
[];
private
_score
:
number
=
0
;
...
...
@@ -151,7 +152,7 @@ export class MainGame extends Scene {
}
onTriggerEnter
(
event
:
ITriggerEvent
)
{
const
{
otherCollider
,
selfCollider
}
=
event
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
otherName
=
otherCollider
.
node
.
name
;
...
...
@@ -164,9 +165,9 @@ export class MainGame extends Scene {
this
.
unschedule
(
this
.
scoreRadioFunc
);
this
.
scheduleOnce
(
this
.
scoreRadioFunc
,
5
);
tween
(
this
.
hitTip
)
.
set
({
active
:
true
})
.
set
({
active
:
true
})
.
delay
(
2
)
.
set
({
active
:
false
})
.
set
({
active
:
false
})
.
start
();
const
crushNode
=
instantiate
(
this
.
crushPrefab
);
...
...
@@ -183,7 +184,7 @@ export class MainGame extends Scene {
onPlayerCollision
(
event
:
ICollisionEvent
)
{
if
(
this
.
isOver
)
return
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
otherGroup
=
otherCollider
.
getGroup
();
...
...
@@ -211,12 +212,12 @@ export class MainGame extends Scene {
changeMainColor
()
{
this
.
randomMainColor
();
const
{
bg
,
color
}
=
this
.
mainColor
;
const
{
bg
,
color
}
=
this
.
mainColor
;
this
.
bg
.
getComponent
(
MeshRenderer
).
material
.
setProperty
(
"mainTexture"
,
bg
);
this
.
lightTween
?.
removeSelf
();
this
.
lightTween
=
tween
({
radio
:
0
})
.
to
(
1
,
{
radio
:
1
},
{
this
.
lightTween
=
tween
({
radio
:
0
})
.
to
(
1
,
{
radio
:
1
},
{
easing
:
easing
.
quadInOut
,
onUpdate
:
(
target
,
ratio
)
=>
{
this
.
lightColor
.
lerp
(
color
,
ratio
);
...
...
@@ -310,7 +311,7 @@ export class MainGame extends Scene {
const
propLen
=
this
.
propCFG
.
length
;
let
create
=
false
;
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
const
{
lastZ
,
interval
}
=
this
.
propCFG
[
i
];
const
{
lastZ
,
interval
}
=
this
.
propCFG
[
i
];
const
dz
=
lastZ
-
pz
;
if
(
create
)
{
this
.
propCFG
[
i
].
lastZ
=
pz
;
...
...
@@ -331,7 +332,7 @@ export class MainGame extends Scene {
wallTs
.
reset
();
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
const
{
funcName
,
create
}
=
this
.
propCFG
[
i
];
const
{
funcName
,
create
}
=
this
.
propCFG
[
i
];
if
(
create
)
{
this
.
propCFG
[
i
].
create
=
false
;
wallTs
[
funcName
]();
...
...
assets/cinestation/runtime/CinestationBrain.ts
View file @
52a37745
import
{
_decorator
,
Camera
,
lerp
,
clamp01
,
primitives
,
utils
,
Mesh
,
Material
,
Vec2
,
Vec3
,
Tween
}
from
'cc'
;
import
{
_decorator
,
Camera
,
lerp
,
clamp01
,
primitives
,
utils
,
Quat
,
Mesh
,
Material
,
Vec2
,
Vec3
,
Tween
}
from
'cc'
;
import
{
CinestationBlendDefinition
,
CinestationBlendFunc
}
from
'./CinestationBlendDefinition'
;
import
{
cinestation
}
from
'./CinestationData'
;
import
{
Nullable
}
from
'./Common/Types'
;
...
...
@@ -8,6 +8,9 @@ const { ccclass, property, executionOrder, executeInEditMode } = _decorator;
let
__point
=
new
Vec2
();
const
tempCameraPos
=
new
Vec3
();
const
tempCameraRot
=
new
Quat
();
@
ccclass
(
'CinestationBrain'
)
@
executeInEditMode
@
executionOrder
(
-
1
)
...
...
@@ -85,9 +88,14 @@ export class CinestationBrain extends Visualization {
if
(
CC_EDITOR
)
return
;
if
(
!
cinestation
.
mainCamera
)
return
;
let
from
=
cinestation
.
mainCamera
,
to
=
vcam
;
from
.
node
.
worldPosition
=
from
.
node
.
worldPosition
.
lerp
(
to
.
finalPosition
,
t
);
from
.
node
.
worldRotation
=
from
.
node
.
worldRotation
.
lerp
(
to
.
finalRotation
,
t
);
const
from
=
cinestation
.
mainCamera
,
to
=
vcam
;
from
.
node
.
getWorldPosition
(
tempCameraPos
);
from
.
node
.
getWorldRotation
(
tempCameraRot
);
from
.
node
.
setWorldPosition
(
tempCameraPos
.
lerp
(
to
.
finalPosition
,
t
));
from
.
node
.
setWorldRotation
(
tempCameraRot
.
lerp
(
to
.
finalRotation
,
t
));
from
.
fov
=
lerp
(
from
.
fov
,
to
.
lens
.
fov
,
t
);
from
.
near
=
lerp
(
from
.
near
,
to
.
lens
.
near
,
t
);
from
.
far
=
lerp
(
from
.
far
,
to
.
lens
.
far
,
t
);
...
...
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