Skip to content

Commit c8dfe12

Browse files
committed
整理Mplayer
1 parent 04a1af2 commit c8dfe12

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CrazyCar/Assets/Scripts/Game/MPlayer.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void Update() {
8686
}
8787
}
8888
// 不能放在FixedUpdate 加速时间太短
89-
ShowScreenEffect();
89+
ShowVFX();
9090
}
9191

9292
public void ConfirmStatus(PlayerStateMsg playerStateMsg) {
@@ -121,10 +121,11 @@ private void FixedUpdate() {
121121
}
122122
}
123123

124-
private void ShowScreenEffect() {
124+
private void ShowVFX() {
125125
if (leftTrail.enabled == true) {
126126
EnableScreenEffect();
127127
PlayDriftParticle();
128+
this.GetSystem<ISoundSystem>().PlayWheelEngineSound();
128129
} else {
129130
DisableScreenEffect();
130131
StopDriftParticle();
@@ -287,13 +288,13 @@ private void Boost(float boostForce) {
287288
EnableTrail();
288289
}
289290

291+
#region VFX
290292
private void PlayDriftParticle() {
291293
foreach (var tempParticle in wheelsParticeles) {
292294
tempParticle.Play();
293295
}
294296
plexusVFX.gameObject.SetActiveFast(true);
295-
wireframeVFX.SetActiveFast(true);
296-
this.GetSystem<ISoundSystem>().PlayWheelEngineSound();
297+
wireframeVFX.SetActiveFast(true);
297298
}
298299

299300
private void StopDriftParticle() {
@@ -323,6 +324,7 @@ private void DisableScreenEffect() {
323324
screenEffectTime = 0;
324325
this.GetSystem<IScreenEffectsSystem>().SetMotionBlur(screenEffectTime);
325326
}
327+
#endregion
326328

327329
private void ChangeDriftColor() {
328330
foreach (var tempParticle in wheelsParticeles) {

0 commit comments

Comments
 (0)