remaking new move system
Styl not complete
This commit is contained in:
@@ -16,7 +16,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5204016726758810502
|
||||
Transform:
|
||||
@@ -99,7 +99,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3133763052761698265
|
||||
Transform:
|
||||
@@ -177,13 +177,13 @@ GameObject:
|
||||
- component: {fileID: 2665829151930005690}
|
||||
- component: {fileID: 7025617415223936346}
|
||||
- component: {fileID: 991026633550732616}
|
||||
- component: {fileID: -3679359786245750542}
|
||||
- component: {fileID: 5817257923490631887}
|
||||
m_Layer: 0
|
||||
m_Name: platform_neutral
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2665829151930005690
|
||||
Transform:
|
||||
@@ -232,19 +232,15 @@ MeshCollider:
|
||||
m_Convex: 1
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 4300000, guid: db9955a831b9d1a49a8d725397ad8326, type: 3}
|
||||
--- !u!54 &-3679359786245750542
|
||||
Rigidbody:
|
||||
--- !u!114 &5817257923490631887
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7308296215773848360}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
@@ -95,7 +95,7 @@ GameObject:
|
||||
- component: {fileID: 6715234968966001404}
|
||||
- component: {fileID: 5071310171994536778}
|
||||
- component: {fileID: 8372693939530454457}
|
||||
- component: {fileID: 458963570543655786}
|
||||
- component: {fileID: 1381875388291725606}
|
||||
m_Layer: 0
|
||||
m_Name: platform_neutral_sharp
|
||||
m_TagString: platform
|
||||
@@ -162,22 +162,18 @@ MonoBehaviour:
|
||||
speed: 5
|
||||
audioSource: {fileID: 0}
|
||||
audioClips: []
|
||||
--- !u!54 &458963570543655786
|
||||
Rigidbody:
|
||||
--- !u!114 &1381875388291725606
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1560962678462888388}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1560962679917322222
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@@ -97,7 +97,6 @@ GameObject:
|
||||
- component: {fileID: 6189155224637060765}
|
||||
- component: {fileID: -443919199017515566}
|
||||
- component: {fileID: -731181381576803345}
|
||||
- component: {fileID: 3389900204265069980}
|
||||
m_Layer: 0
|
||||
m_Name: platform_power
|
||||
m_TagString: platform
|
||||
@@ -212,19 +211,3 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!54 &3389900204265069980
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7678802340880963262}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -115,7 +115,6 @@ GameObject:
|
||||
- component: {fileID: 6218203028538785626}
|
||||
- component: {fileID: 1204402889283165505}
|
||||
- component: {fileID: 7973800414101489524}
|
||||
- component: {fileID: 6165408165884203318}
|
||||
m_Layer: 0
|
||||
m_Name: platform_rrange
|
||||
m_TagString: platform
|
||||
@@ -330,19 +329,3 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!54 &6165408165884203318
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6650340373999088090}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -16,7 +16,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4600656011211176709
|
||||
Transform:
|
||||
@@ -94,13 +94,13 @@ GameObject:
|
||||
- component: {fileID: 1121309705137920178}
|
||||
- component: {fileID: 526948428540975981}
|
||||
- component: {fileID: 5794058540197003412}
|
||||
- component: {fileID: 8763404315579740833}
|
||||
- component: {fileID: 6002528643883098957}
|
||||
m_Layer: 0
|
||||
m_Name: platform_speed
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1121309705137920178
|
||||
Transform:
|
||||
@@ -149,22 +149,18 @@ MeshCollider:
|
||||
m_Convex: 1
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 4300000, guid: db9955a831b9d1a49a8d725397ad8326, type: 3}
|
||||
--- !u!54 &8763404315579740833
|
||||
Rigidbody:
|
||||
--- !u!114 &6002528643883098957
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7834549091241900869}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &8214805574275809151
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -181,7 +177,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1607747057115788900
|
||||
Transform:
|
||||
|
@@ -16,7 +16,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2628890433357983123
|
||||
Transform:
|
||||
@@ -99,7 +99,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2628890433674921147
|
||||
Transform:
|
||||
@@ -179,13 +179,12 @@ GameObject:
|
||||
- component: {fileID: 411423064055404482}
|
||||
- component: {fileID: 459485775853362848}
|
||||
- component: {fileID: 2187729912207573111}
|
||||
- component: {fileID: -6601052459336252156}
|
||||
m_Layer: 0
|
||||
m_Name: platform_start
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2628890434173161083
|
||||
Transform:
|
||||
@@ -279,19 +278,3 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!54 &-6601052459336252156
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2628890434173161082}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -1281,7 +1281,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: -0.000030517578}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!222 &2053745176
|
||||
@@ -1771,13 +1771,12 @@ GameObject:
|
||||
- component: {fileID: 3244356566819001085}
|
||||
- component: {fileID: 3244356566819001074}
|
||||
- component: {fileID: 3244356566819001073}
|
||||
- component: {fileID: 3244356566819001087}
|
||||
- component: {fileID: 3244356566819001086}
|
||||
- component: {fileID: 1172583624}
|
||||
- component: {fileID: 1943902172017936589}
|
||||
- component: {fileID: 8051388916173435998}
|
||||
m_Layer: 0
|
||||
m_Name: Body
|
||||
m_TagString: Untagged
|
||||
m_TagString: Player
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@@ -1790,7 +1789,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3244356566819001084}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1.82, z: -0.44}
|
||||
m_LocalPosition: {x: 0, y: 1.87, z: -0.44}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -1848,22 +1847,6 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!54 &3244356566819001087
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3244356566819001084}
|
||||
serializedVersion: 2
|
||||
m_Mass: 1
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 112
|
||||
m_CollisionDetection: 2
|
||||
--- !u!114 &3244356566819001086
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1881,9 +1864,13 @@ MonoBehaviour:
|
||||
maxSpeed: 15
|
||||
minSpeed: 5
|
||||
currentSpeed: 0
|
||||
speedModifier: 0
|
||||
rb: {fileID: 0}
|
||||
chc: {fileID: 0}
|
||||
isRunning: 0
|
||||
isFalling: 0
|
||||
jumpSpeed: 3
|
||||
jumpSpeed: 1
|
||||
jumpModifier: 0
|
||||
inAir: 0
|
||||
lookSpeed: 5
|
||||
lookXLimit: 10
|
||||
@@ -1902,19 +1889,8 @@ MonoBehaviour:
|
||||
- {fileID: 8300000, guid: 5e15f53ccc08c4e4496e13306a9e4743, type: 3}
|
||||
- {fileID: 8300000, guid: 049628ae43735224990d9bcea2f744ad, type: 3}
|
||||
- {fileID: 8300000, guid: 227c760da48796046b26b76b3706319b, type: 3}
|
||||
--- !u!65 &1172583624
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3244356566819001084}
|
||||
m_Material: {fileID: 13400000, guid: 055b414bc685d41409a41f4ea2d64231, type: 2}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 2, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
collide: 0
|
||||
saveDirection: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &1943902172017936589
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2011,6 +1987,24 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!143 &8051388916173435998
|
||||
CharacterController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3244356566819001084}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Height: 2
|
||||
m_Radius: 0.5
|
||||
m_SlopeLimit: 180
|
||||
m_StepOffset: 0.3
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &3244356567246256140
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@@ -16,7 +16,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1444217836988950975
|
||||
Transform:
|
||||
@@ -99,7 +99,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4004768572291123662
|
||||
Transform:
|
||||
@@ -177,13 +177,13 @@ GameObject:
|
||||
- component: {fileID: 2448110616132624592}
|
||||
- component: {fileID: 3336986385195135180}
|
||||
- component: {fileID: 4297191551228047469}
|
||||
- component: {fileID: -8845465503422763632}
|
||||
- component: {fileID: 2479976511386043243}
|
||||
m_Layer: 0
|
||||
m_Name: Platform 5
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2448110616132624592
|
||||
Transform:
|
||||
@@ -231,19 +231,15 @@ MonoBehaviour:
|
||||
speed: 0
|
||||
audioSource: {fileID: 0}
|
||||
audioClips: []
|
||||
--- !u!54 &-8845465503422763632
|
||||
Rigidbody:
|
||||
--- !u!114 &2479976511386043243
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6736808733118194127}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
@@ -16,7 +16,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7023346894872375308
|
||||
Transform:
|
||||
@@ -99,13 +99,12 @@ GameObject:
|
||||
- component: {fileID: 8238111678033492397}
|
||||
- component: {fileID: -5509448037057392871}
|
||||
- component: {fileID: 2527761051471871889}
|
||||
- component: {fileID: 4240483973579556787}
|
||||
m_Layer: 0
|
||||
m_Name: Platform_Blue
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8768991388683709944
|
||||
Transform:
|
||||
@@ -329,19 +328,3 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!54 &4240483973579556787
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8768991388683709947}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -17,7 +17,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8574925503902921965
|
||||
Transform:
|
||||
@@ -114,13 +114,12 @@ GameObject:
|
||||
- component: {fileID: 3339862426328537977}
|
||||
- component: {fileID: 3865253352867341094}
|
||||
- component: {fileID: -7597049073915248875}
|
||||
- component: {fileID: 3278078638141404736}
|
||||
m_Layer: 0
|
||||
m_Name: Platform_Green
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8768991388683709944
|
||||
Transform:
|
||||
@@ -230,22 +229,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!54 &3278078638141404736
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8768991388683709947}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
--- !u!1 &8985668614484660023
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -262,7 +245,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1012190739008653402
|
||||
Transform:
|
||||
|
@@ -115,7 +115,6 @@ GameObject:
|
||||
- component: {fileID: 5316890779910729157}
|
||||
- component: {fileID: -142748814437030588}
|
||||
- component: {fileID: 5862113707430629064}
|
||||
- component: {fileID: -6889792310482815023}
|
||||
m_Layer: 0
|
||||
m_Name: Platform_Red
|
||||
m_TagString: platform
|
||||
@@ -329,19 +328,3 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!54 &-6889792310482815023
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8768991388683709947}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -15,7 +15,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1979594279159666205
|
||||
Transform:
|
||||
@@ -91,7 +91,7 @@ GameObject:
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8768991388683709944
|
||||
Transform:
|
||||
|
@@ -17,7 +17,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2021819533839461673
|
||||
Transform:
|
||||
@@ -115,13 +115,12 @@ GameObject:
|
||||
- component: {fileID: 4344779564172896453}
|
||||
- component: {fileID: 5433657018731068073}
|
||||
- component: {fileID: 8383421295717427161}
|
||||
- component: {fileID: 3996111038030861644}
|
||||
m_Layer: 0
|
||||
m_Name: Platform_green_basic
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8768991388683709944
|
||||
Transform:
|
||||
@@ -326,19 +325,3 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!54 &3996111038030861644
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8768991388683709947}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -17,7 +17,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2021819533839461673
|
||||
Transform:
|
||||
@@ -115,13 +115,12 @@ GameObject:
|
||||
- component: {fileID: 4344779564172896453}
|
||||
- component: {fileID: 5433657018731068073}
|
||||
- component: {fileID: 8383421295717427161}
|
||||
- component: {fileID: 3996111038030861644}
|
||||
m_Layer: 0
|
||||
m_Name: Platform_yellow
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8768991388683709944
|
||||
Transform:
|
||||
@@ -330,19 +329,3 @@ AudioSource:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!54 &3996111038030861644
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8768991388683709947}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
|
@@ -11,13 +11,13 @@ GameObject:
|
||||
- component: {fileID: 6924804905937609835}
|
||||
- component: {fileID: 923436955745262935}
|
||||
- component: {fileID: 2125975832863856952}
|
||||
- component: {fileID: -9158675677278049386}
|
||||
- component: {fileID: 4240406909675977149}
|
||||
m_Layer: 0
|
||||
m_Name: platform 6
|
||||
m_TagString: platform
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6924804905937609835
|
||||
Transform:
|
||||
@@ -65,22 +65,18 @@ MonoBehaviour:
|
||||
speed: 0
|
||||
audioSource: {fileID: 0}
|
||||
audioClips: []
|
||||
--- !u!54 &-9158675677278049386
|
||||
Rigidbody:
|
||||
--- !u!114 &4240406909675977149
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2391451336753015343}
|
||||
serializedVersion: 2
|
||||
m_Mass: 50
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 126
|
||||
m_CollisionDetection: 1
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 61dae18984b7ff147ab1d77fb817687a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &4924719497898627403
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -97,7 +93,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4763405063613741546
|
||||
Transform:
|
||||
@@ -180,7 +176,7 @@ GameObject:
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_StaticEditorFlags: 2147483647
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4341890187507101056
|
||||
Transform:
|
||||
|
@@ -5269,6 +5269,10 @@ PrefabInstance:
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 3244356566819001086, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
|
||||
propertyPath: jumpSpeed
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3244356567246256142, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
|
||||
propertyPath: menuCamera
|
||||
value:
|
||||
|
@@ -27,4 +27,48 @@ public class PlatformManager : MonoBehaviour
|
||||
audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Count)]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Action(PlayerController player, string status)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case PlatformType.Basic:
|
||||
return;
|
||||
case PlatformType.Pull:
|
||||
if (status == "exit")
|
||||
{
|
||||
player.jumpModifier = speed * 10f;
|
||||
}
|
||||
return;
|
||||
case PlatformType.Push:
|
||||
if (status == "exit")
|
||||
{
|
||||
player.jumpModifier = speed * 10f;
|
||||
}
|
||||
return;
|
||||
case PlatformType.RotateY:
|
||||
return;
|
||||
case PlatformType.RotateZ:
|
||||
return;
|
||||
case PlatformType.SpeedDown:
|
||||
if (status == "enter")
|
||||
{
|
||||
if (player.speedModifier - speed >= 0)
|
||||
{
|
||||
player.speedModifier -= speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.speedModifier = 0.0f;
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PlatformType.SpeedUp:
|
||||
if (status == "enter")
|
||||
{
|
||||
player.speedModifier += speed;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,10 +11,14 @@ public class PlayerController : MonoBehaviour
|
||||
public float minSpeed = 5.0f;
|
||||
[HideInInspector]
|
||||
public float currentSpeed = 0f;
|
||||
private float speedModifier = 0.0f;
|
||||
[HideInInspector]
|
||||
public float speedModifier = 0.0f;
|
||||
Vector3 moveDirection = Vector3.zero;
|
||||
bool canMove = false;
|
||||
Rigidbody rb;
|
||||
[HideInInspector]
|
||||
public Rigidbody rb;
|
||||
[HideInInspector]
|
||||
public CharacterController chc;
|
||||
float moveDirectionY;
|
||||
public bool isRunning = false;
|
||||
|
||||
@@ -22,8 +26,12 @@ public class PlayerController : MonoBehaviour
|
||||
[Header("Jump")]
|
||||
public float jumpSpeed = 7.5f;
|
||||
[HideInInspector]
|
||||
public float jumpModifier = 0.0f;
|
||||
[HideInInspector]
|
||||
public bool inAir = false;
|
||||
private bool isGrounded = false;
|
||||
private float jumpTimer = 0.1f;
|
||||
private float jumpTime = 0f;
|
||||
[Header("Camera")]
|
||||
public float lookSpeed = 7.5f;
|
||||
public float lookXLimit = 40.0f;
|
||||
@@ -35,10 +43,14 @@ public class PlayerController : MonoBehaviour
|
||||
public AudioSource audioSource;
|
||||
public List<AudioClip> jumpClips = new List<AudioClip>();
|
||||
public List<AudioClip> audioClips = new List<AudioClip>();
|
||||
PlatformManager collidePlatform;
|
||||
string platformStatus = "exit";
|
||||
// Start is called before the first frame update
|
||||
|
||||
private Vector3 saveDirection;
|
||||
[HideInInspector]
|
||||
public Vector3 saveDirection;
|
||||
private Vector3 downDirection;
|
||||
Vector3 _velocity = Vector3.zero;
|
||||
|
||||
private Vector3 follow = Vector3.zero;
|
||||
|
||||
@@ -47,7 +59,8 @@ public class PlayerController : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody>();
|
||||
//rb = GetComponent<Rigidbody>();
|
||||
chc = GetComponent<CharacterController>();
|
||||
}
|
||||
|
||||
public void disableCursor()
|
||||
@@ -68,7 +81,7 @@ public class PlayerController : MonoBehaviour
|
||||
isRunning = Input.GetKey(KeyCode.LeftShift);
|
||||
if (canMove && currentSpeed < minSpeed)
|
||||
{
|
||||
currentSpeed += 0.01f;
|
||||
currentSpeed += 0.1f;
|
||||
}
|
||||
|
||||
if (Input.GetAxis("Vertical") > 0 && currentSpeed < maxSpeed)
|
||||
@@ -85,7 +98,7 @@ public class PlayerController : MonoBehaviour
|
||||
}
|
||||
|
||||
float curSpeedX = canMove ? (currentSpeed + speedModifier): 0;
|
||||
float curSpeedY = canMove ? (currentSpeed + speedModifier) * Input.GetAxis("Horizontal") : 0;
|
||||
float curSpeedY = canMove ? speed * Input.GetAxis("Horizontal") : 0;
|
||||
|
||||
moveDirection = (transform.forward * curSpeedX * Time.deltaTime) + (transform.right * curSpeedY * Time.deltaTime);
|
||||
|
||||
@@ -98,12 +111,6 @@ public class PlayerController : MonoBehaviour
|
||||
runningParticles.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
|
||||
{
|
||||
inAir = true;
|
||||
isGrounded = false;
|
||||
}
|
||||
|
||||
if (audioSource != null && audioClips.Count > 0)
|
||||
{
|
||||
if ((currentSpeed + speedModifier) > speed * 3f && (currentSpeed + speedModifier) < speed * 6f)
|
||||
@@ -135,21 +142,88 @@ public class PlayerController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
rb.MovePosition(rb.position + moveDirection);
|
||||
PlatformManager localP = null;
|
||||
if (collidePlatform != null)
|
||||
{
|
||||
collidePlatform.Step();
|
||||
collidePlatform.Action(this, platformStatus);
|
||||
localP = collidePlatform;
|
||||
if (platformStatus == "enter")
|
||||
{
|
||||
platformStatus = "stay";
|
||||
collidePlatform = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (platformStatus == "stay")
|
||||
{
|
||||
platformStatus = "exit";
|
||||
if (localP != null)
|
||||
{
|
||||
localP.Action(this, platformStatus);
|
||||
localP = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jumpTime <= Time.time)
|
||||
{
|
||||
jumpModifier = 0.0f;
|
||||
Vector3 locGrav = (Physics.gravity * Time.deltaTime);
|
||||
if (!isGrounded)
|
||||
{
|
||||
_velocity += Physics.gravity / 50 * Time.deltaTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
_velocity = Physics.gravity * Time.deltaTime;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_velocity += transform.up * (jumpSpeed + jumpModifier) / 5 * Time.deltaTime;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
|
||||
{
|
||||
//inAir = true;
|
||||
if (audioSource != null && jumpClips.Count > 0)
|
||||
{
|
||||
audioSource.PlayOneShot(jumpClips[Random.Range(0, jumpClips.Count)]);
|
||||
}
|
||||
_velocity = Vector3.zero;
|
||||
jumpTime = jumpTimer + Time.time;
|
||||
isGrounded = false;
|
||||
}
|
||||
|
||||
chc.Move(moveDirection + _velocity);
|
||||
|
||||
//rb.MovePosition(rb.position + moveDirection);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (inAir)
|
||||
downDirection = -transform.up;
|
||||
if (Physics.gravity != (downDirection * 9.81f)) {
|
||||
if (downDirection == Vector3.forward)
|
||||
{
|
||||
downDirection = Vector3.down;
|
||||
}
|
||||
Physics.gravity = downDirection * 9.81f;
|
||||
}
|
||||
|
||||
/*if (inAir)
|
||||
{
|
||||
// Debug.Log("Jump");
|
||||
if (audioSource != null && jumpClips.Count > 0)
|
||||
{
|
||||
audioSource.PlayOneShot(jumpClips[Random.Range(0, jumpClips.Count)]);
|
||||
}
|
||||
rb.AddForce(transform.up * jumpSpeed * 100f * Time.deltaTime, ForceMode.Impulse);
|
||||
chc.Move(transform.up * jumpSpeed * 100f * Time.deltaTime);
|
||||
//rb.AddForce(transform.up * jumpSpeed * 100f * Time.deltaTime, ForceMode.Impulse);
|
||||
inAir = false;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (Vector3.Distance(transform.position, new Vector3(0f, 0f, transform.position.z)) > 10f)
|
||||
{
|
||||
@@ -161,7 +235,7 @@ public class PlayerController : MonoBehaviour
|
||||
this.isFalling = false;
|
||||
}
|
||||
|
||||
if (saveDirection != Vector3.zero)
|
||||
if (saveDirection != -transform.up)
|
||||
{
|
||||
Vector3 axis;
|
||||
float angle;
|
||||
@@ -171,125 +245,83 @@ public class PlayerController : MonoBehaviour
|
||||
transform.RotateAround(axis, angle * Time.deltaTime * 8f);
|
||||
}
|
||||
|
||||
var distanceFromYAxis = new Vector2(rb.position.x, rb.position.y).magnitude;
|
||||
var distanceFromYAxis = new Vector2(transform.position.x, transform.position.y).magnitude;
|
||||
if (UiController.isInMenu == false && distanceFromYAxis > this.maxDistanceFromCenterLine)
|
||||
{
|
||||
Debug.Log("Player fell out of map.");
|
||||
rb.velocity = Vector3.zero;
|
||||
//rb.velocity = Vector3.zero;
|
||||
UiController.isInMenu = true;
|
||||
Physics.gravity = -Vector3.up * 9.81f;
|
||||
Physics.gravity = Vector3.down * 9.81f;
|
||||
UiController.SaveGame();
|
||||
UnityEngine.SceneManagement.SceneManager.LoadScene(0);
|
||||
}
|
||||
}
|
||||
|
||||
void OnCollisionExit(Collision other)
|
||||
/*void OnCollisionExit(Collision other)
|
||||
{
|
||||
if (other.gameObject.tag == "platform")
|
||||
{
|
||||
Physics.gravity = this.downDirection * 9.81f;
|
||||
if (other.gameObject.tag != "platform") return;
|
||||
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
|
||||
if (platform != null)
|
||||
{
|
||||
platform.Step();
|
||||
float step = platform.speed * Time.deltaTime * 10f;
|
||||
switch (platform.type)
|
||||
{
|
||||
case PlatformManager.PlatformType.Push:
|
||||
rb.AddForce(-saveDirection * step, ForceMode.VelocityChange);
|
||||
break;
|
||||
case PlatformManager.PlatformType.Pull:
|
||||
rb.AddForce(saveDirection * step, ForceMode.VelocityChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (platform == null) return;
|
||||
|
||||
platform.Step();
|
||||
platform.Action(this, "exit");
|
||||
}
|
||||
|
||||
void OnCollisionStay(Collision other)
|
||||
{
|
||||
if (other.gameObject.tag != "platform") return;
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
if (platform == null)
|
||||
{
|
||||
// FIXME: Should platforms be allowed to not to have a PlatformManager?
|
||||
// Debug.Log("ERROR");
|
||||
|
||||
Vector3 contact = other.GetContact(other.contacts.Length - 1).normal;
|
||||
if (contact != -other.transform.up && contact != other.transform.up) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.GetContact(other.contacts.Length - 1).normal == other.transform.forward
|
||||
|| other.GetContact(other.contacts.Length - 1).normal == -other.transform.forward
|
||||
|| other.GetContact(other.contacts.Length - 1).normal == -other.transform.right
|
||||
|| other.GetContact(other.contacts.Length - 1).normal == other.transform.right
|
||||
|| (other.GetContact(other.contacts.Length - 1).normal != -other.transform.up
|
||||
&& other.GetContact(other.contacts.Length - 1).normal != other.transform.up)
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.downDirection = -transform.up;
|
||||
saveDirection = -other.GetContact(other.contacts.Length - 1).normal;
|
||||
|
||||
// TODO: Handle other PlatformTypes
|
||||
Physics.gravity = this.downDirection * 9.81f;
|
||||
|
||||
saveDirection = -contact;
|
||||
}
|
||||
|
||||
void OnCollisionEnter(Collision other)
|
||||
{
|
||||
Debug.Log("Collide :D");
|
||||
isGrounded = true;
|
||||
if (other.gameObject.tag == "platform")
|
||||
if (other.gameObject.tag != "platform") return;
|
||||
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
|
||||
if (platform != null)
|
||||
{
|
||||
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
|
||||
if (platform != null)
|
||||
{
|
||||
platform.Step();
|
||||
switch (platform.type)
|
||||
{
|
||||
case PlatformManager.PlatformType.Push:
|
||||
break;
|
||||
case PlatformManager.PlatformType.Pull:
|
||||
break;
|
||||
case PlatformManager.PlatformType.RotateY:
|
||||
break;
|
||||
case PlatformManager.PlatformType.RotateZ:
|
||||
break;
|
||||
case PlatformManager.PlatformType.SpeedUp:
|
||||
speedModifier += platform.speed;
|
||||
break;
|
||||
case PlatformManager.PlatformType.SpeedDown:
|
||||
if (speedModifier - platform.speed >= 0)
|
||||
{
|
||||
speedModifier -= platform.speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
speedModifier = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (other.GetContact(0).normal == other.transform.forward
|
||||
|| other.GetContact(0).normal == -other.transform.forward
|
||||
|| other.GetContact(0).normal == -other.transform.right
|
||||
|| other.GetContact(0).normal == other.transform.right
|
||||
|| (other.GetContact(0).normal != -other.transform.up
|
||||
&& other.GetContact(0).normal != other.transform.up)
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
saveDirection = -other.GetContact(0).normal;
|
||||
Vector3 gDirection = -transform.up;
|
||||
if (platform == null)
|
||||
{
|
||||
gDirection = -transform.up;
|
||||
}
|
||||
this.downDirection = gDirection;
|
||||
Physics.gravity = gDirection * 9.81f;
|
||||
platform.Step();
|
||||
platform.Action(this, "enter");
|
||||
}
|
||||
|
||||
Vector3 contact = other.GetContact(other.contacts.Length - 1).normal;
|
||||
if (contact != -other.transform.up &&
|
||||
contact != other.transform.up) {
|
||||
return;
|
||||
}
|
||||
|
||||
saveDirection = -contact;
|
||||
} */
|
||||
|
||||
void OnControllerColliderHit(ControllerColliderHit hit)
|
||||
{
|
||||
isGrounded = true;
|
||||
if (platformStatus == "exit") {
|
||||
platformStatus = "enter";
|
||||
}
|
||||
if (hit.gameObject.tag != "platform") return;
|
||||
|
||||
collidePlatform = hit.gameObject.GetComponent<PlatformManager>();
|
||||
|
||||
Vector3 contact = hit.normal;
|
||||
if (contact != -hit.gameObject.transform.up &&
|
||||
contact != hit.gameObject.transform.up)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
saveDirection = -contact;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -79,9 +79,6 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
float angle = 360f / (float)pieceCount;
|
||||
|
||||
Bounds bounds = this.getPrefabBounds(lastObject);
|
||||
Bounds b = this.getPrefabBounds(objToSpawn);
|
||||
|
||||
Vector3 centerPoint = new Vector3(lastObject.transform.position.x, (lastObject.transform.position.y + radius), lastObject.transform.position.z + (lastObject.name.Contains("chunk") ? bounds.size.z : bounds.extents.z) + b.extents.z);
|
||||
|
||||
float heightOffset = radius;
|
||||
|
||||
@@ -92,7 +89,7 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
Vector3 position = (lastObject.transform.position + (direction * radius));
|
||||
|
||||
GameObject newObject = Instantiate(objToSpawn, new Vector3(position.x, position.y + heightOffset, position.z + (float)(i * horizontalDistancePerPlatform) + (lastObject.name.Contains("chunk") ? bounds.extents.z : 0f)), rotation);
|
||||
newObject.transform.parent = parentLevelObject.transform;
|
||||
//newObject.transform.parent = parentLevelObject.transform;
|
||||
levelBlocksSpawnTemp.Add(newObject);
|
||||
}
|
||||
|
||||
@@ -144,7 +141,7 @@ public class ProceduralGeneration : MonoBehaviour
|
||||
for (var i = 0; i < this.spawnedLevelBlocks.Count; i++)
|
||||
{
|
||||
float distance = Vector3.Distance(this.spawnedLevelBlocks[i].transform.position, playerPosition);
|
||||
if (distance > this.maximumDistanceOfPlatformFromPlayer && this.spawnedLevelBlocks.Count >= this.maximumNumberOfPlatformsAtScene && playerPosition.z > this.spawnedLevelBlocks[i].transform.position.z)
|
||||
if (distance > this.maximumDistanceOfPlatformFromPlayer && this.spawnedLevelBlocks.Count >= this.maximumNumberOfPlatformsAtScene && playerPosition.z > this.spawnedLevelBlocks[i].transform.position.z + 2)
|
||||
{
|
||||
Destroy(this.spawnedLevelBlocks[i]);
|
||||
this.spawnedLevelBlocks.Remove(this.spawnedLevelBlocks[i]);
|
||||
|
@@ -7,7 +7,7 @@ public class gizmoManager : MonoBehaviour
|
||||
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
if (this.gameObject != null && !this.gameObject.transform.parent.name.Contains("chunk"))
|
||||
if (this.gameObject != null && this.gameObject.transform.parent != null && !this.gameObject.transform.parent.name.Contains("chunk"))
|
||||
{
|
||||
Bounds bounds = GetChildRendererBounds(gameObject);
|
||||
Gizmos.DrawWireCube(bounds.center, bounds.size);
|
||||
|
Reference in New Issue
Block a user