Skip to content

Commit 006451f

Browse files
committed
修复avatar问题
1 parent d40d33d commit 006451f

File tree

8 files changed

+67
-84
lines changed

8 files changed

+67
-84
lines changed

CrazyCar/Assets/Anim/Buttons/Base/Button.controller

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -167,35 +167,35 @@ AnimationClip:
167167
- serializedVersion: 3
168168
time: 0.33333334
169169
value: {x: 0.89417326, y: 1.2384838, z: 0.96585757}
170-
inSlope: {x: -0.29908723, y: 1.1291018, z: -0.06096863}
171-
outSlope: {x: -0.29908723, y: 1.1291018, z: -0.06096863}
170+
inSlope: {x: -0.5553374, y: 1.2830082, z: -0.06096863}
171+
outSlope: {x: -0.5553374, y: 1.2830082, z: -0.06096863}
172172
tangentMode: 0
173173
weightedMode: 0
174174
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
175175
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
176176
- serializedVersion: 3
177177
time: 0.53333336
178-
value: {x: 1.1025001, y: 0.9384374, z: 1}
179-
inSlope: {x: 0.10081676, y: -0.565428, z: 0.08535608}
180-
outSlope: {x: 0.10081676, y: -0.565428, z: 0.08535608}
178+
value: {x: 1, y: 1, z: 1}
179+
inSlope: {x: 0.2645668, y: -0.5962094, z: 0.08535608}
180+
outSlope: {x: 0.2645668, y: -0.5962094, z: 0.08535608}
181181
tangentMode: 0
182182
weightedMode: 0
183183
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
184184
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
185185
- serializedVersion: 3
186186
time: 0.7
187-
value: {x: 0.96250004, y: 1, z: 1}
188-
inSlope: {x: -0.30750036, y: 0.18468784, z: 0}
189-
outSlope: {x: -0.30750036, y: 0.18468784, z: 0}
187+
value: {x: 1, y: 1, z: 1}
188+
inSlope: {x: 0, y: 0, z: 0}
189+
outSlope: {x: 0, y: 0, z: 0}
190190
tangentMode: 0
191191
weightedMode: 0
192192
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
193193
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
194194
- serializedVersion: 3
195195
time: 0.8666667
196196
value: {x: 1, y: 1, z: 1}
197-
inSlope: {x: 0.22499976, y: 0, z: 0}
198-
outSlope: {x: 0.22499976, y: 0, z: 0}
197+
inSlope: {x: 0, y: 0, z: 0}
198+
outSlope: {x: 0, y: 0, z: 0}
199199
tangentMode: 0
200200
weightedMode: 0
201201
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
@@ -266,35 +266,35 @@ AnimationClip:
266266
- serializedVersion: 3
267267
time: 0.33333334
268268
value: 0.89417326
269-
inSlope: -0.29908723
270-
outSlope: -0.29908723
269+
inSlope: -0.5553374
270+
outSlope: -0.5553374
271271
tangentMode: 34
272272
weightedMode: 0
273273
inWeight: 0.33333334
274274
outWeight: 0.33333334
275275
- serializedVersion: 3
276276
time: 0.53333336
277-
value: 1.1025001
278-
inSlope: 0.10081676
279-
outSlope: 0.10081676
277+
value: 1
278+
inSlope: 0.2645668
279+
outSlope: 0.2645668
280280
tangentMode: 34
281281
weightedMode: 0
282282
inWeight: 0.33333334
283283
outWeight: 0.33333334
284284
- serializedVersion: 3
285285
time: 0.7
286-
value: 0.96250004
287-
inSlope: -0.30750036
288-
outSlope: -0.30750036
286+
value: 1
287+
inSlope: 0
288+
outSlope: 0
289289
tangentMode: 34
290290
weightedMode: 0
291291
inWeight: 0.33333334
292292
outWeight: 0.33333334
293293
- serializedVersion: 3
294294
time: 0.8666667
295295
value: 1
296-
inSlope: 0.22499976
297-
outSlope: 0.22499976
296+
inSlope: 0
297+
outSlope: 0
298298
tangentMode: 34
299299
weightedMode: 0
300300
inWeight: 0.33333334
@@ -330,26 +330,26 @@ AnimationClip:
330330
- serializedVersion: 3
331331
time: 0.33333334
332332
value: 1.2384838
333-
inSlope: 1.1291018
334-
outSlope: 1.1291018
333+
inSlope: 1.2830082
334+
outSlope: 1.2830082
335335
tangentMode: 34
336336
weightedMode: 0
337337
inWeight: 0.33333334
338338
outWeight: 0.33333334
339339
- serializedVersion: 3
340340
time: 0.53333336
341-
value: 0.9384374
342-
inSlope: -0.565428
343-
outSlope: -0.565428
341+
value: 1
342+
inSlope: -0.5962094
343+
outSlope: -0.5962094
344344
tangentMode: 34
345345
weightedMode: 0
346346
inWeight: 0.33333334
347347
outWeight: 0.33333334
348348
- serializedVersion: 3
349349
time: 0.7
350350
value: 1
351-
inSlope: 0.18468784
352-
outSlope: 0.18468784
351+
inSlope: 0
352+
outSlope: 0
353353
tangentMode: 34
354354
weightedMode: 0
355355
inWeight: 0.33333334
@@ -1101,7 +1101,7 @@ AnimationClip:
11011101
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
11021102
- serializedVersion: 3
11031103
time: 0.21666667
1104-
value: {x: 1, y: 1.1, z: 1}
1104+
value: {x: 1, y: 1, z: 1}
11051105
inSlope: {x: 0, y: 0, z: 0}
11061106
outSlope: {x: 0, y: 0, z: 0}
11071107
tangentMode: 0
@@ -1228,7 +1228,7 @@ AnimationClip:
12281228
outWeight: 0.33333334
12291229
- serializedVersion: 3
12301230
time: 0.21666667
1231-
value: 1.1
1231+
value: 1
12321232
inSlope: 0
12331233
outSlope: 0
12341234
tangentMode: 136

CrazyCar/Assets/Prefabs/Maps/MapController.prefab

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ PrefabInstance:
211211
- target: {fileID: 2232891703361486033, guid: a2127052fc71e44479f47bae78633504,
212212
type: 3}
213213
propertyPath: m_LocalPosition.z
214-
value: 15.3
214+
value: 30
215215
objectReference: {fileID: 0}
216216
- target: {fileID: 2232891703361486033, guid: a2127052fc71e44479f47bae78633504,
217217
type: 3}
@@ -634,7 +634,7 @@ PrefabInstance:
634634
- target: {fileID: 8104874950387294631, guid: 414f6887ede4a514a8a094a2d5f3915c,
635635
type: 3}
636636
propertyPath: m_IsActive
637-
value: 1
637+
value: 0
638638
objectReference: {fileID: 0}
639639
m_RemovedComponents: []
640640
m_SourcePrefab: {fileID: 100100000, guid: 414f6887ede4a514a8a094a2d5f3915c, type: 3}

CrazyCar/Assets/Resources/Pages/AvatarUI.prefab

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,6 @@ GameObject:
915915
m_Component:
916916
- component: {fileID: 3314015034337090003}
917917
- component: {fileID: 5169840847226312785}
918-
- component: {fileID: 5246348449289396116}
919918
m_Layer: 5
920919
m_Name: ApplyBtn
921920
m_TagString: Untagged
@@ -963,7 +962,7 @@ MonoBehaviour:
963962
m_SelectOnDown: {fileID: 0}
964963
m_SelectOnLeft: {fileID: 0}
965964
m_SelectOnRight: {fileID: 0}
966-
m_Transition: 3
965+
m_Transition: 2
967966
m_Colors:
968967
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
969968
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
@@ -973,40 +972,22 @@ MonoBehaviour:
973972
m_ColorMultiplier: 1
974973
m_FadeDuration: 0.1
975974
m_SpriteState:
976-
m_HighlightedSprite: {fileID: 0}
977-
m_PressedSprite: {fileID: 0}
978-
m_SelectedSprite: {fileID: 0}
979-
m_DisabledSprite: {fileID: 0}
975+
m_HighlightedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75,
976+
type: 3}
977+
m_PressedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75, type: 3}
978+
m_SelectedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75, type: 3}
979+
m_DisabledSprite: {fileID: 21300000, guid: b4b024c6ca6464483b99578de7edfd49, type: 3}
980980
m_AnimationTriggers:
981981
m_NormalTrigger: Normal
982982
m_HighlightedTrigger: Highlighted
983983
m_PressedTrigger: Pressed
984984
m_SelectedTrigger: Selected
985985
m_DisabledTrigger: Disabled
986986
m_Interactable: 1
987-
m_TargetGraphic: {fileID: 0}
987+
m_TargetGraphic: {fileID: 3314015034781344001}
988988
m_OnClick:
989989
m_PersistentCalls:
990990
m_Calls: []
991-
--- !u!95 &5246348449289396116
992-
Animator:
993-
serializedVersion: 3
994-
m_ObjectHideFlags: 0
995-
m_CorrespondingSourceObject: {fileID: 0}
996-
m_PrefabInstance: {fileID: 0}
997-
m_PrefabAsset: {fileID: 0}
998-
m_GameObject: {fileID: 3314015034337089996}
999-
m_Enabled: 1
1000-
m_Avatar: {fileID: 0}
1001-
m_Controller: {fileID: 9100000, guid: d9ec64ad24308456fa5542623bf92728, type: 2}
1002-
m_CullingMode: 0
1003-
m_UpdateMode: 0
1004-
m_ApplyRootMotion: 0
1005-
m_LinearVelocityBlending: 0
1006-
m_WarningMessage:
1007-
m_HasTransformHierarchy: 1
1008-
m_AllowConstantClipSamplingOptimization: 1
1009-
m_KeepAnimatorControllerStateOnDisable: 0
1010991
--- !u!1 &3314015034781344003
1011992
GameObject:
1012993
m_ObjectHideFlags: 0

CrazyCar/Assets/Resources/Pages/ChangeCarUI.prefab

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ GameObject:
8888
m_Component:
8989
- component: {fileID: 621010047649866807}
9090
- component: {fileID: 7123864035058230709}
91-
- component: {fileID: 7903039282078147184}
9291
m_Layer: 5
9392
m_Name: ApplyBtn
9493
m_TagString: Untagged
@@ -135,7 +134,7 @@ MonoBehaviour:
135134
m_SelectOnDown: {fileID: 0}
136135
m_SelectOnLeft: {fileID: 0}
137136
m_SelectOnRight: {fileID: 0}
138-
m_Transition: 3
137+
m_Transition: 2
139138
m_Colors:
140139
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
141140
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
@@ -145,40 +144,22 @@ MonoBehaviour:
145144
m_ColorMultiplier: 1
146145
m_FadeDuration: 0.1
147146
m_SpriteState:
148-
m_HighlightedSprite: {fileID: 0}
149-
m_PressedSprite: {fileID: 0}
150-
m_SelectedSprite: {fileID: 0}
151-
m_DisabledSprite: {fileID: 0}
147+
m_HighlightedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75,
148+
type: 3}
149+
m_PressedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75, type: 3}
150+
m_SelectedSprite: {fileID: 21300000, guid: 0d02c955b35ed40599bb4aca60216d75, type: 3}
151+
m_DisabledSprite: {fileID: 21300000, guid: b4b024c6ca6464483b99578de7edfd49, type: 3}
152152
m_AnimationTriggers:
153153
m_NormalTrigger: Normal
154154
m_HighlightedTrigger: Highlighted
155155
m_PressedTrigger: Pressed
156156
m_SelectedTrigger: Selected
157157
m_DisabledTrigger: Disabled
158158
m_Interactable: 1
159-
m_TargetGraphic: {fileID: 0}
159+
m_TargetGraphic: {fileID: 621010048144579813}
160160
m_OnClick:
161161
m_PersistentCalls:
162162
m_Calls: []
163-
--- !u!95 &7903039282078147184
164-
Animator:
165-
serializedVersion: 3
166-
m_ObjectHideFlags: 0
167-
m_CorrespondingSourceObject: {fileID: 0}
168-
m_PrefabInstance: {fileID: 0}
169-
m_PrefabAsset: {fileID: 0}
170-
m_GameObject: {fileID: 621010047649866792}
171-
m_Enabled: 1
172-
m_Avatar: {fileID: 0}
173-
m_Controller: {fileID: 9100000, guid: d9ec64ad24308456fa5542623bf92728, type: 2}
174-
m_CullingMode: 0
175-
m_UpdateMode: 0
176-
m_ApplyRootMotion: 0
177-
m_LinearVelocityBlending: 0
178-
m_WarningMessage:
179-
m_HasTransformHierarchy: 1
180-
m_AllowConstantClipSamplingOptimization: 1
181-
m_KeepAnimatorControllerStateOnDisable: 0
182163
--- !u!1 &621010048144579815
183164
GameObject:
184165
m_ObjectHideFlags: 0

CrazyCar/Assets/Scenes/Game.unity

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5393,6 +5393,11 @@ PrefabInstance:
53935393
propertyPath: m_Name
53945394
value: MapController
53955395
objectReference: {fileID: 0}
5396+
- target: {fileID: 5097897878828020142, guid: 7457633ed7dbf8c4abb9bc100e849fde,
5397+
type: 3}
5398+
propertyPath: m_IsActive
5399+
value: 1
5400+
objectReference: {fileID: 0}
53965401
m_RemovedComponents: []
53975402
m_SourcePrefab: {fileID: 100100000, guid: 7457633ed7dbf8c4abb9bc100e849fde, type: 3}
53985403
--- !u!1 &857937937380173897

CrazyCar/Assets/Scripts/Command/CommandHub.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected override void OnExecute() {
5555
data: bytes, token: this.GetModel<IGameControllerModel>().Token.Value,
5656
succData: (data) => {
5757
this.GetModel<IUserModel>().Aid.Value = (int)data["aid"];
58+
this.SendEvent(new UpdataAvatarUIEvent(this.GetModel<IUserModel>().Aid));
5859
this.GetModel<IGameControllerModel>().WarningAlert.ShowWithText(this.GetSystem<II18NSystem>().GetText("Successfully Set"));
5960
},
6061
code: (code) => {

CrazyCar/Assets/Scripts/Game/MPlayer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ public void ConfirmStatus(PlayerStateMsg playerStateMsg) {
9595
}
9696

9797
private void FixedUpdate() {
98+
if (IsRollover()) {
99+
Jump();
100+
}
101+
98102
CheckGroundNormal();
99103
Turn();
100104

@@ -158,6 +162,11 @@ private void AddForceToMove() {
158162
rig.AddForce(tempForce, ForceMode.Force);
159163
}
160164

165+
private bool IsRollover() {
166+
return transform.rotation.z > 10;
167+
}
168+
169+
161170
//检测是否在地面上,并且使车与地面保持水平
162171
private void CheckGroundNormal() {
163172
//从车头中心附近往下打射线,长度比发射点到车底的距离长一点

CrazyCar/Assets/Scripts/UI/Avatar/AvatarUI.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ private void OnEnable() {
2323
StartCoroutine(this.GetSystem<INetworkSystem>().POSTHTTP(url: this.GetSystem<INetworkSystem>().HttpBaseUrl + RequestUrl.avatarUrl,
2424
token: this.GetModel<IGameControllerModel>().Token.Value,
2525
succData: (data) => {
26-
this.GetSystem<IDataParseSystem>().ParseAvatarRes(data, UpdataUI);
2726
curAid = this.GetModel<IUserModel>().Aid.Value;
27+
this.GetSystem<IDataParseSystem>().ParseAvatarRes(data, UpdataUI);
2828
}));
2929
}
3030

@@ -40,6 +40,7 @@ private void UpdataUI() {
4040
}
4141

4242
private void Start() {
43+
applyBtn.interactable = false;
4344
applyBtn.onClick.AddListener(() => {
4445
this.GetSystem<ISoundSystem>().PlayClickSound();
4546
this.SendCommand(new ApplyAvatarCommand(curAid));
@@ -55,6 +56,11 @@ private void Start() {
5556
}
5657

5758
private void OnUpdataAvatarUIEvent(UpdataAvatarUIEvent e) {
59+
if (e.aid == this.GetModel<IUserModel>().Aid) {
60+
applyBtn.interactable = false;
61+
} else {
62+
applyBtn.interactable = true;
63+
}
5864
curAvatar.sprite = this.GetSystem<IResourceSystem>().GetAvatarResource(e.aid);
5965
curAvatarName.text = avatarModel.AvatarDic[e.aid].name;
6066
curAid = e.aid;

0 commit comments

Comments
 (0)