Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StockRunning
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
czy
StockRunning
Commits
37699eda
Commit
37699eda
authored
Apr 26, 2021
by
czy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏结束后的滑行效果
parent
e5e98b85
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
13 deletions
+45
-13
DemoScenes.unity
StockRunning/Assets/#A1_Scenes/DemoScenes.unity
+5
-0
AIMove.cs
StockRunning/Assets/My/Scripts/AI/AIMove.cs
+15
-5
EndPoint.cs
StockRunning/Assets/My/Scripts/EndPoint.cs
+5
-0
PlayerMove.cs
StockRunning/Assets/My/Scripts/Player/PlayerMove.cs
+20
-8
No files found.
StockRunning/Assets/#A1_Scenes/DemoScenes.unity
View file @
37699eda
...
...
@@ -4700,6 +4700,11 @@ PrefabInstance:
propertyPath
:
m_Mesh
value
:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
8161822684297487994
,
guid
:
e808ab909854dca4dba20c69399d6a13
,
type
:
3
}
propertyPath
:
m_IsActive
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
8639644498048831415
,
guid
:
e808ab909854dca4dba20c69399d6a13
,
type
:
3
}
propertyPath
:
m_Mesh
...
...
StockRunning/Assets/My/Scripts/AI/AIMove.cs
View file @
37699eda
...
...
@@ -232,11 +232,11 @@ public class AIMove : MonoBehaviour
isAddSpeed
=
true
;
return
;
}
if
(
BattleCtrl
.
instance
.
isEndBattle
)
{
isAddSpeed
=
true
;
return
;
}
//
if (BattleCtrl.instance.isEndBattle)
//
{
//
isAddSpeed = true;
//
return;
//
}
if
(
targetObj
==
null
)
{
targetObj
=
GetTargetPos
();
...
...
@@ -339,6 +339,16 @@ public class AIMove : MonoBehaviour
timerVertigo
-=
Time
.
deltaTime
;
}
}
else
{
//游戏已经结束但可以继续滑行
//print("游戏已经结束但可以继续滑行"); //Move((transform.forward * MoveSpeed + new Vector3(0, _vertSpeed, 0)) * Time.deltaTime + (new Vector3(xDelta, 0, 0)));
if
(
characterController
.
velocity
.
z
>=
0
)
{
characterController
.
SimpleMove
(
new
Vector3
(
0
,
0
,
characterController
.
velocity
.
z
-
15
*
Time
.
deltaTime
));
}
}
}
...
...
StockRunning/Assets/My/Scripts/EndPoint.cs
View file @
37699eda
...
...
@@ -18,6 +18,11 @@ public class EndPoint : MonoBehaviour
}
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(!
BattleCtrl
.
instance
.
isStartBattle
||
BattleCtrl
.
instance
.
isEndBattle
)
{
return
;
}
if
(
other
.
tag
==
"Player"
)
{
//游戏胜利
...
...
StockRunning/Assets/My/Scripts/Player/PlayerMove.cs
View file @
37699eda
...
...
@@ -73,7 +73,6 @@ public class PlayerMove : MonoBehaviour
private
Dictionary
<
Rigidbody
,
bool
>
m_dicRigidDic
=
new
Dictionary
<
Rigidbody
,
bool
>();
private
bool
isGround1
=
true
;
private
bool
isGround2
=
true
;
private
bool
isAddSpeed
=
true
;
private
float
timer
=
0.0f
;
//输入控制player移动的中间变量
...
...
@@ -231,14 +230,17 @@ public class PlayerMove : MonoBehaviour
if
(!
BattleCtrl
.
instance
.
isStartBattle
)
{
isAddSpeed
=
true
;
return
;
}
if
(
BattleCtrl
.
instance
.
isEndBattle
)
{
isAddSpeed
=
true
;
//游戏没有开始
return
;
}
//if (BattleCtrl.instance.isEndBattle)
//{
// //游戏没有结束
// return;
//}
//移动
MoveSpeed
=
VSpeed
+
(
AddSpeed
*
(
SpeedLevel
-
1
));
//是否在地面
...
...
@@ -248,7 +250,7 @@ public class PlayerMove : MonoBehaviour
animator
.
SetBool
(
"Grounded"
,
Grounded
);
//不在地面上给物体添加一个模拟重力
if
(!
Grounded
)
{
_vertSpeed
+=
-
9.8f
*
5
*
Time
.
deltaTime
;
...
...
@@ -315,6 +317,16 @@ public class PlayerMove : MonoBehaviour
timerVertigo
-=
Time
.
deltaTime
;
xDelta
=
0
;
//避免眩晕期间不会执行UpdateJoystick();造成偏移现象。
}
}
else
{
//游戏已经结束但可以继续滑行
//print("游戏已经结束但可以继续滑行"); //Move((transform.forward * MoveSpeed + new Vector3(0, _vertSpeed, 0)) * Time.deltaTime + (new Vector3(xDelta, 0, 0)));
if
(
characterController
.
velocity
.
z
>=
0
)
{
characterController
.
SimpleMove
(
new
Vector3
(
0
,
0
,
characterController
.
velocity
.
z
-
15
*
Time
.
deltaTime
));
}
}
...
...
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